Package javax.persistence

Examples of javax.persistence.ManyToOne.cascade()


        for (Ejb3JoinColumn joinColumn : joinColumns) {
          joinColumn.setSecondaryTableName( join.getTable().getName() );
        }
      }
      bindManyToOne(
          getCascadeStrategy( ann.cascade(), hibernateCascade ),
          joinColumns,
          ann.optional(),
          ignoreNotFound, onDeleteCascade,
          mappings.getReflectionManager().toXClass( ann.targetEntity() ),
          propertyHolder,
View Full Code Here


        for (Ejb3JoinColumn joinColumn : joinColumns) {
          joinColumn.setSecondaryTableName( join.getTable().getName() );
        }
      }
      bindOneToOne(
          getCascadeStrategy( ann.cascade(), hibernateCascade ),
          joinColumns,
          ann.optional(),
          getFetchMode( ann.fetch() ),
          ignoreNotFound, onDeleteCascade,
          mappings.getReflectionManager().toXClass( ann.targetEntity() ),
View Full Code Here

      if (propertyDescriptor.isAnnotationPresent(OneToOne.class)) {
        OneToOne oneToOne = propertyDescriptor.getAnnotation(OneToOne.class);
        cascades = oneToOne.cascade();
      } else {
        ManyToOne manyToOne = propertyDescriptor.getAnnotation(ManyToOne.class);
        cascades = manyToOne.cascade();
      }
      if ((cascades != null) && (cascades.length > 0)) {
        for (CascadeType cascade : cascades) {
          if ((cascade == CascadeType.ALL) || (cascade == CascadeType.MERGE)) {
            isCascade = true;
View Full Code Here

            collection.add("Missing @JoinTable on " + beanDescriptor.getType().getCanonicalName() + "." + propertyDescriptor.getName());
          }
        }
        if (propertyDescriptor.isAnnotationPresent(ManyToOne.class)) {
          ManyToOne manyToOne = propertyDescriptor.getAnnotation(ManyToOne.class);
          CascadeType[] cascades = manyToOne.cascade();
          FetchType fetchType = manyToOne.fetch();

          this.checkCascade(collection, manyToOne, beanDescriptor, propertyDescriptor, cascades);
          this.checkFetch(collection, manyToOne, beanDescriptor, propertyDescriptor, fetchType);
View Full Code Here

            joinColumn.setSecondaryTableName( join.getTable().getName() );
          }
        }
        final boolean mandatory = !ann.optional() || forcePersist;
        bindManyToOne(
            getCascadeStrategy( ann.cascade(), hibernateCascade, false, forcePersist ),
            joinColumns,
            !mandatory,
            ignoreNotFound, onDeleteCascade,
            ToOneBinder.getTargetEntity( inferredData, mappings ),
            propertyHolder,
View Full Code Here

        }
        //MapsId means the columns belong to the pk => not null
        //@OneToOne with @PKJC can still be optional
        final boolean mandatory = !ann.optional() || forcePersist;
        bindOneToOne(
            getCascadeStrategy( ann.cascade(), hibernateCascade, ann.orphanRemoval(), forcePersist ),
            joinColumns,
            !mandatory,
            getFetchMode( ann.fetch() ),
            ignoreNotFound, onDeleteCascade,
            ToOneBinder.getTargetEntity( inferredData, mappings ),
View Full Code Here

            joinColumn.setSecondaryTableName( join.getTable().getName() );
          }
        }
        final boolean mandatory = !ann.optional() || isMapsId;
        bindManyToOne(
            getCascadeStrategy( ann.cascade(), hibernateCascade, false, isMapsId),
            joinColumns,
            !mandatory,
            ignoreNotFound, onDeleteCascade,
            ToOneBinder.getTargetEntity( inferredData, mappings ),
            propertyHolder,
View Full Code Here

          }
        }
        //MapsId means the columns belong to the pk => not null
        final boolean mandatory = !ann.optional() || isMapsId;
        bindOneToOne(
            getCascadeStrategy( ann.cascade(), hibernateCascade, ann.orphanRemoval(), isMapsId),
            joinColumns,
            !mandatory,
            getFetchMode( ann.fetch() ),
            ignoreNotFound, onDeleteCascade,
            ToOneBinder.getTargetEntity( inferredData, mappings ),
View Full Code Here

            joinColumn.setSecondaryTableName( join.getTable().getName() );
          }
        }
        final boolean mandatory = !ann.optional() || forcePersist;
        bindManyToOne(
            getCascadeStrategy( ann.cascade(), hibernateCascade, false, forcePersist ),
            joinColumns,
            !mandatory,
            ignoreNotFound, onDeleteCascade,
            ToOneBinder.getTargetEntity( inferredData, mappings ),
            propertyHolder,
View Full Code Here

        }
        //MapsId means the columns belong to the pk => not null
        //@PKJC must be constrained
        final boolean mandatory = !ann.optional() || forcePersist || trueOneToOne;
        bindOneToOne(
            getCascadeStrategy( ann.cascade(), hibernateCascade, ann.orphanRemoval(), forcePersist ),
            joinColumns,
            !mandatory,
            getFetchMode( ann.fetch() ),
            ignoreNotFound, onDeleteCascade,
            ToOneBinder.getTargetEntity( inferredData, mappings ),
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.