Package org.hibernate.ogm.grid

Examples of org.hibernate.ogm.grid.AssociationKeyMetadata


  private void initAssociationKeyMetadata() {
    for (int index = 0 ; index < getPropertySpan() ; index++) {
      final Type uniqueKeyType = getPropertyTypes()[index];
      if ( uniqueKeyType.isEntityType() ) {
        String[] propertyColumnNames = getPropertyColumnNames( index );
        AssociationKeyMetadata metadata = new AssociationKeyMetadata( getTableName(), propertyColumnNames );
        metadata.setRowKeyColumnNames( buildRowKeyColumnNamesForStarToOne( this, propertyColumnNames ) );
        associationKeyMetadataPerPropertyName.put( getPropertyNames()[index], metadata );
      }
    }
  }
View Full Code Here


    //we get the property type for an associated entity
    final int propertyIndex = getPropertyIndex( propertyName );
    final GridType gridUniqueKeyType = getUniqueKeyTypeFromAssociatedEntity( propertyIndex, propertyName );
    //get the associated property index (to get its column names)
    //find the ids per unique property name
    AssociationKeyMetadata associationKeyMetadata = associationKeyMetadataPerPropertyName.get( propertyName );
    if ( associationKeyMetadata == null ) {
      throw new AssertionFailure( "loadByUniqueKey on a non EntityType:" + propertyName );
    }
    AssociationPersister associationPersister = new AssociationPersister(
          getMappedClass()
View Full Code Here

    }
    else {
      gridTypeOfAssociatedId = null;
      associationType = AssociationType.OTHER;
    }
    associationKeyMetadata = new AssociationKeyMetadata( getTableName(), getKeyColumnNames() );
    associationKeyMetadata.setRowKeyColumnNames( getRowKeyColumnNames() );

    associationKeyMetadataFromElement = new AssociationKeyMetadata( getTableName(), getElementColumnNames() );
    associationKeyMetadataFromElement.setRowKeyColumnNames( getRowKeyColumnNames() );

    nodeName = collection.getNodeName();
  }
View Full Code Here

  private void doAddPropertyMetadata(int tableIndex, int propertyIndex, Object[] newColumnValue) {

    String[] propertyColumnNames = persister.getPropertyColumnNames( propertyIndex );
    String[] rowKeyColumnNames = buildRowKeyColumnNamesForStarToOne( persister, propertyColumnNames );

    AssociationKeyMetadata associationKeyMetadata = new AssociationKeyMetadata( persister.getTableName( tableIndex ), propertyColumnNames );
    associationKeyMetadata.setRowKeyColumnNames( rowKeyColumnNames );

    AssociationPersister associationPersister = new AssociationPersister(
          persister.getPropertyTypes()[propertyIndex].getReturnedClass()
        )
        .hostingEntity( getReferencedEntity( propertyIndex ) )
View Full Code Here

                    int propertyIndex,
                    Object[] oldColumnValue) {
    String[] propertyColumnNames = persister.getPropertyColumnNames( propertyIndex );
    String[] rowKeyColumnNames = buildRowKeyColumnNamesForStarToOne( persister, propertyColumnNames );

    AssociationKeyMetadata associationKeyMetadata = new AssociationKeyMetadata( persister.getTableName( tableIndex ), propertyColumnNames );
    associationKeyMetadata.setRowKeyColumnNames( rowKeyColumnNames );

    AssociationPersister associationPersister = new AssociationPersister(
          persister.getPropertyTypes()[propertyIndex].getReturnedClass()
        )
        .hostingEntity( getReferencedEntity( propertyIndex ) )
View Full Code Here

    String tableName = input.readUTF();
    String[] columnNames = (String[]) input.readObject();
    Object[] values = (Object[]) input.readObject();

    AssociationKeyMetadata associationKeyMetadata = new AssociationKeyMetadata( tableName, columnNames );

    // the engine never accesses deserialized key instances so it's ok to leave the additional attributes
    // null; we should still consider extract these attributes to avoid potential confusion
    return new AssociationKey( associationKeyMetadata, values, null, null, null );
  }
View Full Code Here

    String tableName = input.readUTF();
    String[] columnNames = (String[]) input.readObject();
    Object[] values = (Object[]) input.readObject();

    AssociationKeyMetadata associationKeyMetadata = new AssociationKeyMetadata( tableName, columnNames, null );

    // the engine never accesses deserialized key instances so it's ok to leave the additional attributes
    // null; we should still consider extract these attributes to avoid potential confusion
    return new AssociationKey( associationKeyMetadata, values, null, null, null );
  }
View Full Code Here

    }
    else {
      gridTypeOfAssociatedId = null;
      associationType = AssociationType.OTHER;
    }
    associationKeyMetadata = new AssociationKeyMetadata( getTableName(), getKeyColumnNames() );
    associationKeyMetadata.setRowKeyColumnNames( getRowKeyColumnNames() );

    associationKeyMetadataFromElement = new AssociationKeyMetadata( getTableName(), getElementColumnNames() );
    associationKeyMetadataFromElement.setRowKeyColumnNames( getRowKeyColumnNames() );

    nodeName = collection.getNodeName();
  }
View Full Code Here

  private void initAssociationKeyMetadata() {
    for (int index = 0 ; index < getPropertySpan() ; index++) {
      final Type uniqueKeyType = getPropertyTypes()[index];
      if ( uniqueKeyType.isEntityType() ) {
        String[] propertyColumnNames = getPropertyColumnNames( index );
        AssociationKeyMetadata metadata = new AssociationKeyMetadata( getTableName(), propertyColumnNames );
        metadata.setRowKeyColumnNames( buildRowKeyColumnNamesForStarToOne( this, propertyColumnNames ) );
        associationKeyMetadataPerPropertyName.put( getPropertyNames()[index], metadata );
      }
    }
  }
View Full Code Here

    //we get the property type for an associated entity
    final int propertyIndex = getPropertyIndex( propertyName );
    final GridType gridUniqueKeyType = getUniqueKeyTypeFromAssociatedEntity( propertyIndex, propertyName );
    //get the associated property index (to get its column names)
    //find the ids per unique property name
    AssociationKeyMetadata associationKeyMetadata = associationKeyMetadataPerPropertyName.get( propertyName );
    if ( associationKeyMetadata == null ) {
      throw new AssertionFailure( "loadByUniqueKey on a non EntityType:" + propertyName );
    }
    AssociationPersister associationPersister = new AssociationPersister(
          getMappedClass()
View Full Code Here

TOP

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

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.