Package javax.persistence

Examples of javax.persistence.CascadeType


        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(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

        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;
                } else {
                  // Internal class means getName will introduce an unwanted "$" sign
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;
                } else {
                  if(logger.isLoggable(Level.FINE)) {
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.MERGE; break;
    case REMOVED: cascadeType = CascadeType.REMOVE; break;
    case NEW: throw new IllegalArgumentException();
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

    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

    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

      Property p = entry.getKey();
      // 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(entry.getValue().contains(cascade)) {
          used = cascade;
        }
        if(Collection.class.isAssignableFrom(rawPropertyType)) {
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.