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:org.eclipse.jubula.client.core.model.ProjectPropertiesPO.java

/**
 * only for Persistence (JPA / EclipseLink)
 * /*w w  w  .  j a  v  a  2s  .co m*/
 * @return Returns the usedProjects set.
 */
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, targetEntity = ReusedProjectPO.class, fetch = FetchType.EAGER)
@JoinColumn(name = "FK_PROJ_PROPERTIES")
private Set<IReusedProjectPO> getHbmUsedProjects() {
    return m_usedProjects;
}

From source file:org.eclipse.jubula.client.core.model.TestDataCubePO.java

/**
 * /* ww  w. j a va 2 s. c o  m*/
 * @return Returns the dataManager.
 */
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER, targetEntity = TDManagerPO.class)
@JoinColumn(name = "TD_MANAGER")
@BatchFetch(value = BatchFetchType.JOIN)
protected ITDManager getHbmDataManager() {
    return m_dataManager;
}

From source file:com.hmsinc.epicenter.model.workflow.Investigation.java

/**
 * @return the activities//from   w  ww  . j  a va 2 s . c om
 */
@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "investigation")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Sort(type = SortType.NATURAL)
public SortedSet<Activity> getActivities() {
    return activities;
}

From source file:org.apromore.dao.model.ProcessModelVersion.java

@OneToMany(mappedBy = "processModelVersion", cascade = CascadeType.ALL, orphanRemoval = true)
public Set<ProcessModelAttribute> getProcessModelAttributes() {
    return this.processModelAttributes;
}

From source file:com.openmeap.model.dto.GlobalSettings.java

@OneToMany(fetch = FetchType.EAGER, cascade = { CascadeType.ALL }, targetEntity = ClusterNode.class)
@Lob
public List<ClusterNode> getClusterNodes() {
    return clusterNodes;
}

From source file:uk.nhs.cfh.dsp.snomed.objectmodel.impl.SnomedConceptImpl.java

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = SnomedRelationshipImpl.class)
@Column(nullable = true)/*from  w  w w  . ja va 2s.c om*/
@JoinTable(name = "CONCEPT_TARGET_RELATIONSHIPS", joinColumns = @JoinColumn(name = "concept_id"), inverseJoinColumns = @JoinColumn(name = "target_relationships_id"))
public Collection<SnomedRelationship> getTargetRelationships() {
    return targetRelationships;
}

From source file:uk.nhs.cfh.dsp.snomed.expression.model.impl.AbstractExpressionWithFocusConcepts.java

/**
 * Gets the property expressions./*from  w  w  w. jav a2 s.com*/
 *
 * @return the property expressions
 */
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = SnomedRoleGroupImpl.class)
@JoinTable(name = "EFC_PROPERTY_EXPRESSIONS", joinColumns = @JoinColumn(name = "uuid"), inverseJoinColumns = @JoinColumn(name = "prop_exp_uuid"))
public Collection<PropertyExpression> getPropertyExpressions() {
    return propertyExpressions;
}

From source file:net.shopxx.entity.ProductCategory.java

@OneToMany(cascade = CascadeType.ALL, mappedBy = "productCategory", fetch = FetchType.LAZY)
public Set<ProductMerchantCategory> getProductMerchantCategorys() {
    return productMerchantCategorys;
}

From source file:org.dcm4chee.xds2.persistence.RegistryObject.java

/**
 * Indexed properties that are used in queries. 
 * Do not use the setter - the update is fully seamless - when object is merged/persisted - indexes are re/-created and updated if needed  
 * @return//from   www  .  j  a  v a2s .co  m
 */
@OneToMany(mappedBy = "subject", cascade = CascadeType.ALL, orphanRemoval = true)
@Access(AccessType.PROPERTY)
@SuppressWarnings("unchecked")
public Set<RegistryObjectIndex> getIndexedValues() {
    log.debug("getIndexedValues called for object with id {}", getId());

    // TODO: OPTIMIZATION - if marshalling is fast - can check whether the object has already changed first

    // if fullObject was not initialized - nothing has changed and we could just return old value 
    // (except if reindexing is forced)
    if (fullObject == null && !FORCE_REINDEX)
        return currIndexedValues;

    if (getIndexes() == null)
        return currIndexedValues;

    // validate/update searchIndex table
    // iterate over all enabled indexes
    Set<RegistryObjectIndex> newIndexValues = new HashSet<RegistryObjectIndex>();
    for (XDSSearchIndexKey key : getIndexes()) {
        // run xpath expr on fullobject
        JXPathContext context = JXPathContext.newContext(getFullObject());
        Iterator<String> valueIterator = (Iterator<String>) context.iterate(INDEX_XPATHS.get(key));

        // add to newIndexValues
        while (valueIterator.hasNext()) {
            RegistryObjectIndex ind = new RegistryObjectIndex();
            ind.setSubject(this);
            ind.setKey(key);
            ind.setValue((String) valueIterator.next());
            newIndexValues.add(ind);
        }
    }

    // Retain what we have there already, and add new ones.
    // Note thats retain makes use of a custom equals for RegistryObjectIndex that does not consider the pk.
    currIndexedValues.retainAll(newIndexValues);
    currIndexedValues.addAll(newIndexValues);

    return currIndexedValues;
}

From source file:com.infinities.keystone4j.model.assignment.Project.java

@JsonView(Views.All.class)
@OneToMany(fetch = FetchType.LAZY, mappedBy = "parent", cascade = CascadeType.ALL)
public Set<Project> getProjects() {
    return projects;
}