Package org.hibernate.metamodel.binding.state

Examples of org.hibernate.metamodel.binding.state.SimpleAttributeBindingState


      entityDiscriminator.initialize( bindingState );
      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 );
    }

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


  }

  protected SimpleAttributeBinding bindProperty(
      XMLPropertyElement property,
      EntityBinding entityBinding) {
    SimpleAttributeBindingState bindingState = new HbmSimpleAttributeBindingState(
        entityBinding.getEntity().getJavaType().getName(),
        bindingContext,
        entityBinding.getMetaAttributeContext(),
        property
    );

    // boolean (true here) indicates that by default column names should be guessed
    ValueRelationalState relationalState =
        convertToSimpleValueRelationalStateIfPossible(
            new HbmSimpleValueRelationalStateContainer(
                bindingContext,
                true,
                property
            )
        );

    Attribute attribute = entityBinding.getEntity().getOrCreateSingularAttribute( bindingState.getAttributeName() );
    return entityBinding.makeSimpleAttributeBinding( attribute )
        .initialize( bindingState )
        .initialize( relationalState );
  }
View Full Code Here

        getBindingContext().getOrigin()
    );
  }

  private void bindSimpleId(XMLId id, EntityBinding entityBinding) {
    SimpleAttributeBindingState bindingState = new HbmSimpleAttributeBindingState(
        entityBinding.getEntity().getJavaType().getName(),
        getBindingContext(),
        entityBinding.getMetaAttributeContext(),
        id
    );
    // boolean (true here) indicates that by default column names should be guessed
    HbmSimpleValueRelationalStateContainer relationalStateContainer = new HbmSimpleValueRelationalStateContainer(
        getBindingContext(), true, id
    );
    if ( relationalStateContainer.getRelationalStates().size() > 1 ) {
      throw new MappingException( "ID is expected to be a single column, but has more than 1 value" );
    }

    Attribute attribute = entityBinding.getEntity().getOrCreateSingularAttribute( bindingState.getAttributeName() );
    entityBinding.makeSimpleIdAttributeBinding( attribute )
        .initialize( bindingState )
        .initialize( relationalStateContainer.getRelationalStates().get( 0 ) );

    // if ( propertyName == null || entity.getPojoRepresentation() == null ) {
View Full Code Here

    }
  }

  protected void bindVersion(XMLHibernateMapping.XMLClass.XMLVersion version,
                 EntityBinding entityBinding) {
    SimpleAttributeBindingState bindingState =
        new HbmSimpleAttributeBindingState(
            entityBinding.getEntity().getJavaType().getName(),
            getBindingContext(),
            entityBinding.getMetaAttributeContext(),
            version
        );

    // boolean (true here) indicates that by default column names should be guessed
    ValueRelationalState relationalState =
        convertToSimpleValueRelationalStateIfPossible(
            new HbmSimpleValueRelationalStateContainer(
                getBindingContext(),
                true,
                version
            )
        );

    Attribute attribute = entityBinding.getEntity().getOrCreateSingularAttribute( bindingState.getAttributeName() );
    entityBinding.makeVersionBinding( attribute )
        .initialize( bindingState )
        .initialize( relationalState );
  }
View Full Code Here

  }

  protected void bindTimestamp(XMLHibernateMapping.XMLClass.XMLTimestamp timestamp,
                 EntityBinding entityBinding) {

    SimpleAttributeBindingState bindingState =
        new HbmSimpleAttributeBindingState(
            entityBinding.getEntity().getJavaType().getName(),
            getBindingContext(),
            entityBinding.getMetaAttributeContext(),
            timestamp
        );

    // relational model has not been bound yet
    // boolean (true here) indicates that by default column names should be guessed
    ValueRelationalState relationalState =
        convertToSimpleValueRelationalStateIfPossible(
            new HbmSimpleValueRelationalStateContainer(
                getBindingContext(),
                true,
                timestamp
            )
        );

    Attribute attribute = entityBinding.getEntity().getOrCreateSingularAttribute( bindingState.getAttributeName() );
    entityBinding.makeVersionBinding( attribute )
        .initialize( bindingState )
        .initialize( relationalState );
  }
View Full Code Here

  }

  protected SimpleAttributeBinding bindProperty(
      XMLPropertyElement property,
      EntityBinding entityBinding) {
    SimpleAttributeBindingState bindingState = new HbmSimpleAttributeBindingState(
        entityBinding.getEntity().getJavaType().getName(),
        bindingContext,
        entityBinding.getMetaAttributeContext(),
        property
    );

    // boolean (true here) indicates that by default column names should be guessed
    ValueRelationalState relationalState =
        convertToSimpleValueRelationalStateIfPossible(
            new HbmSimpleValueRelationalStateContainer(
                bindingContext,
                true,
                property
            )
        );

    entityBinding.getEntity().getOrCreateSingularAttribute( bindingState.getAttributeName() );
    return entityBinding.makeSimpleAttributeBinding( bindingState.getAttributeName() )
        .initialize( bindingState )
        .initialize( relationalState );
  }
View Full Code Here

        getBindingContext().getOrigin()
    );
  }

  private void bindSimpleId(XMLId id, EntityBinding entityBinding) {
    SimpleAttributeBindingState bindingState = new HbmSimpleAttributeBindingState(
        entityBinding.getEntity().getJavaType().getName(),
        getBindingContext(),
        entityBinding.getMetaAttributeContext(),
        id
    );
    // boolean (true here) indicates that by default column names should be guessed
    HbmSimpleValueRelationalStateContainer relationalStateContainer = new HbmSimpleValueRelationalStateContainer(
        getBindingContext(), true, id
    );
    if ( relationalStateContainer.getRelationalStates().size() > 1 ) {
      throw new MappingException( "ID is expected to be a single column, but has more than 1 value" );
    }

    entityBinding.getEntity().getOrCreateSingularAttribute( bindingState.getAttributeName() );
    entityBinding.makeSimpleIdAttributeBinding( bindingState.getAttributeName() )
        .initialize( bindingState )
        .initialize( relationalStateContainer.getRelationalStates().get( 0 ) );

    // if ( propertyName == null || entity.getPojoRepresentation() == null ) {
    // bindSimpleValue( idNode, id, false, RootClass.DEFAULT_IDENTIFIER_COLUMN_NAME, mappings );
View Full Code Here

    }
  }

  protected void bindVersion(XMLHibernateMapping.XMLClass.XMLVersion version,
                 EntityBinding entityBinding) {
    SimpleAttributeBindingState bindingState =
        new HbmSimpleAttributeBindingState(
            entityBinding.getEntity().getJavaType().getName(),
            getBindingContext(),
            entityBinding.getMetaAttributeContext(),
            version
        );

    // boolean (true here) indicates that by default column names should be guessed
    ValueRelationalState relationalState =
        convertToSimpleValueRelationalStateIfPossible(
            new HbmSimpleValueRelationalStateContainer(
                getBindingContext(),
                true,
                version
            )
        );

    entityBinding.getEntity().getOrCreateSingularAttribute( bindingState.getAttributeName() );
    entityBinding.makeVersionBinding( bindingState.getAttributeName() )
        .initialize( bindingState )
        .initialize( relationalState );
  }
View Full Code Here

  }

  protected void bindTimestamp(XMLHibernateMapping.XMLClass.XMLTimestamp timestamp,
                 EntityBinding entityBinding) {

    SimpleAttributeBindingState bindingState =
        new HbmSimpleAttributeBindingState(
            entityBinding.getEntity().getJavaType().getName(),
            getBindingContext(),
            entityBinding.getMetaAttributeContext(),
            timestamp
        );

    // relational model has not been bound yet
    // boolean (true here) indicates that by default column names should be guessed
    ValueRelationalState relationalState =
        convertToSimpleValueRelationalStateIfPossible(
            new HbmSimpleValueRelationalStateContainer(
                getBindingContext(),
                true,
                timestamp
            )
        );

    entityBinding.makeVersionBinding( bindingState.getAttributeName() )
        .initialize( bindingState )
        .initialize( relationalState );
  }
View Full Code Here

      entityDiscriminator.initialize( bindingState );
      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 );
    }

    if ( configuredClass.hasOwnTable() ) {
      ColumnRelationalStateImpl columnRelationsState = new ColumnRelationalStateImpl(
View Full Code Here

TOP

Related Classes of org.hibernate.metamodel.binding.state.SimpleAttributeBindingState

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.