當前位置: 首頁>>代碼示例>>Java>>正文


Java CascadeType.MERGE屬性代碼示例

本文整理匯總了Java中javax.persistence.CascadeType.MERGE屬性的典型用法代碼示例。如果您正苦於以下問題:Java CascadeType.MERGE屬性的具體用法?Java CascadeType.MERGE怎麽用?Java CascadeType.MERGE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在javax.persistence.CascadeType的用法示例。


在下文中一共展示了CascadeType.MERGE屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: needsToCascade

private static boolean needsToCascade(Field field) {
    Class<?> fieldtype = field.getType();
    if (!DomainObject.class.isAssignableFrom(fieldtype))
        return false;
    Annotation ann;
    CascadeType[] cascades = null;
    ann = field.getAnnotation(OneToOne.class);
    if (ann != null) {
        cascades = ((OneToOne) ann).cascade();
    } else {
        ann = field.getAnnotation(OneToMany.class);
        if (ann != null) {
            cascades = ((OneToMany) ann).cascade();
        } else {
            ann = field.getAnnotation(ManyToOne.class);
            if (ann != null) {
                cascades = ((ManyToOne) ann).cascade();
            } else {
                ann = field.getAnnotation(ManyToMany.class);
                if (ann != null) {
                    cascades = ((ManyToMany) ann).cascade();
                }
            }
        }
    }
    if (cascades == null)
        return false;
    for (CascadeType cas : cascades) {
        if ((cas == CascadeType.ALL) || (cas == CascadeType.MERGE)
                || (cas == CascadeType.PERSIST)
                || (cas == CascadeType.REMOVE)) {
            return true;
        }
    }
    return false;
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:36,代碼來源:ReflectiveClone.java

示例2: getMovieStyleSet

@ManyToMany(cascade = CascadeType.MERGE, fetch = FetchType.LAZY)
@JoinTable(name = "R_Movie_MovieStyle",
        joinColumns = {@JoinColumn(name = "movie_id", referencedColumnName = "movie_id", [email protected](name="FK_R_MovieStyle_Movie"))},
        inverseJoinColumns = {@JoinColumn(name = "movie_style_id", referencedColumnName ="movie_style_id", [email protected](name="FK_R_Movie_MovieStyle"))})
public Set<MovieStyle> getMovieStyleSet() {
    return movieStyleSet;
}
 
開發者ID:AwesomeTickets,項目名稱:ServiceServer,代碼行數:7,代碼來源:Movie.java

示例3: getCountry

@ManyToOne(cascade = {CascadeType.MERGE}, fetch = FetchType.LAZY)
@JoinColumn(name = "country_id", [email protected](name="FK_R_Movie_Country"))
public Country getCountry() {
    return country;
}
 
開發者ID:AwesomeTickets,項目名稱:ServiceServer,代碼行數:5,代碼來源:Movie.java

示例4: getMovieStatus

@ManyToOne(cascade = {CascadeType.MERGE}, fetch = FetchType.LAZY)
@JoinColumn(name = "movie_status_id", [email protected](name="FK_R_Movie_MovieStatus"))
public MovieStatus getMovieStatus() {
    return movieStatus;
}
 
開發者ID:AwesomeTickets,項目名稱:ServiceServer,代碼行數:5,代碼來源:Movie.java

示例5: getMovieType

@ManyToOne(cascade = {CascadeType.MERGE}, fetch = FetchType.LAZY)
@JoinColumn(name = "movie_type_id", [email protected](name="FK_R_Movie_MovieType"))
public MovieType getMovieType() {
    return movieType;
}
 
開發者ID:AwesomeTickets,項目名稱:ServiceServer,代碼行數:5,代碼來源:Movie.java

示例6: getAllocator

@ManyToOne(fetch = FetchType.EAGER,cascade={CascadeType.MERGE,CascadeType.PERSIST})
@JoinColumn(name = "allocator")
public Allocator getAllocator() {
	return this.allocator;
}
 
開發者ID:AuScope,項目名稱:igsn30,代碼行數:5,代碼來源:Registrant.java

示例7: getChildren

@OneToMany(mappedBy = "parent",
           fetch = FetchType.EAGER,
           cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH })
public List<MethodAccessAnnotationTestBean> getChildren() {
    return childBeans;
}
 
開發者ID:ArneLimburg,項目名稱:jpasecurity,代碼行數:6,代碼來源:MethodAccessAnnotationTestBean.java

示例8: getProcessInstance

@ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST, CascadeType.MERGE })
public ProcessInstance getProcessInstance() {
    return processInstance;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:4,代碼來源:ActivityState.java

示例9: getActivityDefinition

@ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST, CascadeType.MERGE })
public ActivityDefinition getActivityDefinition() {
    return activityDefinition;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:4,代碼來源:ActivityState.java

示例10: getProcessDefinition

@ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
public ProcessDefinition getProcessDefinition() {
    return processDefinition;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:4,代碼來源:ProcessInstance.java

示例11: getProcessDefinition

@ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST, CascadeType.MERGE })
public ProcessDefinition getProcessDefinition() {
    return processDefinition;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:4,代碼來源:ActivityDefinition.java

示例12: getStati

@OrderBy("dataInizio DESC")
@OneToMany(mappedBy="mezzo", cascade={CascadeType.PERSIST, CascadeType.MERGE})
public List<StatoMezzo> getStati() {
	return stati;
}
 
開發者ID:Inspiredsoft,項目名稱:parco,代碼行數:5,代碼來源:Mezzo.java

示例13: getAssegnazioni

@OrderBy("dataInizio DESC")
@OneToMany(mappedBy="mezzo", cascade={CascadeType.PERSIST, CascadeType.MERGE}, fetch=FetchType.EAGER)
public List<AssegnazioneMezzo> getAssegnazioni() {
	return assegnazioni;
}
 
開發者ID:Inspiredsoft,項目名稱:parco,代碼行數:5,代碼來源:Mezzo.java

示例14: getStati

@OrderBy("dataInizio DESC")
@OneToMany(mappedBy="asset", cascade={CascadeType.PERSIST, CascadeType.MERGE})
public List<StatoAsset> getStati() {
	return stati;
}
 
開發者ID:Inspiredsoft,項目名稱:parco,代碼行數:5,代碼來源:Asset.java

示例15: getMovimenti

@OrderBy("data DESC")
@OneToMany(mappedBy="asset", cascade={CascadeType.PERSIST, CascadeType.MERGE})
public List<MovimentoAsset> getMovimenti() {
	return movimenti;
}
 
開發者ID:Inspiredsoft,項目名稱:parco,代碼行數:5,代碼來源:Asset.java


注:本文中的javax.persistence.CascadeType.MERGE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。