本文整理汇总了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;
}
示例2: hasCascadeAll
private boolean hasCascadeAll(CascadeType[] cascades)
{
for( CascadeType type : cascades )
{
if( CascadeType.ALL == type || CascadeType.REMOVE == type )
{
return true;
}
}
return false;
}
示例3: getAlertes
@OneToMany(mappedBy="expedient", cascade=CascadeType.REMOVE)
public Set<Alerta> getAlertes() {
return this.alertes;
}
示例4: getAttributes
/**
* 获取筛选属性
*
* @return 筛选属性
*/
@OneToMany(mappedBy = "productCategory", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@OrderBy("order asc")
public Set<Attribute> getAttributes() {
return attributes;
}
示例5: getCarrecs
@OneToMany(mappedBy="area", cascade=CascadeType.REMOVE)
public Set<Carrec> getCarrecs() {
return this.carrecs;
}
示例6: getArees
@OneToMany(mappedBy="tipus", cascade=CascadeType.REMOVE)
public Set<Area> getArees() {
return this.arees;
}
示例7: getReplyConsultations
/**
* 获取回复
*
* @return 回复
*/
@OneToMany(mappedBy = "forConsultation", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@OrderBy("createDate asc")
public Set<Consultation> getReplyConsultations() {
return replyConsultations;
}
示例8: getReplyMessages
/**
* 获取回复消息
*
* @return 回复消息
*/
@OneToMany(mappedBy = "forMessage", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@OrderBy(value = "createDate asc")
public Set<Message> getReplyMessages() {
return replyMessages;
}
示例9: getReceivers
/**
* 获取收货地址
*
* @return 收货地址
*/
@OneToMany(mappedBy = "member", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@OrderBy("isDefault desc, createDate desc")
public Set<Receiver> getReceivers() {
return receivers;
}
示例10: getChildren
/**
* 获取下级地区
*
* @return 下级地区
*/
@OneToMany(mappedBy = "parent", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@OrderBy("order asc")
public Set<Area> getChildren() {
return children;
}
示例11: getChildren
@OneToMany(mappedBy = "parent",
fetch = FetchType.EAGER,
cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH })
public List<MethodAccessAnnotationTestBean> getChildren() {
return childBeans;
}
示例12: getOrderLogs
/**
* 获取订单日志
*
* @return 订单日志
*/
@OneToMany(mappedBy = "order", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@OrderBy("createDate asc")
public Set<OrderLog> getOrderLogs() {
return orderLogs;
}
示例13: getScontrino
@OneToOne(mappedBy="rifornimento", fetch=FetchType.LAZY, cascade={CascadeType.REMOVE})
public Scontrino getScontrino() {
return scontrino;
}
示例14: getRefunds
/**
* 获取退款单
*
* @return 退款单
*/
@OneToMany(mappedBy = "order", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@OrderBy("createDate asc")
public Set<Refunds> getRefunds() {
return refunds;
}
示例15: getShippings
/**
* 获取发货单
*
* @return 发货单
*/
@OneToMany(mappedBy = "order", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@OrderBy("createDate asc")
public Set<Shipping> getShippings() {
return shippings;
}