Package javax.persistence

Examples of javax.persistence.CascadeType


    for(Property p : containedProperties.keySet()) {
      // Static properties are by design not written
      if(!p.hasModifier(Modifier.STATIC) && !Annotations.TRANSIENT.is(p)) {
        Class<?> rawPropertyType = p.getType();
        // Per default, no operation is cascaded
        CascadeType used = null;
        // However, if property supports that cascade type, we cascade operation
        if(containedProperties.get(p).contains(cascade)) {
          used = cascade;
        }
        if(Collection.class.isAssignableFrom(rawPropertyType)) {
View Full Code Here


   * @param <R> the type of the related entity we are cascading to
   */
  private <X, R> void cascadeStateChange(ErraiAttribute<X, R> cascadeAcross, X owningEntity, EntityState newState) {
    if (!cascadeAcross.isAssociation()) return;

    CascadeType cascadeType;
    switch (newState) {
    case DETACHED: cascadeType = CascadeType.DETACH; break;
    case MANAGED: cascadeType = CascadeType.PERSIST; break; // XXX could be a MERGE once that's implemented
    case REMOVED: cascadeType = CascadeType.REMOVE; break;
    case NEW: throw new IllegalArgumentException();
View Full Code Here

        if (targetEntity.getName().equals("void"))
          throw new MissingTargetEntityException(beanName, relationship.getName());
           

        CascadeType cascades[] = annotation.cascade();
       
        for(CascadeType cascade:cascades)
        {
          // Rimossa perche' ci sono casi in cui e' necessario avere il MERGE !!!
//            if (cascade.equals(CascadeType.MERGE) || cascade.equals(CascadeType.ALL))
View Full Code Here

        for (Map.Entry<Property, Collection<CascadeType>> entry : containedProperties.entrySet()) {
          Property p = entry.getKey();
            // Static properties are by design not written
            if (!p.hasModifier(Modifier.STATIC) && !Annotations.TRANSIENT.is(p)) {
                // Per default, no operation is cascaded
                CascadeType used = null;
                // However, if property supports that cascade type, we cascade operation
                if (entry.getValue().contains(cascade)) {
                    used = cascade;
                }
                if(used!=null) {
View Full Code Here

        for (Map.Entry<Property, Collection<CascadeType>> entry : containedProperties.entrySet()) {
            Property p = entry.getKey();
            // Static properties are by design not written
            if (!p.hasModifier(Modifier.STATIC) && !Annotations.TRANSIENT.is(p)) {
                // Per default, no operation is cascaded
                CascadeType used = null;
                // However, if property supports that cascade type, we cascade operation
                if (entry.getValue().contains(cascade)) {
                    used = cascade;
                }
                // We only perform operations on cascaded fields
View Full Code Here

        for (Map.Entry<Property, Collection<CascadeType>> entry : containedProperties.entrySet()) {
          Property p = entry.getKey();
            // Static properties are by design not written
            if (!p.hasModifier(Modifier.STATIC) && !Annotations.TRANSIENT.is(p)) {
                // Per default, no operation is cascaded
                CascadeType used = null;
                // However, if property supports that cascade type, we cascade operation
                if (entry.getValue().contains(cascade)) {
                    used = cascade;
                }
                if(used!=null) {
View Full Code Here

        for (Map.Entry<Property, Collection<CascadeType>> entry : containedProperties.entrySet()) {
          Property p = entry.getKey();
            // Static properties are by design not written
            if (!p.hasModifier(Modifier.STATIC) && !Annotations.TRANSIENT.is(p)) {
                // Per default, no operation is cascaded
                CascadeType used = null;
                // However, if property supports that cascade type, we cascade operation
                if (entry.getValue().contains(cascade)) {
                    used = cascade;
                }
                Class<?> rawPropertyType = p.getType();
View Full Code Here

        for (Map.Entry<Property, Collection<CascadeType>> entry : containedProperties.entrySet()) {
            Property p = entry.getKey();
            // Static properties are by design not written
            if (!p.hasModifier(Modifier.STATIC) && !Annotations.TRANSIENT.is(p)) {
                // Per default, no operation is cascaded
                CascadeType used = null;
                // However, if property supports that cascade type, we cascade operation
                if (entry.getValue().contains(cascade)) {
                    used = cascade;
                }
                Class<?> rawPropertyType = p.getType();
View Full Code Here

        for (Map.Entry<Property, Collection<CascadeType>> entry : containedProperties.entrySet()) {
          Property p = entry.getKey();
            // Static properties are by design not written
            if (!p.hasModifier(Modifier.STATIC) && !Annotations.TRANSIENT.is(p)) {
                // Per default, no operation is cascaded
                CascadeType used = null;
                // However, if property supports that cascade type, we cascade operation
                if (entry.getValue().contains(cascade)) {
                    used = cascade;
                }
                if(used!=null) {
View Full Code Here

        for (Map.Entry<Property, Collection<CascadeType>> entry : containedProperties.entrySet()) {
            Property p = entry.getKey();
            // Static properties are by design not written
            if (!p.hasModifier(Modifier.STATIC) && !Annotations.TRANSIENT.is(p)) {
                // Per default, no operation is cascaded
                CascadeType used = null;
                // However, if property supports that cascade type, we cascade operation
                if (entry.getValue().contains(cascade)) {
                    used = cascade;
                }
                // We only perform operations on cascaded fields
View Full Code Here

TOP

Related Classes of javax.persistence.CascadeType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.