Examples of EntityBinding


Examples of org.hibernate.metamodel.binding.EntityBinding

    return entityBinding;
  }

  private EntityBinding makeDiscriminatedSubclassBinding(SubclassEntitySource entitySource, EntityBinding superEntityBinding) {
    final EntityBinding entityBinding = buildBasicEntityBinding( entitySource, superEntityBinding );

    entityBinding.setPrimaryTable( superEntityBinding.getPrimaryTable() );
    entityBinding.setPrimaryTableName( superEntityBinding.getPrimaryTableName() );
    bindDiscriminatorValue( entitySource, entityBinding );

    return entityBinding;
  }
View Full Code Here

Examples of org.hibernate.metamodel.binding.EntityBinding

    return entityBinding;
  }

  private EntityBinding makeJoinedSubclassBinding(SubclassEntitySource entitySource, EntityBinding superEntityBinding) {
    final EntityBinding entityBinding = buildBasicEntityBinding( entitySource, superEntityBinding );

    bindPrimaryTable( entitySource, entityBinding );

    // todo : join
View Full Code Here

Examples of org.hibernate.metamodel.binding.EntityBinding

    return entityBinding;
  }

  private EntityBinding makeUnionedSubclassBinding(SubclassEntitySource entitySource, EntityBinding superEntityBinding) {
    final EntityBinding entityBinding = buildBasicEntityBinding( entitySource, superEntityBinding );

    bindPrimaryTable( entitySource, entityBinding );

    // todo : ??
View Full Code Here

Examples of org.hibernate.metamodel.binding.EntityBinding

      }
      pluralAttributeBinding.setCollectionTable( collectionTable );
    }
    else {
      // todo : not sure wel have all the needed info here in all cases, specifically when needing to know the "other side"
      final EntityBinding owner = pluralAttributeBinding.getContainer().seekEntityBinding();
      final String ownerTableLogicalName = Table.class.isInstance( owner.getPrimaryTable() )
          ? Table.class.cast( owner.getPrimaryTable() ).getTableName().getName()
          : null;
      String collectionTableName = currentBindingContext.getNamingStrategy().collectionTableName(
          owner.getEntity().getName(),
          ownerTableLogicalName,
          null,  // todo : here
          null,  // todo : and here
          pluralAttributeBinding.getContainer().getPathBase() + '.' + attributeSource.getName()
      );
View Full Code Here

Examples of org.hibernate.metamodel.binding.EntityBinding

    this.classLoaderService = serviceRegistry.getService( ClassLoaderService.class );
  }

  @Override
  public void processCallbacksForEntity(Object entityObject, CallbackRegistryImpl callbackRegistry) {
    final EntityBinding entityBinding = (EntityBinding) entityObject;
    final String entityClassName = entityBinding.getEntity().getClassName();
    if ( entityClassName == null ) {
      return;
    }

    try {
View Full Code Here

Examples of org.hibernate.metamodel.binding.EntityBinding

    Map<String,ClassMetadata> classMeta = new HashMap<String,ClassMetadata>();
    for ( EntityBinding model : metadata.getEntityBindings() ) {
      // TODO: should temp table prep happen when metadata is being built?
      //model.prepareTemporaryTables( metadata, getDialect() );
      // cache region is defined by the root-class in the hierarchy...
      EntityBinding rootEntityBinding = metadata.getRootEntityBinding( model.getEntity().getName() );
      EntityRegionAccessStrategy accessStrategy = null;
      if ( settings.isSecondLevelCacheEnabled() &&
          rootEntityBinding.getHierarchyDetails().getCaching() != null &&
          model.getHierarchyDetails().getCaching() != null &&
          model.getHierarchyDetails().getCaching().getAccessType() != null ) {
        final String cacheRegionName = cacheRegionPrefix + rootEntityBinding.getHierarchyDetails().getCaching().getRegion();
        accessStrategy = EntityRegionAccessStrategy.class.cast( entityAccessStrategies.get( cacheRegionName ) );
        if ( accessStrategy == null ) {
          final AccessType accessType = model.getHierarchyDetails().getCaching().getAccessType();
          if ( traceEnabled ) {
            LOG.tracev( "Building cache for entity data [{0}]", model.getEntity().getName() );
View Full Code Here

Examples of org.hibernate.metamodel.binding.EntityBinding

    this.classLoaderService = serviceRegistry.getService( ClassLoaderService.class );
  }

  @Override
  public void processCallbacksForEntity(Object entityObject, CallbackRegistryImpl callbackRegistry) {
    final EntityBinding entityBinding = (EntityBinding) entityObject;
    final String entityClassName = entityBinding.getEntity().getClassName();
    if ( entityClassName == null ) {
      return;
    }

    try {
View Full Code Here

Examples of org.hibernate.metamodel.binding.EntityBinding

    return entityBindingMap.get( entityName );
  }

  @Override
  public EntityBinding getRootEntityBinding(String entityName) {
    EntityBinding binding = entityBindingMap.get( entityName );
    if ( binding == null ) {
      throw new IllegalStateException( "Unknown entity binding: " + entityName );
    }

    do {
      if ( binding.isRoot() ) {
        return binding;
      }
      binding = binding.getSuperEntityBinding();
    } while ( binding != null );

    throw new AssertionFailure( "Entity binding has no root: " + entityName );
  }
View Full Code Here

Examples of org.hibernate.metamodel.binding.EntityBinding

    return identifierGeneratorFactory;
  }

  @Override
  public org.hibernate.type.Type getIdentifierType(String entityName) throws MappingException {
    EntityBinding entityBinding = getEntityBinding( entityName );
    if ( entityBinding == null ) {
      throw new MappingException( "Entity binding not known: " + entityName );
    }
    return entityBinding
        .getHierarchyDetails()
        .getEntityIdentifier()
        .getValueBinding()
        .getHibernateTypeDescriptor()
        .getResolvedTypeMapping();
View Full Code Here

Examples of org.hibernate.metamodel.binding.EntityBinding

        .getResolvedTypeMapping();
  }

  @Override
  public String getIdentifierPropertyName(String entityName) throws MappingException {
    EntityBinding entityBinding = getEntityBinding( entityName );
    if ( entityBinding == null ) {
      throw new MappingException( "Entity binding not known: " + entityName );
    }
    AttributeBinding idBinding = entityBinding.getHierarchyDetails().getEntityIdentifier().getValueBinding();
    return idBinding == null ? null : idBinding.getAttribute().getName();
  }
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.