Package org.hibernate.type

Examples of org.hibernate.type.ComponentType


      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

      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

   
    String identifierPropertyName = classMetadata.getIdentifierPropertyName();
   
    if (identifierType.isComponentType()) {
     
        ComponentType componentIdentifierType = (ComponentType)identifierType; 
        String[] subPropertyNames = componentIdentifierType.getPropertyNames();
       
       
        Type[] subPropertyTypes = componentIdentifierType.getSubtypes();
       
        propertyClass = new String[subPropertyNames.length];
        type  = new String[subPropertyNames.length];
        scale  = new int[subPropertyNames.length];
        precision = new int[subPropertyNames.length];
        Class subPropertyClass = null;       
       
        for (int j=0; j < subPropertyNames.length; j++){
          subPropertyClass = subPropertyTypes[j].getClass();
         
          if( subPropertyTypes[j].isComponentType() ) {
            ComponentType cType = (ComponentType)subPropertyTypes[j]
            String[] sPropertyNames = cType.getPropertyNames();
            Type[] sTypes = cType.getSubtypes();
            for(int z = 0; z < sPropertyNames.length; z++) {
              identifierPropertyNames.add(identifierPropertyName + "." + subPropertyNames[j] + "."+ sPropertyNames[z]);
              propertyClass[j] = subPropertyClass.getName();
              type[j] = subPropertyTypes[j].getName();
            }
View Full Code Here

    final ArrayList<String> embeddedKeyPropertyIds = new ArrayList<String>();
    final Type identifierType = classMetadata.getIdentifierType();

    if (identifierType.isComponentType())
    {
      final ComponentType idComponent = (ComponentType) identifierType;
      final String[] propertyNameArray = idComponent.getPropertyNames();

      if (propertyNameArray != null)
      {
        final List<String> propertyNames = Arrays.asList(propertyNameArray);
        embeddedKeyPropertyIds.addAll(propertyNames);
View Full Code Here

    if (addedProperties.keySet().contains(propertyId))
      return addedProperties.get(propertyId);

    if (propertyInEmbeddedKey(propertyId))
    {
      final ComponentType idType = (ComponentType) classMetadata.getIdentifierType();
      final String[] propertyNames = idType.getPropertyNames();

      for (int i = 0; i < propertyNames.length; i++)
      {
        String name = propertyNames[i];
        if (name.equals(propertyId))
View Full Code Here

    final Type identifierType = classMetadata.getIdentifierType();

    if (identifierType.isComponentType())
    {
      final ComponentType componentType = (ComponentType) identifierType;
      final String[] idPropertyNames = componentType.getPropertyNames();
      final List<String> idPropertyNameList = Arrays.asList(idPropertyNames);
      return idPropertyNameList.contains(propertyId);
    }

    return false;
View Full Code Here

        if (!sessionFactory.getCurrentSession().contains(pojo))
          pojo = (T) session.get(entityType, (Serializable) getIdForPojo(pojo));

        if (propertyInEmbeddedKey(propertyName))
        {
          final ComponentType identifierType = (ComponentType) classMetadata.getIdentifierType();
          final String[] propertyNames = identifierType.getPropertyNames();

          for (int i = 0; i < propertyNames.length; i++)
          {
            String name = propertyNames[i];

            if (name.equals(propertyName))
            {
              final Object id = classMetadata.getIdentifier(pojo, sessionImplementor);
              return identifierType.getPropertyValue(id, i, EntityMode.POJO);
            }
          }
        }

        final Type propertyType = getPropertyType();
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.