本文整理匯總了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;
}
示例2: getEnvModifiers
import org.hibernate.annotations.CascadeType; //導入依賴的package包/類
@Cascade(CascadeType.ALL)
@OneToMany(mappedBy = "taskData")
@OnDelete(action = OnDeleteAction.CASCADE)
public List<EnvironmentModifierData> getEnvModifiers() {
return envModifiers;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}