Example usage for org.hibernate.annotations CascadeType DELETE_ORPHAN

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

Introduction

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

Prototype

CascadeType DELETE_ORPHAN

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

Click Source Link

Document

Hibernate originally handled orphan removal as a specialized cascade.

Usage

From source file:com.fiveamsolutions.nci.commons.data.security.AbstractUser.java

License:Open Source License

/**
 * @return the passwordResets// w  ww .  j  a va2 s . c o  m
 */
@OneToMany(mappedBy = "user")
@Cascade(value = { CascadeType.ALL, CascadeType.DELETE_ORPHAN })
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public Set<PasswordReset> getPasswordResets() {
    return passwordResets;
}

From source file:edu.ku.brc.specify.datamodel.Accession.java

License:Open Source License

@OneToMany(mappedBy = "accession")
@org.hibernate.annotations.Cascade({ org.hibernate.annotations.CascadeType.ALL,
        org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
@OrderBy("ordinal ASC")
public Set<AccessionAttachment> getAccessionAttachments() {
    return accessionAttachments;
}

From source file:edu.ku.brc.specify.datamodel.Accession.java

License:Open Source License

/**
 *
 *///  ww  w  .  java 2s.co m
@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "accession")
@Cascade({ CascadeType.ALL, CascadeType.DELETE_ORPHAN })
public Set<AccessionAuthorization> getAccessionAuthorizations() {
    return this.accessionAuthorizations;
}

From source file:edu.ku.brc.specify.datamodel.Accession.java

License:Open Source License

/**
 *
 */// w  w  w.j  a v a2 s . c o  m
@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "accession")
@Cascade({ CascadeType.ALL, CascadeType.DELETE_ORPHAN })
public Set<AccessionAgent> getAccessionAgents() {
    return this.accessionAgents;
}

From source file:edu.ku.brc.specify.datamodel.Accession.java

License:Open Source License

/**
 * @return the treatmentEvents//  w  w w.  j  a  va2  s . c o  m
 */
@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "accession")
@org.hibernate.annotations.Cascade({ org.hibernate.annotations.CascadeType.ALL,
        org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
public Set<TreatmentEvent> getTreatmentEvents() {
    return treatmentEvents;
}

From source file:edu.ku.brc.specify.datamodel.Accession.java

License:Open Source License

/**
 * @return the deaccessions//from   ww  w .  j  a  va 2 s. com
 */
@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "accession")
@org.hibernate.annotations.Cascade({ org.hibernate.annotations.CascadeType.ALL,
        org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
public Set<Deaccession> getDeaccessions() {
    return deaccessions;
}

From source file:edu.ku.brc.specify.datamodel.Accession.java

License:Open Source License

/**
 * @return the addressOfRecord/*  www  .j  a v  a  2  s .  c  om*/
 */
@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
@JoinColumn(name = "AddressOfRecordID", unique = false, nullable = true, insertable = true, updatable = true)
@Cascade({ CascadeType.ALL, CascadeType.DELETE_ORPHAN })
public AddressOfRecord getAddressOfRecord() {
    return addressOfRecord;
}

From source file:edu.ku.brc.specify.datamodel.AccessionAttachment.java

License:Open Source License

@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
@Cascade({ CascadeType.ALL, CascadeType.DELETE_ORPHAN })
@JoinColumn(name = "AttachmentID", nullable = false)
@OrderBy("ordinal ASC")
public Attachment getAttachment() {
    return attachment;
}

From source file:edu.ku.brc.specify.datamodel.Agent.java

License:Open Source License

/**
 *
 */// www . ja v  a2 s . c o  m
@OneToMany(mappedBy = "group")
@Cascade({ CascadeType.ALL, CascadeType.DELETE_ORPHAN })
public Set<GroupPerson> getGroups() {
    return this.groups;
}

From source file:edu.ku.brc.specify.datamodel.Agent.java

License:Open Source License

/**
 *
 *///from w  w w .j a v a 2  s  . co  m
@OneToMany(mappedBy = "member")
@Cascade({ CascadeType.ALL, CascadeType.DELETE_ORPHAN })
public Set<GroupPerson> getMembers() {
    return this.members;
}