Example usage for javax.persistence CascadeType MERGE

List of usage examples for javax.persistence CascadeType MERGE

Introduction

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

Prototype

CascadeType MERGE

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

Click Source Link

Document

Cascade merge operation

Usage

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

/**
 * @return the geography/*from   w ww  .j a  v 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)
@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.SurveillanceSet.java

/**
 * @return the classifications//from   w  w  w . j  av a 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.surveillance.SurveillanceTask.java

/**
 * @return the geography//w  w  w  .ja  va 2 s  .c o 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  ava 2 s . c o 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  ava 2s .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;
}

From source file:edu.harvard.med.screensaver.model.AttachedFile.java

@ManyToOne(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinColumn(name = "screenId", nullable = true, updatable = false)
@org.hibernate.annotations.ForeignKey(name = "fk_attached_file_to_screen")
@org.hibernate.annotations.LazyToOne(value = org.hibernate.annotations.LazyToOneOption.PROXY)
@ToOne(hasNonconventionalSetterMethod = true /* mutually-exclusive parenting relationships */)
public Screen getScreen() {
    return _screen;
}

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

@ManyToOne(fetch = FetchType.EAGER, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinColumn(name = "address_id")
public Address getAddress() {
    return address;
}