Package org.hibernate.mapping

Examples of org.hibernate.mapping.DependantValue


        " -> " + joinedSubclass.getTable().getName()
      );

    // KEY
    Element keyNode = node.element( "key" );
    SimpleValue key = new DependantValue( mytable, joinedSubclass.getIdentifier() );
    joinedSubclass.setKey( key );
    key.setCascadeDeleteEnabled( "cascade".equals( keyNode.attributeValue( "on-delete" ) ) );
    bindSimpleValue( keyNode, key, false, joinedSubclass.getEntityName(), mappings );

    // model.getKey().setType( new Type( model.getIdentifier() ) );
    joinedSubclass.createPrimaryKey();
    joinedSubclass.createForeignKey();
View Full Code Here


        " -> " + join.getTable().getName()
      );

    // KEY
    Element keyNode = node.element( "key" );
    SimpleValue key = new DependantValue( table, persistentClass.getIdentifier() );
    join.setKey( key );
    key.setCascadeDeleteEnabled( "cascade".equals( keyNode.attributeValue( "on-delete" ) ) );
    bindSimpleValue( keyNode, key, false, persistentClass.getEntityName(), mappings );

    // join.getKey().setType( new Type( lazz.getIdentifier() ) );
    join.createPrimaryKey();
    join.createForeignKey();
View Full Code Here

          keyVal = collection.getOwner().getIdentifier();
        }
        else {
          keyVal = (KeyValue) collection.getOwner().getRecursiveProperty( propRef ).getValue();
        }
        SimpleValue key = new DependantValue( collection.getCollectionTable(), keyVal );
        key.setCascadeDeleteEnabled( "cascade"
          .equals( subnode.attributeValue( "on-delete" ) ) );
        bindSimpleValue(
            subnode,
            key,
            collection.isOneToMany(),
View Full Code Here

    }
    bindJoinToPersistentClass( join, ejb3JoinColumns, mappings );
  }

  private void bindJoinToPersistentClass(Join join, Ejb3JoinColumn[] ejb3JoinColumns, Mappings mappings) {
    SimpleValue key = new DependantValue( mappings, join.getTable(), persistentClass.getIdentifier() );
    join.setKey( key );
    setFKNameIfDefined( join );
    key.setCascadeDeleteEnabled( false );
    TableBinder.bindFk( persistentClass, null, ejb3JoinColumns, key, false, mappings );
    join.createPrimaryKey();
    join.createForeignKey();
    persistentClass.addJoin( join );
  }
View Full Code Here

    else {
      keyVal = (KeyValue) collValue.getOwner()
          .getRecursiveProperty( propRef )
          .getValue();
    }
    DependantValue key = new DependantValue( mappings, collValue.getCollectionTable(), keyVal );
    key.setTypeName( null );
    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

        "Mapping joined-subclass: %s -> %s", joinedSubclass.getEntityName(), joinedSubclass.getTable().getName()
    );

    // KEY
    Element keyNode = node.element( "key" );
    SimpleValue key = new DependantValue( mappings, mytable, joinedSubclass.getIdentifier() );
    joinedSubclass.setKey( key );
    key.setCascadeDeleteEnabled( "cascade".equals( keyNode.attributeValue( "on-delete" ) ) );
    bindSimpleValue( keyNode, key, false, joinedSubclass.getEntityName(), mappings );

    // model.getKey().setType( new Type( model.getIdentifier() ) );
    joinedSubclass.createPrimaryKey();
    joinedSubclass.createForeignKey();
View Full Code Here

        LOG.debugf( "Mapping class join: %s -> %s", persistentClass.getEntityName(), join.getTable().getName() );

    // KEY
    Element keyNode = node.element( "key" );
    SimpleValue key = new DependantValue( mappings, table, persistentClass.getIdentifier() );
    join.setKey( key );
    key.setCascadeDeleteEnabled( "cascade".equals( keyNode.attributeValue( "on-delete" ) ) );
    bindSimpleValue( keyNode, key, false, persistentClass.getEntityName(), mappings );

    // join.getKey().setType( new Type( lazz.getIdentifier() ) );
    join.createPrimaryKey();
    join.createForeignKey();
View Full Code Here

          keyVal = collection.getOwner().getIdentifier();
        }
        else {
          keyVal = (KeyValue) collection.getOwner().getRecursiveProperty( propRef ).getValue();
        }
        SimpleValue key = new DependantValue( mappings, collection.getCollectionTable(), keyVal );
        key.setCascadeDeleteEnabled( "cascade"
          .equals( subnode.attributeValue( "on-delete" ) ) );
        bindSimpleValue(
            subnode,
            key,
            collection.isOneToMany(),
View Full Code Here

      LOG.debugf( "Mapping joined-subclass: %s -> %s", joinedSubclass.getEntityName(), joinedSubclass.getTable().getName() );
    }

    // KEY
    Element keyNode = node.element( "key" );
    SimpleValue key = new DependantValue( mappings, mytable, joinedSubclass.getIdentifier() );
    joinedSubclass.setKey( key );
    key.setCascadeDeleteEnabled( "cascade".equals( keyNode.attributeValue( "on-delete" ) ) );
    bindSimpleValue( keyNode, key, false, joinedSubclass.getEntityName(), mappings );

    // model.getKey().setType( new Type( model.getIdentifier() ) );
    joinedSubclass.createPrimaryKey();
    joinedSubclass.createForeignKey();
View Full Code Here

      LOG.debugf( "Mapping class join: %s -> %s", persistentClass.getEntityName(), join.getTable().getName() );
    }

    // KEY
    Element keyNode = node.element( "key" );
    SimpleValue key = new DependantValue( mappings, table, persistentClass.getIdentifier() );
    join.setKey( key );
    key.setCascadeDeleteEnabled( "cascade".equals( keyNode.attributeValue( "on-delete" ) ) );
    bindSimpleValue( keyNode, key, false, persistentClass.getEntityName(), mappings );

    // join.getKey().setType( new Type( lazz.getIdentifier() ) );
    join.createPrimaryKey();
    join.createForeignKey();
View Full Code Here

TOP

Related Classes of org.hibernate.mapping.DependantValue

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.