List of usage examples for javax.persistence CascadeType MERGE
CascadeType MERGE
To view the source code for javax.persistence CascadeType MERGE.
Click Source Link
From source file:com.hmsinc.epicenter.model.workflow.Investigation.java
/** * @return the events/*from ww w . j ava 2 s .com*/ */ @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY, targetEntity = Event.class) @JoinTable(name = "INVESTIGATION_EVENT", joinColumns = { @JoinColumn(name = "ID_INVESTIGATION") }, inverseJoinColumns = { @JoinColumn(name = "ID_EVENT") }) @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) @Sort(type = SortType.NATURAL) public SortedSet<Event> getEvents() { return events; }
From source file:com.haulmont.cuba.core.global.MetadataTools.java
/** * Determine whether an object denoted by the given property is merged into persistence context together with the * owning object. This is true if the property is ManyToMany, or if it is OneToMany with certain CascadeType * defined./*from ww w.j a va2 s . c o m*/ */ public boolean isCascade(MetaProperty metaProperty) { Objects.requireNonNull(metaProperty, "metaProperty is null"); OneToMany oneToMany = metaProperty.getAnnotatedElement().getAnnotation(OneToMany.class); if (oneToMany != null) { final Collection<CascadeType> cascadeTypes = Arrays.asList(oneToMany.cascade()); if (cascadeTypes.contains(CascadeType.ALL) || cascadeTypes.contains(CascadeType.MERGE)) { return true; } } ManyToMany manyToMany = metaProperty.getAnnotatedElement().getAnnotation(ManyToMany.class); if (manyToMany != null && StringUtils.isBlank(manyToMany.mappedBy())) { return true; } return false; }
From source file:com.hmsinc.epicenter.model.permission.Organization.java
/** * @return the sponsoredOrganizations// w ww . j av a 2 s. c o m */ @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, mappedBy = "sponsors", targetEntity = Organization.class) @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public Set<Organization> getSponsoredOrganizations() { return sponsoredOrganizations; }
From source file:com.hmsinc.epicenter.model.provider.Facility.java
/** * @return the dataConnections//from w w w .ja v a 2 s. c o m */ @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, mappedBy = "facilities", targetEntity = DataConnection.class) @ForeignKey(name = "FK_DATA_CONN_FACILITY_1", inverseName = "FK_DATA_CONN_FACILITY_2") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public Set<DataConnection> getDataConnections() { return dataConnections; }
From source file:com.denimgroup.threadfix.data.entities.Application.java
@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }) @JoinColumn(name = "defectTrackerId") @JsonView({ AllViews.TableRow.class, AllViews.FormInfo.class, AllViews.RestViewTeams2_1.class, AllViews.RestViewWafs2_1.class }) public DefectTracker getDefectTracker() { return defectTracker; }
From source file:com.hmsinc.epicenter.model.permission.Organization.java
/** * @return the sponsors// www . j av a2 s.co m */ @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY, targetEntity = Organization.class) @JoinTable(name = "ORGANIZATION_SPONSOR", joinColumns = { @JoinColumn(name = "ID_ORGANIZATION") }, inverseJoinColumns = { @JoinColumn(name = "ID_SPONSOR_ORG") }) @ForeignKey(name = "FK_ORGANIZATION_SPONSOR_1", inverseName = "FK_ORGANIZATION_SPONSOR_2") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public Set<Organization> getSponsors() { return sponsors; }
From source file:com.hmsinc.epicenter.model.workflow.Investigation.java
/** * @return the localities// w w w.j a va 2 s .c o m */ @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY, targetEntity = Geography.class) @JoinTable(name = "INVESTIGATION_GEOGRAPHY", joinColumns = { @JoinColumn(name = "ID_INVESTIGATION") }, inverseJoinColumns = { @JoinColumn(name = "ID_GEOGRAPHY") }) @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) @org.hibernate.annotations.ForeignKey(name = "FK_INVESTIGATION_GEOGRAPHY_1", inverseName = "FK_INVESTIGATION_GEOGRAPHY_2") public Set<Geography> getLocalities() { return localities; }
From source file:com.hmsinc.epicenter.model.provider.Facility.java
/** * @return the types/*w ww.j a v a 2 s.c om*/ */ @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, mappedBy = "facilities", targetEntity = FacilityType.class) @ForeignKey(name = "FK_FACILITY_TYPE_FACILITY_1", inverseName = "FK_FACILITY_TYPE_FACILITY_2") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public Set<FacilityType> getTypes() { return types; }
From source file:gov.nih.nci.firebird.data.AbstractRegistrationForm.java
/** * @return the formType//from ww w. ja v a 2s. co m */ @ManyToOne(optional = false, cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.EAGER) @Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE) @ForeignKey(name = "form_form_type_fkey") @JoinColumn(name = "form_type_id") public FormType getFormType() { return formType; }
From source file:com.denimgroup.threadfix.data.entities.Application.java
@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }) @JoinColumn(name = "grcToolId") @JsonIgnore public GRCTool getGrcTool() { return grcTool; }