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


Java CascadeType類代碼示例

本文整理匯總了Java中org.hibernate.annotations.CascadeType的典型用法代碼示例。如果您正苦於以下問題:Java CascadeType類的具體用法?Java CascadeType怎麽用?Java CascadeType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: getAnnotations

import org.hibernate.annotations.CascadeType; //導入依賴的package包/類
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@JoinColumn(name = "annotatedObjId")
@Where(clause = "annotatedObjType = 'MeasurementOrFact'")
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE })
@JsonIgnore
public Set<Annotation> getAnnotations() {
	return annotations;
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:9,代碼來源:MeasurementOrFact.java

示例2: getEnvModifiers

import org.hibernate.annotations.CascadeType; //導入依賴的package包/類
@Cascade(CascadeType.ALL)
@OneToMany(mappedBy = "taskData")
@OnDelete(action = OnDeleteAction.CASCADE)
public List<EnvironmentModifierData> getEnvModifiers() {
    return envModifiers;
}
 
開發者ID:ow2-proactive,項目名稱:scheduling,代碼行數:7,代碼來源:TaskData.java

示例3: getAnnotations

import org.hibernate.annotations.CascadeType; //導入依賴的package包/類
@Override
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@JoinColumn(name = "annotatedObjId")
@Where(clause = "annotatedObjType = 'Identification'")
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE })
public Set<Annotation> getAnnotations() {
	return annotations;
}
 
開發者ID:RBGKew,項目名稱:powop,代碼行數:9,代碼來源:Identification.java

示例4: getAnnotations

import org.hibernate.annotations.CascadeType; //導入依賴的package包/類
/**
 * @return the annotations
 */
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@JoinColumn(name = "annotatedObjId")
@Where(clause = "annotatedObjType = 'Distribution'")
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE })
@JsonIgnore
public Set<Annotation> getAnnotations() {
	return annotations;
}
 
開發者ID:RBGKew,項目名稱:powop,代碼行數:12,代碼來源:Distribution.java

示例5: convertToHibernateCascadeType

import org.hibernate.annotations.CascadeType; //導入依賴的package包/類
private static EnumSet<CascadeType> convertToHibernateCascadeType(javax.persistence.CascadeType[] ejbCascades) {
	EnumSet<CascadeType> hibernateCascadeSet = EnumSet.noneOf( CascadeType.class );
	if ( ejbCascades != null && ejbCascades.length > 0 ) {
		for ( javax.persistence.CascadeType cascade : ejbCascades ) {
			switch ( cascade ) {
				case ALL:
					hibernateCascadeSet.add( CascadeType.ALL );
					break;
				case PERSIST:
					hibernateCascadeSet.add( CascadeType.PERSIST );
					break;
				case MERGE:
					hibernateCascadeSet.add( CascadeType.MERGE );
					break;
				case REMOVE:
					hibernateCascadeSet.add( CascadeType.REMOVE );
					break;
				case REFRESH:
					hibernateCascadeSet.add( CascadeType.REFRESH );
					break;
				case DETACH:
					hibernateCascadeSet.add( CascadeType.DETACH );
					break;
			}
		}
	}

	return hibernateCascadeSet;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:30,代碼來源:AnnotationBinder.java

示例6: cascadeSave

import org.hibernate.annotations.CascadeType; //導入依賴的package包/類
private void cascadeSave(UniqueId<Long> entity) throws Exception {
    for (Field field : entity.getClass().getDeclaredFields()) {
        if (isLongUniqueId(field.getType()) && isCascade(field, CascadeType.SAVE_UPDATE)) {
            field.setAccessible(true);
            @SuppressWarnings("unchecked")
            UniqueId<Long> fieldValue = (UniqueId<Long>) field.get(entity);
            if (fieldValue != null) {
                assignId(fieldValue);
            }
        }
    }
}
 
開發者ID:jonestimd,項目名稱:finances,代碼行數:13,代碼來源:MockDaoContext.java

示例7: getExpedientTipus

import org.hibernate.annotations.CascadeType; //導入依賴的package包/類
@SuppressWarnings("deprecation")
@ManyToOne(optional=true)
@JoinColumn(name="expedient_tipus")
@ForeignKey(name="hel_exptipus_seqdefany_fk")
@Cascade({CascadeType.DELETE_ORPHAN})
public ExpedientTipus getExpedientTipus() {
	return expedientTipus;
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:9,代碼來源:SequenciaDefaultAny.java

示例8: getAnnotations

import org.hibernate.annotations.CascadeType; //導入依賴的package包/類
/**
 * @return the annotations
 */
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@JoinColumn(name = "annotatedObjId")
@Where(clause = "annotatedObjType = 'Description'")
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE })
@JsonIgnore
public Set<Annotation> getAnnotations() {
	return annotations;
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:12,代碼來源:Description.java

示例9: getRelatedOnes

import org.hibernate.annotations.CascadeType; //導入依賴的package包/類
@OneToMany(fetch=FetchType.LAZY)
@Cascade({
	CascadeType.PERSIST
  , CascadeType.MERGE
  , CascadeType.REFRESH
  , CascadeType.SAVE_UPDATE
  , CascadeType.DETACH
})
@JoinTable(name = "FRAGMENT2FRAGMENT",
    joinColumns = @JoinColumn(name = "from_id"),
    inverseJoinColumns = @JoinColumn(name = "to_id"))
public Set<Fragment> getRelatedOnes() {
    return relatedOnes;
}
 
開發者ID:suewonjp,項目名稱:civilizer,代碼行數:15,代碼來源:Fragment.java

示例10: getTaxa

import org.hibernate.annotations.CascadeType; //導入依賴的package包/類
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "Taxon_TypeAndSpecimen", joinColumns = {@JoinColumn(name = "typesAndSpecimens_id")}, inverseJoinColumns = {@JoinColumn(name = "Taxon_id")})
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE })
@JsonSerialize(contentUsing = TaxonSerializer.class)
public Set<Taxon> getTaxa() {
	return taxa;
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:8,代碼來源:TypeAndSpecimen.java

示例11: getAnnotations

import org.hibernate.annotations.CascadeType; //導入依賴的package包/類
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@JoinColumn(name = "annotatedObjId")
@Where(clause = "annotatedObjType = 'TypeAndSpecimen'")
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE })
@JsonIgnore
public Set<Annotation> getAnnotations() {
	return annotations;
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:9,代碼來源:TypeAndSpecimen.java

示例12: getTaxa

import org.hibernate.annotations.CascadeType; //導入依賴的package包/類
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "Taxon_IdentificationKey", joinColumns = {@JoinColumn(name = "keys_id")}, inverseJoinColumns = {@JoinColumn(name = "Taxon_id")})
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE })
@JsonSerialize(contentUsing = TaxonSerializer.class)
public Set<Taxon> getTaxa() {
	return taxa;
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:8,代碼來源:IdentificationKey.java

示例13: getComments

import org.hibernate.annotations.CascadeType; //導入依賴的package包/類
/**
 * @return the comments
 */
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@JoinColumn(name = "commentPage_id")
@OrderBy("created DESC")
@Where(clause = "commentPage_type = 'IdentificationKey'")
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE })
@JsonIgnore
public List<Comment> getComments() {
	return comments;
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:13,代碼來源:IdentificationKey.java

示例14: getAnnotations

import org.hibernate.annotations.CascadeType; //導入依賴的package包/類
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@JoinColumn(name = "annotatedObjId")
@Where(clause = "annotatedObjType = 'Place'")
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE })
@JsonIgnore
public Set<Annotation> getAnnotations() {
	return annotations;
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:9,代碼來源:Place.java

示例15: getTaxa

import org.hibernate.annotations.CascadeType; //導入依賴的package包/類
/**
 * The list of all taxa associated with this reference.
 *
 * @return a set of taxa
 */
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "Taxon_Reference", joinColumns = {@JoinColumn(name = "references_id")}, inverseJoinColumns = {@JoinColumn(name = "Taxon_id")})
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE })
@JsonSerialize(contentUsing = TaxonSerializer.class)
public Set<Taxon> getTaxa() {
	return taxa;
}
 
開發者ID:RBGKew,項目名稱:eMonocot,代碼行數:13,代碼來源:Reference.java


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