Example usage for org.hibernate.annotations CascadeType MERGE

List of usage examples for org.hibernate.annotations CascadeType MERGE

Introduction

In this page you can find the example usage for org.hibernate.annotations CascadeType MERGE.

Prototype

CascadeType MERGE

To view the source code for org.hibernate.annotations CascadeType MERGE.

Click Source Link

Document

Corresponds to javax.persistence.CascadeType#MERGE .

Usage

From source file:org.emonocot.model.PhylogeneticTree.java

License:Open Source License

@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@JoinColumn(name = "commentPage_id")
@OrderBy("created DESC")
@Where(clause = "commentPage_type = 'PhylogeneticTree'")
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE })
@JsonIgnore/* w  w  w .  java2  s.c o  m*/
public List<Comment> getComments() {
    return comments;
}

From source file:org.emonocot.model.Place.java

License:Open Source License

@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@JoinColumn(name = "annotatedObjId")
@Where(clause = "annotatedObjType = 'Place'")
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE })
@JsonIgnore//from  w w  w .  j  a  v  a2s.c  o m
public Set<Annotation> getAnnotations() {
    return annotations;
}

From source file:org.emonocot.model.Reference.java

License:Open Source License

/**
 * The list of all taxa associated with this reference.
 *
 * @return a set of taxa//from  ww w .j  av  a  2s .com
 */
@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;
}

From source file:org.emonocot.model.Reference.java

License:Open Source License

/**
 * @return the annotations//from  w w  w  .  ja va2 s  . c o  m
 */
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@JoinColumn(name = "annotatedObjId")
@Where(clause = "annotatedObjType = 'Reference'")
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE })
@JsonIgnore
public Set<Annotation> getAnnotations() {
    return annotations;
}

From source file:org.emonocot.model.registry.Organisation.java

License:Open Source License

@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@JoinColumn(name = "annotatedObjId")
@Where(clause = "annotatedObjType = 'Organisation'")
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE })
@JsonIgnore//  w w  w.  j av  a2 s . c  o m
public Set<Annotation> getAnnotations() {
    return annotations;
}

From source file:org.emonocot.model.Taxon.java

License:Open Source License

/**
 * @return the annotations/*from   w w  w  . ja va  2  s  . com*/
 */
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@JoinColumn(name = "annotatedObjId")
@Where(clause = "annotatedObjType = 'Taxon'")
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE })
@JsonIgnore
public Set<Annotation> getAnnotations() {
    return annotations;
}

From source file:org.emonocot.model.Taxon.java

License:Open Source License

/**
 * @return the comments// w  w  w.  j  a v a2  s . c  o m
 */
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@JoinColumn(name = "commentPage_id")
@OrderBy("created DESC")
@Where(clause = "commentPage_type = 'Taxon'")
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE })
@JsonIgnore
public List<Comment> getComments() {
    return comments;
}

From source file:org.emonocot.model.TypeAndSpecimen.java

License:Open Source License

@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;/*from   ww w . ja v a  2  s.  c  om*/
}

From source file:org.emonocot.model.TypeAndSpecimen.java

License:Open Source License

@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@JoinColumn(name = "annotatedObjId")
@Where(clause = "annotatedObjType = 'TypeAndSpecimen'")
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE })
@JsonIgnore//  w  w w  .  j a  v  a  2 s. c  om
public Set<Annotation> getAnnotations() {
    return annotations;
}

From source file:org.emonocot.model.VernacularName.java

License:Open Source License

@Override
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@JoinColumn(name = "annotatedObjId")
@Where(clause = "annotatedObjType = 'VernacularName'")
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE })
@JsonIgnore//www .  ja va2  s . co  m
public Set<Annotation> getAnnotations() {
    return annotations;
}