当前位置: 首页>>代码示例>>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;未经允许,请勿转载。