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:gov.nih.nci.caarray.domain.data.Image.java

License:BSD License

/**
 * Gets the protocolApplications./*from www . j av  a 2  s .  c o  m*/
 *
 * @return the protocolApplications
 */
@OneToMany(fetch = FetchType.LAZY)
@JoinColumn(name = "image")
@ForeignKey(name = "protocolapp_image_fk")
@Cascade({ org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.DELETE,
        org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
public Set<ProtocolApplication> getProtocolApplications() {
    return protocolApplications;
}

From source file:gov.nih.nci.caarray.domain.data.RawArrayData.java

License:BSD License

/**
 * @return source images/*  w  ww.jav  a2  s  .  co  m*/
 */
@OneToMany(mappedBy = "rawArrayData")
@Cascade(CascadeType.DELETE)
public Set<Image> getSourceImages() {
    return sourceImages;
}

From source file:gov.nih.nci.caarray.domain.hybridization.Hybridization.java

License:BSD License

/**
 * Gets the images./*from w  w  w  .jav a  2s.c o  m*/
 *
 * @return the images
 */
@OneToMany(mappedBy = MAPPED_BY, fetch = FetchType.LAZY)
@Cascade(CascadeType.DELETE)
public Set<Image> getImages() {
    return this.images;
}

From source file:gov.nih.nci.caarray.domain.hybridization.Hybridization.java

License:BSD License

/**
 * Gets the derivedDatas./*www  .j  av a 2 s .c o  m*/
 *
 * @return the derivedDatas
 */
@ManyToMany(mappedBy = "hybridizations", targetEntity = AbstractArrayData.class, fetch = FetchType.LAZY)
@Where(clause = "discriminator = '" + DerivedArrayData.DISCRIMINATOR + "'")
@Cascade({ CascadeType.DELETE, CascadeType.SAVE_UPDATE })
public Set<DerivedArrayData> getDerivedDataCollection() {
    return this.derivedDataCollection;
}

From source file:gov.nih.nci.caarray.domain.hybridization.Hybridization.java

License:BSD License

/**
 * Gets the array./*from ww  w  . jav a 2  s  .  c  o m*/
 *
 * @return the array
 */
@ManyToOne(fetch = FetchType.LAZY)
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.DELETE })
@ForeignKey(name = "hybridization_array_fk")
public Array getArray() {
    return this.array;
}

From source file:gov.nih.nci.caarray.domain.hybridization.Hybridization.java

License:BSD License

/**
 * Gets the rawArrayDatas./*from ww  w. j av  a  2  s.co  m*/
 * @return the rawArrayData
 */
@ManyToMany(mappedBy = "hybridizations", targetEntity = AbstractArrayData.class, fetch = FetchType.LAZY)
@Where(clause = "discriminator = '" + RawArrayData.DISCRIMINATOR + "'")
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.DELETE })
public Set<RawArrayData> getRawDataCollection() {
    return this.rawDataCollection;
}

From source file:gov.nih.nci.caarray.domain.hybridization.Hybridization.java

License:BSD License

/**
 * Gets the factorValues./*from   w  w w  .j  av a 2  s .  c  o m*/
 *
 * @return the factorValues
 */
@OneToMany(mappedBy = MAPPED_BY, fetch = FetchType.LAZY)
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.DELETE })
public Set<AbstractFactorValue> getFactorValues() {
    return this.factorValues;
}

From source file:gov.nih.nci.caarray.domain.hybridization.Hybridization.java

License:BSD License

/**
 * {@inheritDoc}/*ww  w  . j  a  v  a 2  s.c o m*/
 */
// should really be one-to-many, but hibernate bug HHH-3160/HHH-1296 prevents reordering or deleting from the list
// with a unique constraint on protocol_application
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "hybridization_protocol_application", joinColumns = @JoinColumn(name = "hybridization"), inverseJoinColumns = @JoinColumn(name = "protocol_application"))
@IndexColumn(name = "protocol_order")
@ForeignKey(name = "hybridization_protocol_application_hybridization_fk", inverseName = "hybridization_protocol_application_protocol_application_fk")
@Cascade({ org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.DELETE,
        org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
public List<ProtocolApplication> getProtocolApplications() {
    return this.protocolApplications;
}

From source file:gov.nih.nci.caarray.domain.project.Factor.java

License:BSD License

/**
 * Gets the factorValues./*from  w w w . j av a  2s. c  o  m*/
 *
 * @return the factorValues
 */
@OneToMany(mappedBy = "factor", fetch = FetchType.LAZY)
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.DELETE })
public Set<AbstractFactorValue> getFactorValues() {
    return this.factorValues;
}

From source file:gov.nih.nci.caarray.domain.protocol.ProtocolApplication.java

License:BSD License

/**
 * Gets the values./*from w  w  w.  ja v  a 2 s  . c  o m*/
 *
 * @return the values
 */
@OneToMany(mappedBy = "protocolApplication", fetch = FetchType.LAZY)
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.DELETE })
public Set<AbstractParameterValue> getValues() {
    return values;
}