Package javax.persistence

Examples of javax.persistence.JoinColumn


          .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

    final SqlParameterDefinition definition;
    String sn = null;
    ManyToOne manyToOne = getAnnotation(objectType, parameterName, ManyToOne.class);
    if (manyToOne != null) {
      Class<?> subK = checkNotNull(manyToOne.targetEntity(), "targetEntity not set");
      JoinColumn joinColumn = getAnnotation(objectType, parameterName, JoinColumn.class);
      SqlObjectDefinition<?> od = SqlObjectDefinition.fromClass(subK, config);
      checkState( ! od.getIdParameters().isEmpty(), "No id parameters");
      if (joinColumn != null)
        sn = joinColumn.name();
      if (sn == null)
        sn = config.getNamingStrategy().propertyToColumnName(parameterName);
      FetchType fetch = manyToOne.fetch();
      int depth;
      if (FetchType.LAZY == fetch) {
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

    element.setAttribute("fetch", manyToOne.fetch().name());

    this.addCascades(element, manyToOne.cascade());

    if (propertyDescriptor.isAnnotationPresent(JoinColumn.class)) {
      JoinColumn jc = propertyDescriptor.getAnnotation(JoinColumn.class);
      this.addJoinColumn(element, jc);
    }
    return element;
  }
View Full Code Here

    if (Conditions.isEmpty(mappedBy)) {
      if (!property.isAnnotationPresent(JoinColumn.class)) {
        errors.add("Missing @OneToOne(mappedBy) or @JoinColumn on " + this.getAttributeName(property));
      } else {
        JoinColumn joinColumn = property.getAnnotation(JoinColumn.class);
        if (oneToOne.optional() != joinColumn.nullable()) {
          errors.add("Conflict in @OneToOne(optional) and @JoinColumn(nullable) on " + this.getAttributeName(property));
        }
      }
    }
  }
View Full Code Here

    this.checkFetch(errors, manyToOne, property, fetchType);

    if (!property.isAnnotationPresent(JoinColumn.class)) {
      errors.add("Missing @JoinColumn on " + this.getAttributeName(property));
    } else {
      JoinColumn joinColumn = property.getAnnotation(JoinColumn.class);
      if (manyToOne.optional() != joinColumn.nullable()) {
        errors.add("Conflict in @ManyToOne(optional) and @JoinColumn(nullable) on " + this.getAttributeName(property));
      }
    }
  }
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.