Package javax.persistence

Examples of javax.persistence.OneToMany.mappedBy()


    else if ( joinColumns == null &&
        ( property.isAnnotationPresent( OneToMany.class )
            || property.isAnnotationPresent( CollectionOfElements.class ) ) ) {
      OneToMany oneToMany = property.getAnnotation( OneToMany.class );
      String mappedBy = oneToMany != null ?
          oneToMany.mappedBy() :
          "";
      joinColumns = Ejb3JoinColumn.buildJoinColumns(
          (JoinColumn[]) null,
          mappedBy, entityBinder.getSecondaryTables(),
          propertyHolder, inferredData.getPropertyName(), mappings
View Full Code Here


          if ( column.isSecondary() ) {
            throw new NotYetImplementedException( "Collections having FK in secondary table" );
          }
        }
        collectionBinder.setFkJoinColumns( joinColumns );
        mappedBy = oneToManyAnn.mappedBy();
        collectionBinder.setTargetEntity(
            mappings.getReflectionManager().toXClass( oneToManyAnn.targetEntity() )
        );
        collectionBinder.setCascadeStrategy( getCascadeStrategy( oneToManyAnn.cascade(), hibernateCascade ) );
        collectionBinder.setOneToMany( true );
View Full Code Here

        }
        if (propertyDescriptor.isAnnotationPresent(OneToMany.class)) {
          OneToMany oneToMany = propertyDescriptor.getAnnotation(OneToMany.class);
          CascadeType[] cascades = oneToMany.cascade();
          FetchType fetchType = oneToMany.fetch();
          String mappedBy = oneToMany.mappedBy();

          this.checkCascade(collection, oneToMany, beanDescriptor, propertyDescriptor, cascades);
          this.checkFetch(collection, oneToMany, beanDescriptor, propertyDescriptor, fetchType);
          this.checkMappedBy(collection, oneToMany, beanDescriptor, propertyDescriptor, mappedBy);
        }
View Full Code Here

            || property.isAnnotationPresent( CollectionOfElements.class ) //legacy Hibernate
            || property.isAnnotationPresent( ElementCollection.class )
        ) ) {
      OneToMany oneToMany = property.getAnnotation( OneToMany.class );
      String mappedBy = oneToMany != null ?
          oneToMany.mappedBy() :
          "";
      joinColumns = Ejb3JoinColumn.buildJoinColumns(
          (JoinColumn[]) null,
          mappedBy, entityBinder.getSecondaryTables(),
          propertyHolder, inferredData.getPropertyName(), mappings
View Full Code Here

          if ( column.isSecondary() ) {
            throw new NotYetImplementedException( "Collections having FK in secondary table" );
          }
        }
        collectionBinder.setFkJoinColumns( joinColumns );
        mappedBy = oneToManyAnn.mappedBy();
        collectionBinder.setTargetEntity(
            mappings.getReflectionManager().toXClass( oneToManyAnn.targetEntity() )
        );
        collectionBinder.setCascadeStrategy(
            getCascadeStrategy( oneToManyAnn.cascade(), hibernateCascade, oneToManyAnn.orphanRemoval()) );
View Full Code Here

        }
        if (propertyDescriptor.isAnnotationPresent(OneToMany.class)) {
          OneToMany oneToMany = propertyDescriptor.getAnnotation(OneToMany.class);
          CascadeType[] cascades = oneToMany.cascade();
          FetchType fetchType = oneToMany.fetch();
          String mappedBy = oneToMany.mappedBy();

          this.checkCascade(collection, oneToMany, beanDescriptor, propertyDescriptor, cascades);
          this.checkFetch(collection, oneToMany, beanDescriptor, propertyDescriptor, fetchType);
          this.checkMappedBy(collection, oneToMany, beanDescriptor, propertyDescriptor, mappedBy);
        }
View Full Code Here

            Object tarObj = fList.get(i);
            if (tarObj == null)
              continue;

            ReflectUtil tarRu = new ReflectUtil(tarObj);
            String mappedBy = oneToMany.mappedBy();
            if (mappedBy != null && mappedBy.trim().length() > 0) {
              Method ownFieldSetter = tarRu.getSetter(mappedBy);
              if (ownFieldSetter == null)
                continue;
View Full Code Here

          if (ann == null) {
            ann = f.getAnnotation(OneToMany.class);
            if (ann == null)
              continue;
          }
          String mappedBy = ann.mappedBy();

          Class<?> tarClass = ann.targetEntity();
          if (void.class.isAssignableFrom(tarClass))
            tarClass = ClassUtil.getGenericType(f);
View Full Code Here

      try {
        ReflectUtil tarRu = new ReflectUtil(tarClass);
       
        List<?> tarList = null;
       
        String mappedBy = ann.mappedBy();
        if (mappedBy != null && mappedBy.trim().length() > 0) {
          Method ownFieldSetter = tarRu.getSetter(mappedBy);
          if (ownFieldSetter == null)
            continue;
        } else {
View Full Code Here

     
            Class<?> tarClass = ann.targetEntity();
            if (void.class.isAssignableFrom(tarClass))
              tarClass = ClassUtil.getGenericType(f);
     
            String mappedBy = ann.mappedBy();
     
            ReflectUtil tarRu = new ReflectUtil(tarClass);
            if (mappedBy != null && mappedBy.trim().length() > 0) {
              Method ownFieldSetter = tarRu.getSetter(mappedBy);
              if (ownFieldSetter == null)
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.