Package org.hibernate.engine.spi

Examples of org.hibernate.engine.spi.IdentifierValue


      IdentifierGenerator generator) {
    String mappedUnsavedValue = mappedEntity.getIdentifier().getNullValue();
    Type type = mappedEntity.getIdentifier().getType();
    Property property = mappedEntity.getIdentifierProperty();
   
    IdentifierValue unsavedValue = UnsavedValueFactory.getUnsavedIdentifierValue(
        mappedUnsavedValue,
        getGetter( property ),
        type,
        getConstructor(mappedEntity)
      );
View Full Code Here


    //    see org.hibernate.metamodel.domain.AbstractAttributeContainer.locateOrCreateVirtualAttribute()

    final String mappedUnsavedValue = property.getUnsavedValue();
    final Type type = property.getHibernateTypeDescriptor().getResolvedTypeMapping();

    IdentifierValue unsavedValue = UnsavedValueFactory.getUnsavedIdentifierValue(
        mappedUnsavedValue,
        getGetter( property ),
        type,
        getConstructor( mappedEntity )
      );
View Full Code Here

      Constructor constructor) {
    if ( unsavedValue == null ) {
      if ( identifierGetter != null && constructor != null ) {
        // use the id value of a newly instantiated instance as the unsaved-value
        final Serializable defaultValue = (Serializable) identifierGetter.get( instantiate( constructor ) );
        return new IdentifierValue( defaultValue );
      }
      else if ( identifierGetter != null && (identifierType instanceof PrimitiveType) ) {
        final Serializable defaultValue = ( (PrimitiveType) identifierType ).getDefaultValue();
        return new IdentifierValue( defaultValue );
      }
      else {
        return IdentifierValue.NULL;
      }
    }
    else if ( "null".equals( unsavedValue ) ) {
      return IdentifierValue.NULL;
    }
    else if ( "undefined".equals( unsavedValue ) ) {
      return IdentifierValue.UNDEFINED;
    }
    else if ( "none".equals( unsavedValue ) ) {
      return IdentifierValue.NONE;
    }
    else if ( "any".equals( unsavedValue ) ) {
      return IdentifierValue.ANY;
    }
    else {
      try {
        return new IdentifierValue( (Serializable) ( (IdentifierType) identifierType ).stringToObject( unsavedValue ) );
      }
      catch ( ClassCastException cce ) {
        throw new MappingException( "Bad identifier type: " + identifierType.getName() );
      }
      catch ( Exception e ) {
View Full Code Here

   
    if ( unsavedValue == null ) {
      if ( identifierGetter!=null && constructor!=null ) {
        // use the id value of a newly instantiated instance as the unsaved-value
        Serializable defaultValue = (Serializable) identifierGetter.get( instantiate(constructor) );
        return new IdentifierValue( defaultValue );
      }
      else if ( identifierGetter != null && (identifierType instanceof PrimitiveType) ) {
        Serializable defaultValue = ( ( PrimitiveType ) identifierType ).getDefaultValue();
        return new IdentifierValue( defaultValue );
      }
      else {
        return IdentifierValue.NULL;
      }
    }
    else if ( "null".equals( unsavedValue ) ) {
      return IdentifierValue.NULL;
    }
    else if ( "undefined".equals( unsavedValue ) ) {
      return IdentifierValue.UNDEFINED;
    }
    else if ( "none".equals( unsavedValue ) ) {
      return IdentifierValue.NONE;
    }
    else if ( "any".equals( unsavedValue ) ) {
      return IdentifierValue.ANY;
    }
    else {
      try {
        return new IdentifierValue( ( Serializable ) ( ( IdentifierType ) identifierType ).stringToObject( unsavedValue ) );
      }
      catch ( ClassCastException cce ) {
        throw new MappingException( "Bad identifier type: " + identifierType.getName() );
      }
      catch ( Exception e ) {
View Full Code Here

    String mappedUnsavedValue = mappedEntity.getIdentifier().getNullValue();
    Type type = mappedEntity.getIdentifier().getType();
    Property property = mappedEntity.getIdentifierProperty();
   
    IdentifierValue unsavedValue = UnsavedValueFactory.getUnsavedIdentifierValue(
        mappedUnsavedValue,
        getGetter( property ),
        type,
        getConstructor(mappedEntity)
      );
View Full Code Here

    //    see org.hibernate.metamodel.domain.AbstractAttributeContainer.locateOrCreateVirtualAttribute()

    final String mappedUnsavedValue = property.getUnsavedValue();
    final Type type = property.getHibernateTypeDescriptor().getResolvedTypeMapping();

    IdentifierValue unsavedValue = UnsavedValueFactory.getUnsavedIdentifierValue(
        mappedUnsavedValue,
        getGetter( property ),
        type,
        getConstructor( mappedEntity )
      );
View Full Code Here

    String mappedUnsavedValue = mappedEntity.getIdentifier().getNullValue();
    Type type = mappedEntity.getIdentifier().getType();
    Property property = mappedEntity.getIdentifierProperty();
   
    IdentifierValue unsavedValue = UnsavedValueFactory.getUnsavedIdentifierValue(
        mappedUnsavedValue,
        getGetter( property ),
        type,
        getConstructor(mappedEntity)
      );
View Full Code Here

      IdentifierGenerator generator) {
    String mappedUnsavedValue = mappedEntity.getIdentifier().getNullValue();
    Type type = mappedEntity.getIdentifier().getType();
    Property property = mappedEntity.getIdentifierProperty();
   
    IdentifierValue unsavedValue = UnsavedValueFactory.getUnsavedIdentifierValue(
        mappedUnsavedValue,
        getGetter( property ),
        type,
        getConstructor(mappedEntity)
      );
View Full Code Here

    //    see org.hibernate.metamodel.domain.AbstractAttributeContainer.locateOrCreateVirtualAttribute()

    final String mappedUnsavedValue = property.getUnsavedValue();
    final Type type = property.getHibernateTypeDescriptor().getResolvedTypeMapping();

    IdentifierValue unsavedValue = UnsavedValueFactory.getUnsavedIdentifierValue(
        mappedUnsavedValue,
        getGetter( property ),
        type,
        getConstructor( mappedEntity )
      );
View Full Code Here

    String mappedUnsavedValue = mappedEntity.getIdentifier().getNullValue();
    Type type = mappedEntity.getIdentifier().getType();
    Property property = mappedEntity.getIdentifierProperty();
   
    IdentifierValue unsavedValue = UnsavedValueFactory.getUnsavedIdentifierValue(
        mappedUnsavedValue,
        getGetter( property ),
        type,
        getConstructor(mappedEntity)
      );
View Full Code Here

TOP

Related Classes of org.hibernate.engine.spi.IdentifierValue

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.