Package org.hibernate.type

Examples of org.hibernate.type.AbstractComponentType


    }

    // aliases for composite-id's
    if ( getIdentifierType().isComponentType() ) {
      // Fetch embedded identifiers propertynames from the "virtual" identifier component
      AbstractComponentType componentId = ( AbstractComponentType ) getIdentifierType();
      String[] idPropertyNames = componentId.getPropertyNames();
      String[] idAliases = getIdentifierAliases();
      String[] idColumnNames = getIdentifierColumnNames();

      for ( int i = 0; i < idPropertyNames.length; i++ ) {
        subclassPropertyAliases.put(
View Full Code Here


    }

    if (path!=null) addPropertyPath(path, type, columns, formulaTemplates);

    if ( type.isComponentType() ) {
      AbstractComponentType actype = (AbstractComponentType) type;
      initComponentPropertyPaths( path, actype, columns, formulaTemplates, factory );
      if ( actype.isEmbedded() ) {
        initComponentPropertyPaths(
            path==null ? null : StringHelper.qualifier(path),
            actype,
            columns,
            formulaTemplates,
View Full Code Here

    }

    // aliases for composite-id's
    if ( getIdentifierType().isComponentType() ) {
      // Fetch embedded identifiers propertynames from the "virtual" identifier component
      AbstractComponentType componentId = ( AbstractComponentType ) getIdentifierType();
      String[] idPropertyNames = componentId.getPropertyNames();
      String[] idAliases = getIdentifierAliases();
      String[] idColumnNames = getIdentifierColumnNames();

      for ( int i = 0; i < idPropertyNames.length; i++ ) {
        if ( entityMetamodel.hasNonIdentifierPropertyNamedId() ) {
View Full Code Here

  public TypedValue[] getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery)
  throws HibernateException {
    ArrayList list = new ArrayList();
    Type type = criteriaQuery.getTypeUsingProjection(criteria, propertyName);
    if ( type.isComponentType() ) {
      AbstractComponentType actype = (AbstractComponentType) type;
      Type[] types = actype.getSubtypes();
      for ( int j=0; j<values.length; j++ ) {
        for ( int i=0; i<types.length; i++ ) {
          Object subval = values[j]==null ?
            null :
            actype.getPropertyValues( values[j], EntityMode.POJO )[i];
          list.add( new TypedValue( types[i], subval, EntityMode.POJO ) );
        }
      }
    }
    else {
View Full Code Here

    }

    // aliases for composite-id's
    if ( getIdentifierType().isComponentType() ) {
      // Fetch embedded identifiers propertynames from the "virtual" identifier component
      AbstractComponentType componentId = ( AbstractComponentType ) getIdentifierType();
      String[] idPropertyNames = componentId.getPropertyNames();
      String[] idAliases = getIdentifierAliases();
      String[] idColumnNames = getIdentifierColumnNames();

      for ( int i = 0; i < idPropertyNames.length; i++ ) {
        if ( entityMetamodel.hasNonIdentifierPropertyNamedId() ) {
View Full Code Here

    for ( int i = 0; i < types.length; i++ ) {
      if ( types[i].isCollectionType() ) {
        factory.evictCollection( ( (CollectionType) types[i] ).getRole(), id );
      }
      else if ( types[i].isComponentType() ) {
        AbstractComponentType actype = (AbstractComponentType) types[i];
        evictCachedCollections( actype.getSubtypes(), id, factory );
      }
    }
  }
View Full Code Here


  public void setIdentifier(Object entity, Serializable id) throws HibernateException {
    if ( entityMetamodel.getIdentifierProperty().isEmbedded() ) {
      if ( entity != id ) {
        AbstractComponentType copier = (AbstractComponentType) entityMetamodel.getIdentifierProperty().getType();
        copier.setPropertyValues( entity, copier.getPropertyValues( id, getEntityMode() ), getEntityMode() );
      }
    }
    else if ( idSetter != null ) {
      idSetter.set( entity, id, getFactory() );
    }
    else if ( identifierMapperType != null ) {
      ComponentType extractor = (ComponentType) entityMetamodel.getIdentifierProperty().getType();
      ComponentType copier = (ComponentType) identifierMapperType;
      copier.setPropertyValues( entity, extractor.getPropertyValues( id, getEntityMode() ), getEntityMode() );
    }
  }
View Full Code Here

    }

    // aliases for composite-id's
    if ( getIdentifierType().isComponentType() ) {
      // Fetch embedded identifiers propertynames from the "virtual" identifier component
      AbstractComponentType componentId = ( AbstractComponentType ) getIdentifierType();
      String[] idPropertyNames = componentId.getPropertyNames();
      String[] idAliases = getIdentifierAliases();
      String[] idColumnNames = getIdentifierColumnNames();

      for ( int i = 0; i < idPropertyNames.length; i++ ) {
        if ( entityMetamodel.hasNonIdentifierPropertyNamedId() ) {
View Full Code Here

   
    collectionPropertyColumnAliases.put(aliasName, columnAliases);
    collectionPropertyColumnNames.put(aliasName, columnNames);
 
    if( type.isComponentType() ) {
      AbstractComponentType ct = (AbstractComponentType) type;
      String[] propertyNames = ct.getPropertyNames();
      for (int i = 0; i < propertyNames.length; i++) {
        String name = propertyNames[i];
        collectionPropertyColumnAliases.put( aliasName + "." + name, columnAliases[i] );
        collectionPropertyColumnNames.put( aliasName + "." + name, columnNames[i] );
      }
View Full Code Here

  public TypedValue[] getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery)
  throws HibernateException {
    ArrayList list = new ArrayList();
    Type type = criteriaQuery.getTypeUsingProjection(criteria, propertyName);
    if ( type.isComponentType() ) {
      AbstractComponentType actype = (AbstractComponentType) type;
      Type[] types = actype.getSubtypes();
      for ( int i=0; i<types.length; i++ ) {
        for ( int j=0; j<values.length; j++ ) {
          Object subval = values[j]==null ?
            null :
            actype.getPropertyValues( values[j], EntityMode.POJO )[i];
          list.add( new TypedValue( types[i], subval, EntityMode.POJO ) );
        }
      }
    }
    else {
View Full Code Here

TOP

Related Classes of org.hibernate.type.AbstractComponentType

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.