当前位置: 首页>>代码示例>>Java>>正文


Java CascadeType.REMOVE属性代码示例

本文整理汇总了Java中javax.persistence.CascadeType.REMOVE属性的典型用法代码示例。如果您正苦于以下问题:Java CascadeType.REMOVE属性的具体用法?Java CascadeType.REMOVE怎么用?Java CascadeType.REMOVE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.persistence.CascadeType的用法示例。


在下文中一共展示了CascadeType.REMOVE属性的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: hasCascadeAll

private boolean hasCascadeAll(CascadeType[] cascades)
{
	for( CascadeType type : cascades )
	{
		if( CascadeType.ALL == type || CascadeType.REMOVE == type )
		{
			return true;
		}
	}
	return false;
}
 
开发者ID:equella,项目名称:Equella,代码行数:11,代码来源:Property.java

示例3: getAlertes

@OneToMany(mappedBy="expedient", cascade=CascadeType.REMOVE)
public Set<Alerta> getAlertes() {
	return this.alertes;
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:4,代码来源:ExpedientHelium.java

示例4: getAttributes

/**
 * 获取筛选属性
 * 
 * @return 筛选属性
 */
@OneToMany(mappedBy = "productCategory", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@OrderBy("order asc")
public Set<Attribute> getAttributes() {
	return attributes;
}
 
开发者ID:justinbaby,项目名称:my-paper,代码行数:10,代码来源:ProductCategory.java

示例5: getCarrecs

@OneToMany(mappedBy="area", cascade=CascadeType.REMOVE)
public Set<Carrec> getCarrecs() {
	return this.carrecs;
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:4,代码来源:Area.java

示例6: getArees

@OneToMany(mappedBy="tipus", cascade=CascadeType.REMOVE)
public Set<Area> getArees() {
	return this.arees;
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:4,代码来源:AreaTipus.java

示例7: getReplyConsultations

/**
 * 获取回复
 * 
 * @return 回复
 */
@OneToMany(mappedBy = "forConsultation", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@OrderBy("createDate asc")
public Set<Consultation> getReplyConsultations() {
	return replyConsultations;
}
 
开发者ID:justinbaby,项目名称:my-paper,代码行数:10,代码来源:Consultation.java

示例8: getReplyMessages

/**
 * 获取回复消息
 * 
 * @return 回复消息
 */
@OneToMany(mappedBy = "forMessage", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@OrderBy(value = "createDate asc")
public Set<Message> getReplyMessages() {
	return replyMessages;
}
 
开发者ID:justinbaby,项目名称:my-paper,代码行数:10,代码来源:Message.java

示例9: getReceivers

/**
 * 获取收货地址
 * 
 * @return 收货地址
 */
@OneToMany(mappedBy = "member", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@OrderBy("isDefault desc, createDate desc")
public Set<Receiver> getReceivers() {
	return receivers;
}
 
开发者ID:justinbaby,项目名称:my-paper,代码行数:10,代码来源:Member.java

示例10: getChildren

/**
 * 获取下级地区
 * 
 * @return 下级地区
 */
@OneToMany(mappedBy = "parent", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@OrderBy("order asc")
public Set<Area> getChildren() {
	return children;
}
 
开发者ID:justinbaby,项目名称:my-paper,代码行数:10,代码来源:Area.java

示例11: 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

示例12: getOrderLogs

/**
 * 获取订单日志
 * 
 * @return 订单日志
 */
@OneToMany(mappedBy = "order", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@OrderBy("createDate asc")
public Set<OrderLog> getOrderLogs() {
	return orderLogs;
}
 
开发者ID:justinbaby,项目名称:my-paper,代码行数:10,代码来源:Order.java

示例13: getScontrino

@OneToOne(mappedBy="rifornimento", fetch=FetchType.LAZY, cascade={CascadeType.REMOVE})
public Scontrino getScontrino() {
	return scontrino;
}
 
开发者ID:Inspiredsoft,项目名称:parco,代码行数:4,代码来源:Rifornimento.java

示例14: getRefunds

/**
 * 获取退款单
 * 
 * @return 退款单
 */
@OneToMany(mappedBy = "order", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@OrderBy("createDate asc")
public Set<Refunds> getRefunds() {
	return refunds;
}
 
开发者ID:justinbaby,项目名称:my-paper,代码行数:10,代码来源:Order.java

示例15: getShippings

/**
 * 获取发货单
 * 
 * @return 发货单
 */
@OneToMany(mappedBy = "order", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@OrderBy("createDate asc")
public Set<Shipping> getShippings() {
	return shippings;
}
 
开发者ID:justinbaby,项目名称:my-paper,代码行数:10,代码来源:Order.java


注:本文中的javax.persistence.CascadeType.REMOVE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。