Package javax.persistence

Examples of javax.persistence.JoinColumn


          this.checkFetch(collection, manyToOne, beanDescriptor, propertyDescriptor, fetchType);

          if (!propertyDescriptor.isAnnotationPresent(JoinColumn.class)) {
            collection.add("Missing @JoinColumn on " + beanDescriptor.getType().getCanonicalName() + "." + propertyDescriptor.getName());
          } else {
            JoinColumn joinColumn = propertyDescriptor.getAnnotation(JoinColumn.class);
            if (manyToOne.optional() != joinColumn.nullable()) {
              collection.add("Conflict in @ManyToOne(optional) and @JoinColumn(nullable) on " + beanDescriptor.getType().getCanonicalName() + "." + propertyDescriptor.getName());
            }
          }
        }
        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);
        }
        if (propertyDescriptor.isAnnotationPresent(OneToOne.class)) {
          OneToOne oneToOne = propertyDescriptor.getAnnotation(OneToOne.class);
          CascadeType[] cascades = oneToOne.cascade();
          FetchType fetchType = oneToOne.fetch();
          String mappedBy = oneToOne.mappedBy();

          this.checkCascade(collection, oneToOne, beanDescriptor, propertyDescriptor, cascades);
          this.checkFetch(collection, oneToOne, beanDescriptor, propertyDescriptor, fetchType);

          if (ConditionUtils.isEmpty(mappedBy)) {
            if (!propertyDescriptor.isAnnotationPresent(JoinColumn.class)) {
              collection.add("Missing @OneToOne(mappedBy) or @JoinColumn on " + beanDescriptor.getType().getCanonicalName() + "." + propertyDescriptor.getName());
            } else {
              JoinColumn joinColumn = propertyDescriptor.getAnnotation(JoinColumn.class);
              if (oneToOne.optional() != joinColumn.nullable()) {
                collection.add("Conflict in @OneToOne(optional) and @JoinColumn(nullable) on " + beanDescriptor.getType().getCanonicalName() + "." + propertyDescriptor.getName());
              }
            }
          }
        }
View Full Code Here


          .getDeclaredProperties( AccessType.FIELD.getType() ) ) {
        if ( prop.isAnnotationPresent( Id.class ) && prop.isAnnotationPresent( Column.class ) ) {
          columnName = prop.getAnnotation( Column.class ).name();
        }

        final JoinColumn joinColumn = property.getAnnotation( JoinColumn.class );
        if ( property.isAnnotationPresent( ManyToOne.class ) && joinColumn != null
            && ! BinderHelper.isEmptyAnnotationValue( joinColumn.name() )
            && joinColumn.name().equals( columnName )
            && !property.isAnnotationPresent( MapsId.class ) ) {
           hasSpecjManyToOne = true;
          for ( Ejb3JoinColumn column : columns ) {
            column.setInsertable( false );
            column.setUpdatable( false );
View Full Code Here

      };
    }
    else {
      joinColumns = new Ejb3JoinColumn[annJoins.length];
      JoinColumn annJoin;
      int length = annJoins.length;
      for (int index = 0; index < length; index++) {
        annJoin = annJoins[index];
        Ejb3JoinColumn currentJoinColumn = new Ejb3JoinColumn();
        currentJoinColumn.setImplicit( true );
View Full Code Here

          .getDeclaredProperties( AccessType.FIELD.getType() ) ) {
        if ( prop.isAnnotationPresent( Id.class ) && prop.isAnnotationPresent( Column.class ) ) {
          columnName = prop.getAnnotation( Column.class ).name();
        }

        final JoinColumn joinColumn = property.getAnnotation( JoinColumn.class );
        if ( property.isAnnotationPresent( ManyToOne.class ) && joinColumn != null
            && ! BinderHelper.isEmptyAnnotationValue( joinColumn.name() )
            && joinColumn.name().equals( columnName )
            && !property.isAnnotationPresent( MapsId.class ) ) {
           hasSpecjManyToOne = true;
          for ( Ejb3JoinColumn column : columns ) {
            column.setInsertable( false );
            column.setUpdatable( false );
View Full Code Here

      };
    }
    else {
      joinColumns = new Ejb3JoinColumn[annJoins.length];
      JoinColumn annJoin;
      int length = annJoins.length;
      for (int index = 0; index < length; index++) {
        annJoin = annJoins[index];
        Ejb3JoinColumn currentJoinColumn = new Ejb3JoinColumn();
        currentJoinColumn.setImplicit( true );
View Full Code Here

          .getDeclaredProperties( AccessType.FIELD.getType() ) ) {
        if ( prop.isAnnotationPresent( Id.class ) && prop.isAnnotationPresent( Column.class ) ) {
          columnName = prop.getAnnotation( Column.class ).name();
        }

        final JoinColumn joinColumn = property.getAnnotation( JoinColumn.class );
        if ( property.isAnnotationPresent( ManyToOne.class ) && joinColumn != null
            && ! BinderHelper.isEmptyAnnotationValue( joinColumn.name() )
            && joinColumn.name().equals( columnName )
            && !property.isAnnotationPresent( MapsId.class ) ) {
           hasSpecjManyToOne = true;
          for ( Ejb3JoinColumn column : columns ) {
            column.setInsertable( false );
            column.setUpdatable( false );
View Full Code Here

      };
    }
    else {
      joinColumns = new Ejb3JoinColumn[annJoins.length];
      JoinColumn annJoin;
      int length = annJoins.length;
      for (int index = 0; index < length; index++) {
        annJoin = annJoins[index];
        Ejb3JoinColumn currentJoinColumn = new Ejb3JoinColumn();
        currentJoinColumn.setImplicit( true );
View Full Code Here

          .getDeclaredProperties( AccessType.FIELD.getType() ) ) {
        if ( prop.isAnnotationPresent( Id.class ) && prop.isAnnotationPresent( Column.class ) ) {
          columnName = prop.getAnnotation( Column.class ).name();
        }

        final JoinColumn joinColumn = property.getAnnotation( JoinColumn.class );
        if ( property.isAnnotationPresent( ManyToOne.class ) && joinColumn != null
            && ! BinderHelper.isEmptyAnnotationValue( joinColumn.name() )
            && joinColumn.name().equals( columnName )
            && !property.isAnnotationPresent( MapsId.class ) ) {
           hasSpecjManyToOne = true;
          for ( Ejb3JoinColumn column : columns ) {
            column.setInsertable( false );
            column.setUpdatable( false );
View Full Code Here

          .getDeclaredProperties( AccessType.FIELD.getType() ) ) {
        if ( prop.isAnnotationPresent( Id.class ) && prop.isAnnotationPresent( Column.class ) ) {
          columnName = prop.getAnnotation( Column.class ).name();
        }

        final JoinColumn joinColumn = property.getAnnotation( JoinColumn.class );
        if ( property.isAnnotationPresent( ManyToOne.class ) && joinColumn != null
            && ! BinderHelper.isEmptyAnnotationValue( joinColumn.name() )
            && joinColumn.name().equals( columnName )
            && !property.isAnnotationPresent( MapsId.class ) ) {
           hasSpecjManyToOne = true;
          for ( Ejb3JoinColumn column : columns ) {
            column.setInsertable( false );
            column.setUpdatable( false );
View Full Code Here

          .getDeclaredProperties( AccessType.FIELD.getType() ) ) {
        if ( prop.isAnnotationPresent( Id.class ) && prop.isAnnotationPresent( Column.class ) ) {
          columnName = prop.getAnnotation( Column.class ).name();
        }

        final JoinColumn joinColumn = property.getAnnotation( JoinColumn.class );
        if ( property.isAnnotationPresent( ManyToOne.class ) && joinColumn != null
            && ! BinderHelper.isEmptyAnnotationValue( joinColumn.name() )
            && joinColumn.name().equals( columnName )
            && !property.isAnnotationPresent( MapsId.class ) ) {
           hasSpecjManyToOne = true;
          for ( Ejb3JoinColumn column : columns ) {
            column.setInsertable( false );
            column.setUpdatable( false );
View Full Code Here

TOP

Related Classes of javax.persistence.JoinColumn

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.