Example usage for javax.persistence CascadeType ALL

List of usage examples for javax.persistence CascadeType ALL

Introduction

In this page you can find the example usage for javax.persistence CascadeType ALL.

Prototype

CascadeType ALL

To view the source code for javax.persistence CascadeType ALL.

Click Source Link

Document

Cascade all operations

Usage

From source file:ca.mcgill.cs.swevo.qualyzer.model.Project.java

/**
 * @return the investigators/*  ww  w  .  j  a v  a  2 s  . c  o m*/
 */
@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER)
@JoinColumn(name = "project_persistenceid", nullable = false)
@OrderColumn(name = "index")
public List<Investigator> getInvestigators() {
    return fInvestigators;
}

From source file:net.groupbuy.entity.ParameterGroup.java

/**
 * ??// w  w  w  .jav a  2 s. c  om
 * 
 * @return ?
 */
@JsonProperty
@Valid
@NotEmpty
@OneToMany(mappedBy = "parameterGroup", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
@OrderBy("order asc")
public List<Parameter> getParameters() {
    return parameters;
}

From source file:io.github.gammaliu.demo.domain.Person.java

@OneToOne(cascade = CascadeType.ALL)
public Address getAddress() {
    return address;
}

From source file:org.openehr.rm.datatypes.quantity.DvInterval.java

/**
 * Returns lower boundary//w w w .  j  a  va2s  .  c o m
 *
 * @return null if not specified
 */
@ManyToOne(targetEntity = DvOrdered.class, cascade = CascadeType.ALL)
public T getLower() {
    //        return interval.getLower();
    return lower;
}

From source file:org.bonitasoft.engine.bdm.RelationFieldAnnotator.java

public void annotateRelationField(final JDefinedClass entityClass, final RelationField field,
        final JFieldVar fieldVar) {
    JAnnotationUse relation = null;/*from   ww w. ja va2 s.  com*/
    if (field.isCollection()) {
        relation = annotateMultipleReference(entityClass, field, fieldVar);
    } else {
        relation = annotateSingleReference(field, fieldVar);
    }

    if (field.isLazy()) {
        relation.param("fetch", FetchType.LAZY);
        codeGenerator.addAnnotation(fieldVar, JsonIgnore.class);
    } else {
        relation.param("fetch", FetchType.EAGER);
    }

    if (field.getType() == Type.COMPOSITION) {
        relation.param("cascade", CascadeType.ALL);
    } else if (field.getType() == Type.AGGREGATION) {
        relation.param("cascade", CascadeType.MERGE);
    }
}

From source file:ua.its.slot7.caccounting.model.person.Person.java

/**
 * Invoices</br>/*  ww  w. j  a v  a  2  s.  c o  m*/
 * The {@link java.util.List} of {@link ua.its.slot7.caccounting.model.invoice.Invoice}
 */
@OneToMany(fetch = FetchType.LAZY, mappedBy = "person", cascade = { CascadeType.ALL })
public List<Invoice> getInvoices() {
    return invoices;
}

From source file:no.abmu.questionnaire.domain.data.SubSchemaData.java

@ManyToOne(targetEntity = SubSchema.class, cascade = CascadeType.ALL)
@JoinColumn(name = "FK_SUBSCHEMA_ID")
public SubSchema getSubSchema() {
    return subSchema;
}

From source file:ua.its.slot7.caccounting.model.user.User.java

/**
 * User userrole
 *
 * @return User's userrole
 */
@OneToOne(cascade = CascadeType.ALL)
public UserRole getUserRole() {
    return userRole;
}

From source file:org.dspace.orm.entity.Bundle.java

@ManyToMany(fetch = FetchType.LAZY, cascade = { CascadeType.ALL })
@JoinTable(name = "bundle2bitstream", joinColumns = { @JoinColumn(name = "bundle_id") }, inverseJoinColumns = {
        @JoinColumn(name = "bitstream_id") })
public List<Bitstream> getBitstreams() {
    return bitstreams;
}

From source file:com.amediamanager.domain.Video.java

@Column
@ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinTable(name = "videos_tags", joinColumns = {
        @JoinColumn(name = "videoId", nullable = false) }, inverseJoinColumns = {
                @JoinColumn(name = "tagId", nullable = false) })
public Set<Tag> getTags() {
    return tags;// w  w w.j  av a2  s.  c  o  m
}