Package org.hibernate.type

Examples of org.hibernate.type.EmbeddedComponentType


      if ( idClass != null && ! idClass.isInstance( event.getEntityId() ) ) {
        // we may have the kooky jpa requirement of allowing find-by-id where
        // "id" is the "simple pk value" of a dependent objects parent.  This
        // is part of its generally goofy "derived identity" "feature"
        if ( persister.getEntityMetamodel().getIdentifierProperty().isEmbedded() ) {
          final EmbeddedComponentType dependentIdType =
              (EmbeddedComponentType) persister.getEntityMetamodel().getIdentifierProperty().getType();
          if ( dependentIdType.getSubtypes().length == 1 ) {
            final Type singleSubType = dependentIdType.getSubtypes()[0];
            if ( singleSubType.isEntityType() ) {
              final EntityType dependentParentType = (EntityType) singleSubType;
              final Type dependentParentIdType = dependentParentType.getIdentifierOrUniqueKeyType( source.getFactory() );
              if ( dependentParentIdType.getReturnedClass().isInstance( event.getEntityId() ) ) {
                // yep that's what we have...
View Full Code Here


    if ( idClass != null && !idClass.isInstance( event.getEntityId() ) ) {
      // we may have the kooky jpa requirement of allowing find-by-id where
      // "id" is the "simple pk value" of a dependent objects parent.  This
      // is part of its generally goofy "derived identity" "feature"
      if ( persister.getEntityMetamodel().getIdentifierProperty().isEmbedded() ) {
        final EmbeddedComponentType dependentIdType =
            (EmbeddedComponentType) persister.getEntityMetamodel().getIdentifierProperty().getType();
        if ( dependentIdType.getSubtypes().length == 1 ) {
          final Type singleSubType = dependentIdType.getSubtypes()[0];
          if ( singleSubType.isEntityType() ) {
            final EntityType dependentParentType = (EntityType) singleSubType;
            final Type dependentParentIdType = dependentParentType.getIdentifierOrUniqueKeyType( source.getFactory() );
            if ( dependentParentIdType.getReturnedClass().isInstance( event.getEntityId() ) ) {
              // yep that's what we have...
View Full Code Here

  private Type buildType() {
    // TODO : temporary initial step towards HHH-1907
    ComponentMetamodel metamodel = new ComponentMetamodel( this );
    if ( isEmbedded() ) {
      return new EmbeddedComponentType( metamodel );
    }
    else {
      return new ComponentType( metamodel );
    }
  }
View Full Code Here

  private Type buildType() {
    // TODO : temporary initial step towards HHH-1907
    ComponentMetamodel metamodel = new ComponentMetamodel( this );
    if ( isEmbedded() ) {
      return new EmbeddedComponentType( metamodel );
    }
    else {
      return new ComponentType( metamodel );
    }
  }
View Full Code Here

    if ( idClass != null && ! idClass.isInstance( event.getEntityId() ) ) {
      // we may have the kooky jpa requirement of allowing find-by-id where
      // "id" is the "simple pk value" of a dependent objects parent.  This
      // is part of its generally goofy "derived identity" "feature"
      if ( persister.getEntityMetamodel().getIdentifierProperty().isEmbedded() ) {
        final EmbeddedComponentType dependentIdType =
            (EmbeddedComponentType) persister.getEntityMetamodel().getIdentifierProperty().getType();
        if ( dependentIdType.getSubtypes().length == 1 ) {
          final Type singleSubType = dependentIdType.getSubtypes()[0];
          if ( singleSubType.isEntityType() ) {
            final EntityType dependentParentType = (EntityType) singleSubType;
            final Type dependentParentIdType = dependentParentType.getIdentifierOrUniqueKeyType( source.getFactory() );
            if ( dependentParentIdType.getReturnedClass().isInstance( event.getEntityId() ) ) {
              // yep that's what we have...
View Full Code Here

    if ( idClass != null && ! idClass.isInstance( event.getEntityId() ) ) {
      // we may have the kooky jpa requirement of allowing find-by-id where
      // "id" is the "simple pk value" of a dependent objects parent.  This
      // is part of its generally goofy "derived identity" "feature"
      if ( persister.getEntityMetamodel().getIdentifierProperty().isEmbedded() ) {
        final EmbeddedComponentType dependentIdType =
            (EmbeddedComponentType) persister.getEntityMetamodel().getIdentifierProperty().getType();
        if ( dependentIdType.getSubtypes().length == 1 ) {
          final Type singleSubType = dependentIdType.getSubtypes()[0];
          if ( singleSubType.isEntityType() ) {
            final EntityType dependentParentType = (EntityType) singleSubType;
            final Type dependentParentIdType = dependentParentType.getIdentifierOrUniqueKeyType( source.getFactory() );
            if ( dependentParentIdType.getReturnedClass().isInstance( event.getEntityId() ) ) {
              // yep that's what we have...
View Full Code Here

      return Arrays.asList( identifierPropertyName );
    }
    final Type identifierType = sessionFactory.getEntityPersister( entityName ).getIdentifierType();
    if ( identifierType instanceof EmbeddedComponentType ) {
      // Multiple ids.
      final EmbeddedComponentType embeddedComponentType = (EmbeddedComponentType) identifierType;
      return Arrays.asList( embeddedComponentType.getPropertyNames() );
    }
    return Collections.EMPTY_LIST;
  }
View Full Code Here

      if ( idClass != null && ! idClass.isInstance( event.getEntityId() ) ) {
        // we may have the kooky jpa requirement of allowing find-by-id where
        // "id" is the "simple pk value" of a dependent objects parent.  This
        // is part of its generally goofy "derived identity" "feature"
        if ( persister.getEntityMetamodel().getIdentifierProperty().isEmbedded() ) {
          final EmbeddedComponentType dependentIdType =
              (EmbeddedComponentType) persister.getEntityMetamodel().getIdentifierProperty().getType();
          if ( dependentIdType.getSubtypes().length == 1 ) {
            final Type singleSubType = dependentIdType.getSubtypes()[0];
            if ( singleSubType.isEntityType() ) {
              final EntityType dependentParentType = (EntityType) singleSubType;
              final Type dependentParentIdType = dependentParentType.getIdentifierOrUniqueKeyType( source.getFactory() );
              if ( dependentParentIdType.getReturnedClass().isInstance( event.getEntityId() ) ) {
                // yep that's what we have...
View Full Code Here

  private Type buildType() {
    // TODO : temporary initial step towards HHH-1907
    ComponentMetamodel metamodel = new ComponentMetamodel( this );
    if ( isEmbedded() ) {
      return new EmbeddedComponentType( metamodel );
    }
    else {
      return new ComponentType( metamodel );
    }
  }
View Full Code Here

    if ( idClass != null && ! idClass.isInstance( event.getEntityId() ) ) {
      // we may have the kooky jpa requirement of allowing find-by-id where
      // "id" is the "simple pk value" of a dependent objects parent.  This
      // is part of its generally goofy "derived identity" "feature"
      if ( persister.getEntityMetamodel().getIdentifierProperty().isEmbedded() ) {
        final EmbeddedComponentType dependentIdType =
            (EmbeddedComponentType) persister.getEntityMetamodel().getIdentifierProperty().getType();
        if ( dependentIdType.getSubtypes().length == 1 ) {
          final Type singleSubType = dependentIdType.getSubtypes()[0];
          if ( singleSubType.isEntityType() ) {
            final EntityType dependentParentType = (EntityType) singleSubType;
            final Type dependentParentIdType = dependentParentType.getIdentifierOrUniqueKeyType( source.getFactory() );
            if ( dependentParentIdType.getReturnedClass().isInstance( event.getEntityId() ) ) {
              // yep that's what we have...
View Full Code Here

TOP

Related Classes of org.hibernate.type.EmbeddedComponentType

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.