Package org.hibernate.annotations

Examples of org.hibernate.annotations.ForeignKey


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

    ForeignKey fk = property.getAnnotation( ForeignKey.class );
    String fkName = fk != null ?
        fk.name() :
        "";
    if ( !BinderHelper.isDefault( 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

      if ( hqlOrderBy != null ) {
        collValue.setManyToManyOrdering(
            buildOrderByClauseFromHql( hqlOrderBy, collectionEntity, collValue.getRole() )
        );
      }
      final ForeignKey fk = property.getAnnotation( ForeignKey.class );
      String fkName = fk != null ? fk.inverseName() : "";
      if ( !BinderHelper.isEmptyAnnotationValue( fkName ) ) {
        element.setForeignKeyName( fkName );
      }
    }
    else if ( anyAnn != null ) {
View Full Code Here

    if ( InheritanceType.JOINED.equals( inheritanceState.getType() ) && 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

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

    ForeignKey fk = property.getAnnotation( ForeignKey.class );
    String fkName = fk != null ?
        fk.name() :
        "";
    if ( !BinderHelper.isEmptyAnnotationValue( fkName ) ) {
      value.setForeignKeyName( fkName );
    }
View Full Code Here

      if ( persistentClass.getEntityPersisterClass() == null ) {
        persistentClass.getRootClass().setEntityPersisterClass( JoinedSubclassEntityPersister.class );
      }
      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

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

    ForeignKey fk = property.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

      if ( hqlOrderBy != null ) {
        collValue.setManyToManyOrdering(
            buildOrderByClauseFromHql( hqlOrderBy, collectionEntity, collValue.getRole() )
        );
      }
      ForeignKey fk = property != null ? property.getAnnotation( ForeignKey.class ) : null;
      String fkName = fk != null ? fk.inverseName() : "";
      if ( !BinderHelper.isEmptyAnnotationValue( 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

      if ( persistentClass.getEntityPersisterClass() == null ) {
        persistentClass.getRootClass().setEntityPersisterClass( JoinedSubclassEntityPersister.class );
      }
      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

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.