Example usage for org.hibernate.annotations CascadeType DELETE

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

Introduction

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

Prototype

CascadeType DELETE

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

Click Source Link

Document

Corresponds to the Hibernate native DELETE action.

Usage

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

License:Open Source License

/**
 * @return the comments//from  www  . ja v  a  2  s  . co 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

@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@JoinColumn(name = "annotatedObjId")
@Where(clause = "annotatedObjType = 'TypeAndSpecimen'")
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE })
@JsonIgnore//from   ww  w  .  j a v  a2s. c o  m
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//from ww w .  j  a v  a  2 s .  co  m
public Set<Annotation> getAnnotations() {
    return annotations;
}