Example usage for org.hibernate.annotations CascadeType REMOVE

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

Introduction

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

Prototype

CascadeType REMOVE

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

Click Source Link

Document

Corresponds to javax.persistence.CascadeType#REMOVE .

Usage

From source file:gov.nih.nci.cabig.caaers.domain.ExpeditedAdverseEventReport.java

License:BSD License

/**
 * Gets the reporter./* w ww .  j a  va  2  s.  com*/
 *
 * @return the reporter
 */
@OneToOne(mappedBy = "expeditedReport", fetch = FetchType.LAZY)
@Cascade(value = { CascadeType.DELETE, CascadeType.DETACH, CascadeType.LOCK, CascadeType.REMOVE })
public Reporter getReporter() {
    return reporter;
}

From source file:gov.nih.nci.cabig.caaers.domain.ExpeditedAdverseEventReport.java

License:BSD License

/**
 * Gets the physician.//from w  w w  .  ja v  a2s. c  o m
 *
 * @return the physician
 */
@OneToOne(mappedBy = "expeditedReport", fetch = FetchType.LAZY)
@Cascade(value = { CascadeType.DELETE, CascadeType.DETACH, CascadeType.LOCK, CascadeType.REMOVE,
        CascadeType.MERGE })
public Physician getPhysician() {
    return physician;
}

From source file:gov.nih.nci.cabig.caaers.domain.ExpeditedAdverseEventReport.java

License:BSD License

/**
 * Gets the reports.//from  w  w w .  j a v  a 2  s  . c o  m
 *
 * @return the reports
 */
@OneToMany(fetch = FetchType.LAZY, mappedBy = "aeReport")
@Cascade(value = { CascadeType.DELETE, CascadeType.DETACH, CascadeType.LOCK, CascadeType.REMOVE })
@Fetch(value = org.hibernate.annotations.FetchMode.SUBSELECT)
// Manually manage update-style reassociates and saves
public List<Report> getReports() {
    if (reports == null)
        reports = new ArrayList<Report>();
    return reports;
}

From source file:gov.nih.nci.cabig.caaers.domain.Participant.java

License:BSD License

/**
 * Gets the assignments./*  w w  w .j a  va2 s . c om*/
 *
 * @return the assignments
 */
@OneToMany(mappedBy = "participant", fetch = FetchType.LAZY, orphanRemoval = true)
@OrderBy
// order by ID for testing consistency
@Cascade(value = { CascadeType.DELETE, CascadeType.MERGE, CascadeType.SAVE_UPDATE, CascadeType.PERSIST,
        CascadeType.REFRESH, CascadeType.REMOVE })
@UniqueObjectInCollection(message = "Duplicate Assignement found in Assignments list")
@Fetch(value = org.hibernate.annotations.FetchMode.SUBSELECT)
public List<StudyParticipantAssignment> getAssignments() {
    return assignments;
}

From source file:gov.nih.nci.cabig.caaers.domain.Participant.java

License:BSD License

@Override
@OneToMany(orphanRemoval = true)/*w ww . j  av a 2  s .c  o m*/
@Cascade({ CascadeType.DELETE, CascadeType.MERGE, CascadeType.SAVE_UPDATE, CascadeType.PERSIST,
        CascadeType.REFRESH, CascadeType.REMOVE })
@JoinColumn(name = "participant_id")
@UniqueObjectInCollection(message = "Duplicate Identifier found in Identifiers list")
@Fetch(value = org.hibernate.annotations.FetchMode.SUBSELECT)
public List<Identifier> getIdentifiers() {
    return lazyListHelper.getInternalList(Identifier.class);
}

From source file:gov.nih.nci.cabig.caaers.domain.report.ReportVersion.java

License:BSD License

/**
 * Gets the reported advers events./*from   w  w  w  .j av  a2  s. com*/
 *
 * @return the reported advers events
 */
@OneToMany(mappedBy = "reportVersion", orphanRemoval = true)
@Cascade(value = { CascadeType.SAVE_UPDATE, CascadeType.REMOVE, CascadeType.DETACH })
@Fetch(value = org.hibernate.annotations.FetchMode.SUBSELECT)
public List<ReportedAdverseEvent> getReportedAdversEvents() {
    return reportedAdversEvents;
}