Example usage for javax.persistence CascadeType PERSIST

List of usage examples for javax.persistence CascadeType PERSIST

Introduction

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

Prototype

CascadeType PERSIST

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

Click Source Link

Document

Cascade persist operation

Usage

From source file:gov.nih.nci.protexpress.domain.experiment.ExperimentRun.java

/**
 * Gets the experiment./*from w  w w.  jav a2  s .c  o  m*/
 *
 * @return the experiment
 */
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
@JoinColumn(name = "experiment_id", nullable = false)
@Valid
public Experiment getExperiment() {
    return this.experiment;
}

From source file:org.caratarse.auth.model.po.User.java

@OneToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@MapKey(name = "name")
@Filters({ @Filter(name = "limitByNotDeleted") })
public Map<String, Attribute> getUserAttributes() {
    return userAttributes;
}

From source file:com.hmsinc.epicenter.model.surveillance.SurveillanceSet.java

/**
 * @return the classifications/*from w  w  w  . ja va  2  s. c o m*/
 */
@ManyToMany(cascade = { CascadeType.PERSIST,
        CascadeType.MERGE }, fetch = FetchType.LAZY, targetEntity = Classification.class)
@JoinTable(name = "SURVEILLANCE_SET_CLASSI", joinColumns = {
        @JoinColumn(name = "ID_SURVEILLANCE_SET") }, inverseJoinColumns = {
                @JoinColumn(name = "ID_CLASSIFICATION") })
@ForeignKey(name = "FK_SURVEILLANCE_SET_CLASSI_1", inverseName = "FK_SURVEILLANCE_SET_CLASSI_2")
public Set<Classification> getClassifications() {
    return classifications;
}

From source file:com.hmsinc.epicenter.model.permission.AuthorizedRegion.java

/**
 * @return the geography//from   w w w  . ja  v a  2s  .  c  o  m
 */
@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY)
@JoinColumn(name = "ID_GEOGRAPHY", unique = false, nullable = false, insertable = true, updatable = true)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@org.hibernate.annotations.ForeignKey(name = "FK_AUTHORIZED_REGION_2")
public Geography getGeography() {
    return geography;
}

From source file:com.hmsinc.epicenter.model.surveillance.SurveillanceTask.java

/**
 * @return the geography//from   w w w .j  av a2  s  . co  m
 */
@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY)
@JoinColumn(name = "ID_GEOGRAPHY", unique = false, nullable = false, insertable = true, updatable = true)
@ForeignKey(name = "FK_SURVEILLANCE_TASK_3")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public Geography getGeography() {
    return geography;
}

From source file:com.eryansky.entity.base.Organ.java

@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY)
@JoinTable(name = "T_BASE_USER_ORGAN", joinColumns = { @JoinColumn(name = "ORGAN_ID") }, inverseJoinColumns = {
        @JoinColumn(name = "USER_ID") })
@Fetch(FetchMode.SUBSELECT)//from w  w  w.  j  av  a 2  s.co m
@OrderBy("id")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = CacheConstants.HIBERNATE_CACHE_BASE)
public List<User> getUsers() {
    return users;
}

From source file:com.anite.zebra.hivemind.om.defs.ZebraProcessDefinition.java

@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, targetEntity = ZebraProcessVersions.class)
@JoinColumn(name = "versionId")
public IProcessVersions getProcessVersions() {
    return this.processVersions;
}

From source file:com.eryansky.entity.base.Resource.java

@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY)
@JoinTable(name = "T_BASE_USER_RESOURCE", joinColumns = {
        @JoinColumn(name = "RESOURCE_ID") }, inverseJoinColumns = { @JoinColumn(name = "USER_ID") })
public List<User> getUsers() {
    return users;
}

From source file:example.app.model.Contact.java

@OneToOne(fetch = FetchType.EAGER, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
public Person getPerson() {
    return person;
}

From source file:com.hmsinc.epicenter.model.permission.EpiCenterRole.java

/**
 * @return the users// w w w. j  a  v  a2 s .c o m
 */
@ManyToMany(cascade = { CascadeType.PERSIST,
        CascadeType.MERGE }, fetch = FetchType.LAZY, mappedBy = "roles", targetEntity = EpiCenterUser.class)
@ForeignKey(name = "FK_APP_USER_ROLE_1", inverseName = "FK_APP_USER_ROLE_2")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public Set<EpiCenterUser> getUsers() {
    return users;
}