Example usage for org.hibernate.annotations CascadeType ALL

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

Introduction

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

Prototype

CascadeType ALL

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

Click Source Link

Document

Includes all types listed here.

Usage

From source file:edu.duke.cabig.c3pr.domain.Participant.java

License:BSD License

/**
 * Gets the race codes./*  ww  w  .  j  ava 2  s  .co  m*/
 * 
 * @return the race codes
 */
@OneToMany(orphanRemoval = true)
@Cascade(value = { CascadeType.ALL })
@JoinColumn(name = "sub_id")
@OrderBy("id")
public Set<RaceCodeAssociation> getRaceCodeAssociations() {
    if (raceCodeAssociations == null) {
        raceCodeAssociations = new LinkedHashSet<RaceCodeAssociation>();
    }
    return raceCodeAssociations;
}

From source file:edu.duke.cabig.c3pr.domain.Participant.java

License:BSD License

/**
 * Gets the custom fields internal./*from  w w w.j ava 2s.com*/
 * 
 * @return the custom fields internal
 */
@OneToMany(mappedBy = "participant", fetch = FetchType.LAZY, orphanRemoval = true)
@Cascade(value = { CascadeType.ALL })
public List<CustomField> getCustomFieldsInternal() {
    return lazyListHelper.getInternalList(CustomField.class);
}

From source file:edu.duke.cabig.c3pr.domain.Participant.java

License:BSD License

@OneToMany(fetch = FetchType.EAGER, orphanRemoval = true)
@Cascade(value = { CascadeType.ALL })
@JoinColumn(name = "participant_id")
@Where(clause = "retired_indicator  = 'false'")
@OrderBy("startDate desc")
public Set<Address> getAddresses() {
    if (this.address != null && !this.address.isBlank() && !addresses.contains(this.address)) {
        addresses.add(this.address);
    }//w  ww.  j a va  2s.  c  o  m
    return addresses;
}

From source file:edu.duke.cabig.c3pr.domain.PermissibleStudySubjectRegistryStatus.java

License:BSD License

@OneToMany(orphanRemoval = true)
@Cascade({ CascadeType.ALL })
@JoinColumn(name = "per_reg_st_id")
public List<RegistryStatusReason> getSecondaryReasons() {
    return secondaryReasons;
}

From source file:edu.duke.cabig.c3pr.domain.Person.java

License:BSD License

@OneToOne
@Cascade(value = { CascadeType.ALL })
@JoinColumn(name = "ADD_ID", nullable = true)
public Address getAddressInternal() {

    if (this.getAddress().isBlank())
        return null;
    return this.address;

}

From source file:edu.duke.cabig.c3pr.domain.PersonUser.java

License:BSD License

/**
 * Gets the study personnels.//w w w  .  ja v a2 s. com
 * 
 * @return the study personnels
 */
@OneToMany(mappedBy = "personUser", orphanRemoval = true)
@Cascade(value = { CascadeType.ALL })
public List<StudyPersonnel> getStudyPersonnels() {
    return studyPersonnels;
}

From source file:edu.duke.cabig.c3pr.domain.PersonUser.java

License:BSD License

@OneToMany(orphanRemoval = true)
@Cascade(value = { CascadeType.ALL })
@JoinColumn(name = "RS_ID")
@OrderBy("id")/*ww w . j a va 2  s  .  c o  m*/
public Set<ContactMechanism> getContactMechanisms() {
    return contactMechanisms;
}

From source file:edu.duke.cabig.c3pr.domain.PersonUser.java

License:BSD License

/**
 * @return the healthcareSites/*from   w w  w .  j av a2s.  c  o  m*/
 */
@ManyToMany
@Cascade(value = { CascadeType.ALL })
@JoinTable(name = "rs_hc_site_assocn", joinColumns = @JoinColumn(name = "rs_id"), inverseJoinColumns = @JoinColumn(name = "hcs_id"))
public List<HealthcareSite> getHealthcareSites() {
    return healthcareSites;
}

From source file:edu.duke.cabig.c3pr.domain.PlannedNotification.java

License:BSD License

/**
 * Gets the user based recipient internal.
 * /*  w ww. jav a 2  s  . c om*/
 * @return the user based recipient internal
 */
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@Cascade(value = { CascadeType.ALL })
@JoinColumn(name = "planned_notfns_id", nullable = false)
@Where(clause = "DTYPE = 'ER' and retired_indicator  = 'false'")
public List<UserBasedRecipient> getUserBasedRecipientInternal() {
    return lazyListHelper.getInternalList(UserBasedRecipient.class);
}

From source file:edu.duke.cabig.c3pr.domain.PlannedNotification.java

License:BSD License

/**
 * Gets the role based recipient internal.
 * /* www .  ja v  a2 s.c  o  m*/
 * @return the role based recipient internal
 */
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@Cascade(value = { CascadeType.ALL })
@JoinColumn(name = "planned_notfns_id", nullable = false)
@Where(clause = "DTYPE = 'RR' and retired_indicator  = 'false'")
public List<RoleBasedRecipient> getRoleBasedRecipientInternal() {
    return lazyListHelper.getInternalList(RoleBasedRecipient.class);
}