Package org.hibernate.ogm.grid

Examples of org.hibernate.ogm.grid.AssociationKind


  private AssociationKey getAssociationKey() {
    if ( associationKey == null ) {
      final Object[] columnValues = getKeyColumnValues();
      String collectionRole = null;
      EntityKey ownerEntityKey = null;
      AssociationKind associationKind = null;

      // We have a collection on the main side
      if (collectionPersister != null) {
        EntityKey entityKey;
        // we are explicitly looking to update the non owning side
        if ( inverse ) {
          //look for the other side of the collection, build the key of the other side's entity
          OgmEntityPersister elementPersister = (OgmEntityPersister) collectionPersister.getElementPersister();
          entityKey = EntityKeyBuilder.fromPersister(
              elementPersister,
              (Serializable) key,
              session
          );
          collectionRole = buildCollectionRole( collectionPersister );
        }
        else {
          //we are on the right side, use the association property
          collectionRole = getUnqualifiedRole( collectionPersister );
          entityKey = EntityKeyBuilder.fromPersister(
              (OgmEntityPersister) collectionPersister.getOwnerEntityPersister(),
              (Serializable) key,
              session
          );
        }
        ownerEntityKey = entityKey;
        //TODO add information on the collection type, set, map, bag, list etc

        AssociationKind type = collectionPersister.getElementType().isEntityType() ? AssociationKind.ASSOCIATION : AssociationKind.EMBEDDED_COLLECTION;
        associationKind = type;
      }
      // We have a to-one on the main side
      else if ( propertyType != null ) {
        associationKind = propertyType.isEntityType() ? AssociationKind.ASSOCIATION : AssociationKind.EMBEDDED_COLLECTION;
View Full Code Here


          );
        }
        collectionMetadataKey.setOwnerEntityKey( entityKey );
        //TODO add information on the collection type, set, map, bag, list etc

        AssociationKind type = collectionPersister.getElementType().isEntityType() ? AssociationKind.ASSOCIATION : AssociationKind.EMBEDDED;
        collectionMetadataKey.setAssociationKind( type );
        collectionMetadataKey.setRowKeyColumnNames( collectionPersister.getRowKeyColumnNames() );
      }
      // We have a to-one on the main side
      else if ( propertyType != null ) {
View Full Code Here

  private AssociationKey getAssociationKey() {
    if ( associationKey == null ) {
      final Object[] columnValues = getKeyColumnValues();
      String collectionRole = null;
      EntityKey ownerEntityKey = null;
      AssociationKind associationKind = null;

      // We have a collection on the main side
      if (collectionPersister != null) {
        EntityKey entityKey;
        // we are explicitly looking to update the non owning side
        if ( inverse ) {
          //look for the other side of the collection, build the key of the other side's entity
          OgmEntityPersister elementPersister = (OgmEntityPersister) collectionPersister.getElementPersister();
          entityKey = EntityKeyBuilder.fromPersister(
              elementPersister,
              (Serializable) key,
              session
          );
          collectionRole = buildCollectionRole( collectionPersister );
        }
        else {
          //we are on the right side, use the association property
          collectionRole = getUnqualifiedRole( collectionPersister );
          entityKey = EntityKeyBuilder.fromPersister(
              (OgmEntityPersister) collectionPersister.getOwnerEntityPersister(),
              (Serializable) key,
              session
          );
        }
        ownerEntityKey = entityKey;
        //TODO add information on the collection type, set, map, bag, list etc

        AssociationKind type = collectionPersister.getElementType().isEntityType() ? AssociationKind.ASSOCIATION : AssociationKind.EMBEDDED_COLLECTION;
        associationKind = type;
      }
      // We have a to-one on the main side
      else if ( propertyType != null ) {
        associationKind = propertyType.isEntityType() ? AssociationKind.ASSOCIATION : AssociationKind.EMBEDDED_COLLECTION;
View Full Code Here

  private AssociationKey getAssociationKey() {
    if ( associationKey == null ) {
      final Object[] columnValues = getKeyColumnValues();
      String collectionRole = null;
      EntityKey ownerEntityKey = null;
      AssociationKind associationKind = null;

      // We have a collection on the main side
      if (collectionPersister != null) {
        EntityKey entityKey;
        // we are explicitly looking to update the non owning side
        if ( inverse ) {
          //look for the other side of the collection, build the key of the other side's entity
          OgmEntityPersister elementPersister = (OgmEntityPersister) collectionPersister.getElementPersister();
          entityKey = EntityKeyBuilder.fromPersister(
              elementPersister,
              (Serializable) key,
              session
          );
          collectionRole = buildCollectionRole( collectionPersister );
        }
        else {
          //we are on the right side, use the association property
          collectionRole = getUnqualifiedRole( collectionPersister );
          entityKey = EntityKeyBuilder.fromPersister(
              (OgmEntityPersister) collectionPersister.getOwnerEntityPersister(),
              (Serializable) key,
              session
          );
        }
        ownerEntityKey = entityKey;
        //TODO add information on the collection type, set, map, bag, list etc

        AssociationKind type = collectionPersister.getElementType().isEntityType() ? AssociationKind.ASSOCIATION : AssociationKind.EMBEDDED_COLLECTION;
        associationKind = type;
      }
      // We have a to-one on the main side
      else if ( propertyType != null ) {
        associationKind = propertyType.isEntityType() ? AssociationKind.ASSOCIATION : AssociationKind.EMBEDDED_COLLECTION;
View Full Code Here

          );
        }
        collectionMetadataKey.setOwnerEntityKey( entityKey );
        //TODO add information on the collection type, set, map, bag, list etc

        AssociationKind type = collectionPersister.getElementType().isEntityType() ? AssociationKind.ASSOCIATION : AssociationKind.EMBEDDED;
        collectionMetadataKey.setAssociationKind( type );
      }
      // We have a to-one on the main side
      else if ( propertyType != null ) {
        collectionMetadataKey.setAssociationKind( propertyType.isEntityType() ? AssociationKind.ASSOCIATION : AssociationKind.EMBEDDED );
View Full Code Here

  private AssociationKey getAssociationKey() {
    if ( associationKey == null ) {
      final Object[] columnValues = getKeyColumnValues();
      String collectionRole = null;
      EntityKey ownerEntityKey = null;
      AssociationKind associationKind = null;

      // We have a collection on the main side
      if (collectionPersister != null) {
        EntityKey entityKey;
        // we are explicitly looking to update the non owning side
        if ( inverse ) {
          //look for the other side of the collection, build the key of the other side's entity
          OgmEntityPersister elementPersister = (OgmEntityPersister) collectionPersister.getElementPersister();
          entityKey = EntityKeyBuilder.fromPersister(
              elementPersister,
              (Serializable) key,
              session
          );
          collectionRole = buildCollectionRole( collectionPersister );
        }
        else {
          //we are on the right side, use the association property
          collectionRole = getUnqualifiedRole( collectionPersister );
          entityKey = EntityKeyBuilder.fromPersister(
              (OgmEntityPersister) collectionPersister.getOwnerEntityPersister(),
              (Serializable) key,
              session
          );
        }
        ownerEntityKey = entityKey;
        //TODO add information on the collection type, set, map, bag, list etc

        AssociationKind type = collectionPersister.getElementType().isEntityType() ? AssociationKind.ASSOCIATION : AssociationKind.EMBEDDED_COLLECTION;
        associationKind = type;
      }
      // We have a to-one on the main side
      else if ( propertyType != null ) {
        associationKind = propertyType.isEntityType() ? AssociationKind.ASSOCIATION : AssociationKind.EMBEDDED_COLLECTION;
View Full Code Here

TOP

Related Classes of org.hibernate.ogm.grid.AssociationKind

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.