Package org.hibernate.metamodel.binding

Examples of org.hibernate.metamodel.binding.ManyToOneAttributeBinding


  private void bindAssociationAttribute(EntityBinding entityBinding, AttributeContainer container, AssociationAttribute associationAttribute) {
    switch ( associationAttribute.getAssociationType() ) {
      case MANY_TO_ONE: {
        container.getOrCreateSingularAttribute( associationAttribute.getName() );
        ManyToOneAttributeBinding manyToOneAttributeBinding = entityBinding.makeManyToOneAttributeBinding(
            associationAttribute.getName()
        );

        ManyToOneAttributeBindingState bindingState = new ManyToOneBindingStateImpl( associationAttribute );
        manyToOneAttributeBinding.initialize( bindingState );

        ManyToOneRelationalStateImpl relationalState = new ManyToOneRelationalStateImpl();
        if ( entityClass.hasOwnTable() ) {
          ColumnRelationalStateImpl columnRelationsState = new ColumnRelationalStateImpl(
              associationAttribute, meta
          );
          relationalState.addValueState( columnRelationsState );
        }
        manyToOneAttributeBinding.initialize( relationalState );
        break;
      }
      default: {
        // todo
      }
View Full Code Here


            true,
            manyToOne
        );

    entityBinding.getEntity().getOrCreateSingularAttribute( bindingState.getAttributeName() );
    ManyToOneAttributeBinding manyToOneAttributeBinding =
        entityBinding.makeManyToOneAttributeBinding( bindingState.getAttributeName() )
            .initialize( bindingState )
            .initialize( relationalState );

    return manyToOneAttributeBinding;
View Full Code Here

                true,
                manyToOne
            );

      entityBinding.getEntity().getOrCreateSingularAttribute( bindingState.getAttributeName() );
    ManyToOneAttributeBinding manyToOneAttributeBinding =
        entityBinding.makeManyToOneAttributeBinding( bindingState.getAttributeName() )
            .initialize( bindingState )
            .initialize( relationalState );

    return manyToOneAttributeBinding;
View Full Code Here

  private void bindAssociationAttribute(EntityBinding entityBinding, AssociationAttribute associationAttribute) {
    switch ( associationAttribute.getAssociationType() ) {
      case MANY_TO_ONE: {
        entityBinding.getEntity().getOrCreateSingularAttribute( associationAttribute.getName() );
        ManyToOneAttributeBinding manyToOneAttributeBinding = entityBinding.makeManyToOneAttributeBinding(
            associationAttribute.getName()
        );

        ManyToOneAttributeBindingState bindingState = new ManyToOneBindingStateImpl( associationAttribute );
        manyToOneAttributeBinding.initialize( bindingState );

        ManyToOneRelationalStateImpl relationalState = new ManyToOneRelationalStateImpl();
        if ( configuredClass.hasOwnTable() ) {
          ColumnRelationalStateImpl columnRelationsState = new ColumnRelationalStateImpl(
              associationAttribute, meta
          );
          relationalState.addValueState( columnRelationsState );
        }
        manyToOneAttributeBinding.initialize( relationalState );
        break;
      }
      default: {
        // todo
      }
View Full Code Here

        // todo : handle map key
        //hibernateMappingBinder.getHibernateXmlBinder().getMetadata().addCollection( attributeBinding );
      }
      else if ( XMLManyToOneElement.class.isInstance( attribute ) ) {
        XMLManyToOneElement  manyToOne = XMLManyToOneElement.class.cast( attribute );
        ManyToOneAttributeBinding manyToOneBinding = entityBinding.makeManyToOneAttributeBinding( manyToOne.getName() );
        bindManyToOne( manyToOne, manyToOneBinding, entityBinding );
        attributeBinding = manyToOneBinding;
// todo : implement
//        value = new ManyToOne( mappings, table );
//        bindManyToOne( subElement, (ManyToOne) value, propertyName, nullable, mappings );
View Full Code Here

  private void bindAssociationAttribute(EntityBinding entityBinding, AssociationAttribute associationAttribute) {
    switch ( associationAttribute.getAssociationType() ) {
      case MANY_TO_ONE: {
        entityBinding.getEntity().getOrCreateSingularAttribute( associationAttribute.getName() );
        ManyToOneAttributeBinding manyToOneAttributeBinding = entityBinding.makeManyToOneAttributeBinding(
            associationAttribute.getName()
        );

        ManyToOneAttributeBindingState bindingState = new ManyToOneBindingStateImpl( associationAttribute );
        manyToOneAttributeBinding.initialize( bindingState );

        ManyToOneRelationalStateImpl relationalState = new ManyToOneRelationalStateImpl();
        if ( configuredClass.hasOwnTable() ) {
          ColumnRelationalStateImpl columnRelationsState = new ColumnRelationalStateImpl(
              associationAttribute, meta
          );
          relationalState.addValueState( columnRelationsState );
        }
        manyToOneAttributeBinding.initialize( relationalState );
        break;
      }
      default: {
        // todo
      }
View Full Code Here

                true,
                manyToOne
            );

      entityBinding.getEntity().getOrCreateSingularAttribute( bindingState.getAttributeName() );
    ManyToOneAttributeBinding manyToOneAttributeBinding =
        entityBinding.makeManyToOneAttributeBinding( bindingState.getAttributeName() )
            .initialize( bindingState )
            .initialize( relationalState );

    return manyToOneAttributeBinding;
View Full Code Here

TOP

Related Classes of org.hibernate.metamodel.binding.ManyToOneAttributeBinding

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.