當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。