Package org.hibernate.metamodel.binding

Examples of org.hibernate.metamodel.binding.SimpleAttributeBinding.initialize()


    SingularAttribute attribute = entityBinding.getEntity().getOrCreateComponentAttribute( idName );


    SimpleAttributeBinding attributeBinding = entityBinding.makeSimpleIdAttributeBinding( attribute );

    attributeBinding.initialize( new AttributeBindingStateImpl( (SimpleAttribute) idAttribute ) );

    TupleRelationalStateImpl state = new TupleRelationalStateImpl();
    EmbeddableClass embeddableClass = entityClass.getEmbeddedClasses().get( idName );
    for ( SimpleAttribute attr : embeddableClass.getSimpleAttributes() ) {
      state.addValueState( new ColumnRelationalStateImpl( attr, meta ) );
View Full Code Here


    TupleRelationalStateImpl state = new TupleRelationalStateImpl();
    EmbeddableClass embeddableClass = entityClass.getEmbeddedClasses().get( idName );
    for ( SimpleAttribute attr : embeddableClass.getSimpleAttributes() ) {
      state.addValueState( new ColumnRelationalStateImpl( attr, meta ) );
    }
    attributeBinding.initialize( state );
    Map<String, String> parms = new HashMap<String, String>( 1 );
    parms.put( IdentifierGenerator.ENTITY_NAME, entityBinding.getEntity().getName() );
    IdGenerator generator = new IdGenerator( "NAME", "assigned", parms );
    entityBinding.getEntityIdentifier().setIdGenerator( generator );
    // entityBinding.getEntityIdentifier().createIdentifierGenerator( meta.getIdentifierGeneratorFactory() );
View Full Code Here

    // now that we have the id attribute we can create the attribute and binding
    MappedAttribute idAttribute = iter.next();
    Attribute attribute = container.getOrCreateSingularAttribute( idAttribute.getName() );

    SimpleAttributeBinding attributeBinding = entityBinding.makeSimpleIdAttributeBinding( attribute );
    attributeBinding.initialize( new AttributeBindingStateImpl( (SimpleAttribute) idAttribute ) );
    attributeBinding.initialize( new ColumnRelationalStateImpl( (SimpleAttribute) idAttribute, meta ) );
    bindSingleIdGeneratedValue( entityBinding, idAttribute.getName() );
  }

  private void bindSingleIdGeneratedValue(EntityBinding entityBinding, String idPropertyName) {
View Full Code Here

    MappedAttribute idAttribute = iter.next();
    Attribute attribute = container.getOrCreateSingularAttribute( idAttribute.getName() );

    SimpleAttributeBinding attributeBinding = entityBinding.makeSimpleIdAttributeBinding( attribute );
    attributeBinding.initialize( new AttributeBindingStateImpl( (SimpleAttribute) idAttribute ) );
    attributeBinding.initialize( new ColumnRelationalStateImpl( (SimpleAttribute) idAttribute, meta ) );
    bindSingleIdGeneratedValue( entityBinding, idAttribute.getName() );
  }

  private void bindSingleIdGeneratedValue(EntityBinding entityBinding, String idPropertyName) {
    AnnotationInstance generatedValueAnn = JandexHelper.getSingleAnnotation(
View Full Code Here

      attributeBinding = entityDiscriminator.getValueBinding();
    }
    else if ( simpleAttribute.isVersioned() ) {
      attributeBinding = entityBinding.makeVersionBinding( attribute );
      SimpleAttributeBindingState bindingState = new AttributeBindingStateImpl( simpleAttribute );
      attributeBinding.initialize( bindingState );
    }
    else {
      attributeBinding = entityBinding.makeSimpleAttributeBinding( attribute );
      SimpleAttributeBindingState bindingState = new AttributeBindingStateImpl( simpleAttribute );
      attributeBinding.initialize( bindingState );
View Full Code Here

      attributeBinding.initialize( bindingState );
    }
    else {
      attributeBinding = entityBinding.makeSimpleAttributeBinding( attribute );
      SimpleAttributeBindingState bindingState = new AttributeBindingStateImpl( simpleAttribute );
      attributeBinding.initialize( bindingState );
    }

    if ( entityClass.hasOwnTable() ) {
      ColumnRelationalStateImpl columnRelationsState = new ColumnRelationalStateImpl(
          simpleAttribute, meta
View Full Code Here

          simpleAttribute, meta
      );
      TupleRelationalStateImpl relationalState = new TupleRelationalStateImpl();
      relationalState.addValueState( columnRelationsState );

      attributeBinding.initialize( relationalState );
    }
  }

  private void bindHibernateEntityAnnotation(EntityBindingStateImpl entityBindingState) {
    // initialize w/ the defaults
View Full Code Here

    }

    entityBinding.getEntity().getOrCreateSingularAttribute( idName );

    SimpleAttributeBinding attributeBinding = entityBinding.makeSimpleIdAttributeBinding( idName );
    attributeBinding.initialize( new AttributeBindingStateImpl( (SimpleAttribute) idAttribute ) );
    attributeBinding.initialize( new ColumnRelationalStateImpl( (SimpleAttribute) idAttribute, meta ) );
    bindSingleIdGeneratedValue( entityBinding, idName );

  }
View Full Code Here

    entityBinding.getEntity().getOrCreateSingularAttribute( idName );

    SimpleAttributeBinding attributeBinding = entityBinding.makeSimpleIdAttributeBinding( idName );
    attributeBinding.initialize( new AttributeBindingStateImpl( (SimpleAttribute) idAttribute ) );
    attributeBinding.initialize( new ColumnRelationalStateImpl( (SimpleAttribute) idAttribute, meta ) );
    bindSingleIdGeneratedValue( entityBinding, idName );

  }

  private void bindSingleIdGeneratedValue(EntityBinding entityBinding, String idPropertyName) {
View Full Code Here

      attributeBinding = entityDiscriminator.getValueBinding();
    }
    else if ( simpleAttribute.isVersioned() ) {
      attributeBinding = entityBinding.makeVersionBinding( attributeName );
      SimpleAttributeBindingState bindingState = new AttributeBindingStateImpl( simpleAttribute );
      attributeBinding.initialize( bindingState );
    }
    else {
      attributeBinding = entityBinding.makeSimpleAttributeBinding( attributeName );
      SimpleAttributeBindingState bindingState = new AttributeBindingStateImpl( simpleAttribute );
      attributeBinding.initialize( bindingState );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.