Package org.hibernate.type

Examples of org.hibernate.type.ComponentType


  }

  private Type embeddedPropertyType(List<String> propertyPath, ComponentType propertyType) {
    Type subType = propertyType;
    for ( int i = 1; i < propertyPath.size(); i++ ) {
      ComponentType componentType = (ComponentType) subType;
      String name = propertyPath.get( i );
      int propertyIndex = componentType.getPropertyIndex( name );
      subType = componentType.getSubtypes()[propertyIndex];
      if ( subType.isAnyType() || subType.isAssociationType() || subType.isEntityType() ) {
        throw new UnsupportedOperationException( "Queries on associated entities are not supported yet." );
      }
    }
    return subType;
View Full Code Here


      if ( idGetter == null ) {
        if (identifierMapperType==null) {
          throw new HibernateException( "The class has no identifier property: " + getEntityName() );
        }
        else {
          ComponentType copier = (ComponentType) entityMetamodel.getIdentifierProperty().getType();
          id = copier.instantiate( getEntityMode() );
          copier.setPropertyValues( id, identifierMapperType.getPropertyValues( entity, getEntityMode() ), getEntityMode() );
        }
      }
      else {
        id = idGetter.get( entity );
      }
View Full Code Here

      propertyPath.substring(0, loc) : propertyPath;
     
    int index = entityMetamodel.getPropertyIndex( basePropertyName );
    Object baseValue = getPropertyValue( entity, index );
    if ( loc>0 ) {
      ComponentType type = (ComponentType) entityMetamodel.getPropertyTypes()[index];
      return getComponentValue( type, baseValue, propertyPath.substring(loc+1) );
    }
    else {
      return baseValue;
    }
View Full Code Here

    }
   
    Object baseValue = type.getPropertyValue( component, index, getEntityMode() );
   
    if ( loc>0 ) {
      ComponentType subtype = (ComponentType) type.getSubtypes()[index];
      return getComponentValue( subtype, baseValue, propertyPath.substring(loc+1) );
    }
    else {
      return baseValue;
    }
View Full Code Here

        );
        processingState.registerIdentifierHydratedForm( entityKey.getIdentifier() );
        processingState.registerEntityKey( entityKey );
        final EntityPersister entityPersister = processingState.getEntityReference().getEntityPersister();
        if ( entityPersister.getIdentifierType().isComponentType()  ) {
          final ComponentType identifierType = (ComponentType) entityPersister.getIdentifierType();
          if ( !identifierType.isEmbedded() ) {
            addKeyManyToOnesToSession(
                context,
                identifierType,
                entityKey.getIdentifier()
            );
View Full Code Here

    this.persister = persister;
    if ( !persister.getElementType().isComponentType() ) {
      throw new IllegalArgumentException( "persister for role " + persister.getRole() + " is not a collection-of-component" );
    }

    ComponentType componentType = (ComponentType) persister.getElementType();
    String[] names = componentType.getPropertyNames();
    Type[] types = componentType.getSubtypes();

    for ( int i = 0; i < names.length; i++ ) {
      subTypes.put( names[i], types[i] );
    }
View Full Code Here

      if ( idGetter == null ) {
        if (identifierMapperType==null) {
          throw new HibernateException( "The class has no identifier property: " + getEntityName() );
        }
        else {
          ComponentType copier = (ComponentType) entityMetamodel.getIdentifierProperty().getType();
          id = copier.instantiate( getEntityMode() );
          copier.setPropertyValues( id, identifierMapperType.getPropertyValues( entity, getEntityMode() ), getEntityMode() );
        }
      }
      else {
        id = idGetter.get( entity );
      }
View Full Code Here

      propertyPath.substring(0, loc) : propertyPath;
     
    int index = entityMetamodel.getPropertyIndex( basePropertyName );
    Object baseValue = getPropertyValue( entity, index );
    if ( loc>0 ) {
      ComponentType type = (ComponentType) entityMetamodel.getPropertyTypes()[index];
      return getComponentValue( type, baseValue, propertyPath.substring(loc+1) );
    }
    else {
      return baseValue;
    }
View Full Code Here

    }
   
    Object baseValue = type.getPropertyValue( component, index, getEntityMode() );
   
    if ( loc>0 ) {
      ComponentType subtype = (ComponentType) type.getSubtypes()[index];
      return getComponentValue( subtype, baseValue, propertyPath.substring(loc+1) );
    }
    else {
      return baseValue;
    }
View Full Code Here

      if ( idGetter == null ) {
        if (identifierMapperType==null) {
          throw new HibernateException( "The class has no identifier property: " + getEntityName() );
        }
        else {
          ComponentType copier = (ComponentType) entityMetamodel.getIdentifierProperty().getType();
          id = copier.instantiate( getEntityMode() );
          copier.setPropertyValues( id, identifierMapperType.getPropertyValues( entity, getEntityMode() ), getEntityMode() );
        }
      }
      else {
        id = idGetter.get( entity );
      }
View Full Code Here

TOP

Related Classes of org.hibernate.type.ComponentType

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.