Package org.hibernate.annotations

Examples of org.hibernate.annotations.ForeignKey


                + " in mappedBy of "
                + StringHelper.qualify( ownerEntity, ownerProperty )
        );
      }
    }
    ForeignKey fk = inferredData.getProperty().getAnnotation( ForeignKey.class );
    String fkName = fk != null ? fk.name() : "";
    if ( !BinderHelper.isEmptyAnnotationValue( fkName ) ) value.setForeignKeyName( fkName );
  }
View Full Code Here


      if ( inheritanceState.hasParents() ) {
        onDeleteAppropriate = true;
        final JoinedSubclass jsc = ( JoinedSubclass ) persistentClass;
        SimpleValue key = new DependantValue( mappings, jsc.getTable(), jsc.getIdentifier() );
        jsc.setKey( key );
        ForeignKey fk = clazzToProcess.getAnnotation( ForeignKey.class );
        if ( fk != null && !BinderHelper.isEmptyAnnotationValue( fk.name() ) ) {
          key.setForeignKeyName( fk.name() );
        }
        if ( onDeleteAnn != null ) {
          key.setCascadeDeleteEnabled( OnDeleteAction.CASCADE.equals( onDeleteAnn.action() ) );
        }
        else {
View Full Code Here

    String fkName = null;
    if ( joinColumn != null && joinColumn.foreignKey() != null ) {
      fkName = joinColumn.foreignKey().name();
    }
    if ( StringHelper.isEmpty( fkName ) ) {
      ForeignKey fk = property.getAnnotation( ForeignKey.class );
      fkName = fk != null ? fk.name() : "";
    }
    if ( !StringHelper.isEmpty( fkName ) ) {
      value.setForeignKeyName( fkName );
    }
View Full Code Here

      if ( persistentClass.getEntityPersisterClass() == null ) {
        persistentClass.getRootClass().setEntityPersisterClass( JoinedSubclassEntityPersister.class );
      }
      SimpleValue key = new DependantValue( jsc.getTable(), jsc.getIdentifier() );
      jsc.setKey( key );
      ForeignKey fk = annotatedClass.getAnnotation( ForeignKey.class );
      if ( fk != null && !BinderHelper.isDefault( fk.name() ) ) {
        key.setForeignKeyName( fk.name() );
      }
      if ( onDeleteAnn != null ) {
        key.setCascadeDeleteEnabled( OnDeleteAction.CASCADE.equals( onDeleteAnn.action() ) );
      }
      else {
View Full Code Here

    }
    value.setTypeName( inferredData.getClassOrElementName() );
    final String propertyName = inferredData.getPropertyName();
    value.setTypeUsingReflection( propertyHolder.getClassName(), propertyName );

    ForeignKey fk = inferredData.getProperty().getAnnotation( ForeignKey.class );
    String fkName = fk != null ?
        fk.name() :
        "";
    if ( !BinderHelper.isDefault( fkName ) ) value.setForeignKeyName( fkName );

    String path = propertyHolder.getPath() + "." + propertyName;
    FkSecondPass secondPass = new ToOneFkSecondPass(
View Full Code Here

    Ejb3Column.checkPropertyConsistency( joinColumns, collValue.getOwnerEntityName() );
    key.setNullable( joinColumns.length == 0 || joinColumns[0].isNullable() );
    key.setUpdateable( joinColumns.length == 0 || joinColumns[0].isUpdatable() );
    key.setCascadeDeleteEnabled( cascadeDeleteEnabled );
    collValue.setKey( key );
    ForeignKey fk = property != null ? property.getAnnotation( ForeignKey.class ) : null;
    String fkName = fk != null ? fk.name() : "";
    if ( !BinderHelper.isDefault( fkName ) ) key.setForeignKeyName( fkName );
    return key;
  }
View Full Code Here

      if ( StringHelper.isNotEmpty( hqlOrderBy ) ) {
        collValue.setManyToManyOrdering(
            buildOrderByClauseFromHql( hqlOrderBy, collectionEntity, collValue.getRole() )
        );
      }
      ForeignKey fk = property != null ? property.getAnnotation( ForeignKey.class ) : null;
      String fkName = fk != null ? fk.inverseName() : "";
      if ( !BinderHelper.isDefault( fkName ) ) element.setForeignKeyName( fkName );
    }
    else if ( anyAnn != null ) {
      //@ManyToAny
      //Make sure that collTyp is never used during the @ManyToAny branch: it will be set to void.class
View Full Code Here

                + " in mappedBy of "
                + StringHelper.qualify( ownerEntity, ownerProperty )
        );
      }
    }
    ForeignKey fk = inferredData.getProperty().getAnnotation( ForeignKey.class );
    String fkName = fk != null ? fk.name() : "";
    if ( !BinderHelper.isDefault( fkName ) ) value.setForeignKeyName( fkName );
  }
View Full Code Here

                + " in mappedBy of "
                + StringHelper.qualify( ownerEntity, ownerProperty )
        );
      }
    }
    ForeignKey fk = inferredData.getProperty().getAnnotation( ForeignKey.class );
    String fkName = fk != null ? fk.name() : "";
    if ( !BinderHelper.isEmptyAnnotationValue( fkName ) ) value.setForeignKeyName( fkName );
  }
View Full Code Here

    Ejb3Column.checkPropertyConsistency( joinColumns, collValue.getOwnerEntityName() );
    key.setNullable( joinColumns.length == 0 || joinColumns[0].isNullable() );
    key.setUpdateable( joinColumns.length == 0 || joinColumns[0].isUpdatable() );
    key.setCascadeDeleteEnabled( cascadeDeleteEnabled );
    collValue.setKey( key );
    ForeignKey fk = property != null ? property.getAnnotation( ForeignKey.class ) : null;
    String fkName = fk != null ? fk.name() : "";
    if ( !BinderHelper.isEmptyAnnotationValue( fkName ) ) key.setForeignKeyName( fkName );
    return key;
  }
View Full Code Here

TOP

Related Classes of org.hibernate.annotations.ForeignKey

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.