Package org.hibernate.type

Examples of org.hibernate.type.AbstractComponentType


    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 CascadeStyle getCascadeStyle() throws MappingException {
    Type type = value.getType();
    if ( type.isComponentType() && !type.isAnyType() ) {
      AbstractComponentType actype = (AbstractComponentType) type;
      int length = actype.getSubtypes().length;
      for ( int i=0; i<length; i++ ) {
        if ( actype.getCascadeStyle(i)!=CascadeStyle.NONE ) return CascadeStyle.ALL;
      }
      return CascadeStyle.NONE;
    }
    else if ( cascade==null || cascade.equals("none") ) {
      return CascadeStyle.NONE;
View Full Code Here

      CollectionType collectionType = (CollectionType) propertyType;
      Type collectionElementType = collectionType.getElementType( session.getFactory() );
      if ( collectionElementType.isComponentType() ) {
        //check for all components values in the collection

        AbstractComponentType componentType = (AbstractComponentType) collectionElementType;
        Iterator iter = CascadingAction.getLoadedElementsIterator(session, collectionType, value);
        while ( iter.hasNext() ) {
          Object compValue = iter.next();
          if (compValue != null) {
            return checkComponentNullability(compValue, componentType);
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() );
    }
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 CascadeStyle getCascadeStyle() throws MappingException {
    Type type = value.getType();
    if ( type.isComponentType() && !type.isAnyType() ) {
      AbstractComponentType actype = (AbstractComponentType) type;
      int length = actype.getSubtypes().length;
      for ( int i=0; i<length; i++ ) {
        if ( actype.getCascadeStyle(i)!=CascadeStyle.NONE ) return CascadeStyle.ALL;
      }
      return CascadeStyle.NONE;
    }
    else if ( cascade==null || cascade.equals("none") ) {
      return CascadeStyle.NONE;
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

      }
      else if ( type.isAnyType() ) {
        return isNullifiable(null, value) ? null : value;
      }
      else if ( type.isComponentType() ) {
        AbstractComponentType actype = (AbstractComponentType) type;
        Object[] subvalues = actype.getPropertyValues(value, session);
        Type[] subtypes = actype.getSubtypes();
        boolean substitute = false;
        for ( int i = 0; i < subvalues.length; i++ ) {
          Object replacement = nullifyTransientReferences( subvalues[i], subtypes[i] );
          if ( replacement != subvalues[i] ) {
            substitute = true;
            subvalues[i] = replacement;
          }
        }
        if (substitute) actype.setPropertyValues( value, subvalues, session.getEntityMode() );
        return value;
      }
      else {
        return value;
      }
View Full Code Here

      CollectionType collectionType = (CollectionType) propertyType;
      Type collectionElementType = collectionType.getElementType( session.getFactory() );
      if ( collectionElementType.isComponentType() ) {
        //check for all components values in the collection

        AbstractComponentType componentType = (AbstractComponentType) collectionElementType;
        Iterator iter = CascadingAction.getLoadedElementsIterator(session, collectionType, value);
        while ( iter.hasNext() ) {
          Object compValue = iter.next();
          if (compValue != null) {
            return checkComponentNullability(compValue, componentType);
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.