Package org.hibernate.ogm.grid

Examples of org.hibernate.ogm.grid.RowKey


  private Node findNode(EntityKey entityKey) {
    return indexer.findNode( entityKey );
  }

  private void removeAssociationOperation(AssociationKey associationKey, AssociationOperation action) {
    RowKey rowKey = action.getKey();
    Relationship relationship = indexer.findRelationship( relationshipType( associationKey ), rowKey );
    removeRelationship( relationship );
  }
View Full Code Here


    for (int index = 0 ; index < length ; index++ ) {
      columnValuesArray[index] = tuple.get( columnNamesArray[index] );
    }

    return new RowKey( tableName, columnNamesArray, columnValuesArray );
  }
View Full Code Here

    for ( int i = 0; i < columnNames.length; i++ ) {
      String columnName = columnNames[i];
      columnValues[i] = associationKey.getMetadata().isKeyColumn( columnName ) ? associationKey.getColumnValue( columnName ) : accessor.get( row, columnName );
    }

    return new RowKey( table , columnNames, columnValues  );
  }
View Full Code Here

    while ( entries.hasNext() ) {
      Object entry = entries.next();
      if ( collection.needsUpdating( entry, i, elementType ) ) {
        // find the matching element
        RowKey assocEntryKey = getTupleKeyForUpdate( key, collection, session, i, entry );
        Tuple assocEntryTuple = associationPersister.getAssociation().get( assocEntryKey );
        if ( assocEntryTuple == null ) {
          throw new AssertionFailure( "Updating a collection tuple that is not present: " + "table {" + getTableName() + "} collectionKey {" + key + "} entry {" + entry + "}" );
        }
        // update the matching element
View Full Code Here

      if ( deletes.hasNext() ) {
        int count = 0;
        while ( deletes.hasNext() ) {
          Object entry = deletes.next();
          // find the matching element
          RowKey assocEntryKey = getTupleKeyForDelete( id, collection, session, entry, deleteByIndex );
          Tuple assocEntryTuple = associationPersister.getAssociation().get( assocEntryKey );
          if ( assocEntryTuple == null ) {
            throw new AssertionFailure( "Deleting a collection tuple that is not present: " + "table {" + getTableName() + "} collectionKey {" + id + "} entry {" + entry + "}" );
          }
          // delete the tuple
View Full Code Here

              propertyColumnNames,
              includeColumns[propertyIndex],
              session
          );
    Object[] columnValues = LogicalPhysicalConverterHelper.getColumnValuesFromResultset( tuple, rowKeyColumnNames );
    final RowKey rowKey = new RowKey( persister.getTableName(), rowKeyColumnNames, columnValues );

    Tuple assocEntryTuple = associationPersister.createAndPutAssociationTuple( rowKey );
    for ( String column : tuple.getColumnNames() ) {
      assocEntryTuple.put( column, tuple.get( column ) );
    }
View Full Code Here

    Association propertyValues = associationPersister.getAssociation();
    if ( propertyValues != null ) {
      //Map's equals operation delegates to all it's key and value, should be fine for now
      //this is a StarToOne case ie the FK is on the owning entity
      final RowKey matchingTuple = new RowKeyBuilder()
          .tableName( persister.getTableName() )
          .addColumns( buildRowKeyColumnNamesForStarToOne( persister, propertyColumnNames ) )
          .values( tupleKey )
          .build();
      //TODO what should we do if that's null?
View Full Code Here

              propertyColumnNames,
              includeColumns[propertyIndex],
              session
          );
    Object[] columnValues = LogicalPhysicalConverterHelper.getColumnValuesFromResultset(tuple, rowKeyColumnNames);
    final RowKey rowKey = new RowKey( persister.getTableName(), rowKeyColumnNames, columnValues );

    Tuple assocEntryTuple = metadataProvider.createAndPutAssociationTuple( rowKey );
    for ( String column : tuple.getColumnNames() ) {
      assocEntryTuple.put(column, tuple.get(column) );
    }
View Full Code Here

    Association propertyValues = metadataProvider.getCollectionMetadata();
    if ( propertyValues != null ) {
      //Map's equals operation delegates to all it's key and value, should be fine for now
      //this is a StarToOne case ie the FK is on the owning entity
      final RowKey matchingTuple = new RowKeyBuilder()
          .tableName( persister.getTableName() )
          .addColumns( buildRowKeyColumnNamesForStarToOne( persister, propertyColumnNames ) )
          .values( tupleKey )
          .build();
      //TODO what should we do if that's null?
View Full Code Here

  public IntegralDataTypeHolder doWorkInCurrentTransactionIfAny(SessionImplementor session) {
    defineGridTypes( session );
    final Object segmentColumnValue = nullSafeSet(
        segmentGridType, segmentValue, segmentColumnName, session
    );
    RowKey key = new RowKey(
        tableName,
        new String[] { segmentColumnName },
        new Object[] { segmentColumnValue }
    );
View Full Code Here

TOP

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

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.