Examples of RowKey


Examples of org.hibernate.ogm.grid.RowKey

          .key( entityId )
          .inverse();

      // TODO what happens when a row should be *updated* ?: I suspect ADD works OK as it's a put()
      if ( action == Action.ADD ) {
        RowKey inverseRowKey = updateRowKeyEntityKey( rowKey, associationPersister );
        Tuple assocTuple = associationPersister.createAndPutAssociationTuple( inverseRowKey );
        for ( String columnName : tuple.getColumnNames() ) {
          assocTuple.put( columnName, tuple.get( columnName ) );
        }
        associationPersister.getAssociation().put( inverseRowKey, assocTuple );
      }
      else if ( action == Action.REMOVE ) {
        // we try and match the whole tuple as it should be on both sides of the navigation
        if ( rowKey == null ) {
          throw new AssertionFailure( "Deleting a collection tuple that is not present: " + "table {"
              + getTableName() + "} key column names {" + Arrays.toString( elementColumnNames )
              + "} key column values {" + Arrays.toString( elementColumnValues ) + "}" );
        }
        RowKey inverseRowKey = updateRowKeyEntityKey( rowKey, associationPersister );
        associationPersister.getAssociation().remove( inverseRowKey );
      }
      else {
        throw new AssertionFailure( "Unknown action type: " + action );
      }
View Full Code Here

Examples of org.hibernate.ogm.grid.RowKey

    }
  }

  private RowKey updateRowKeyEntityKey(RowKey rowKey, AssociationPersister associationPersister) {
    EntityKey targetKey = associationPersister.createTargetKey( rowKey.getColumnNames(), rowKey.getColumnValues() );
    return new RowKey( rowKey.getTable(), rowKey.getColumnNames(), rowKey.getColumnValues(), targetKey );
  }
View Full Code Here

Examples of org.hibernate.ogm.grid.RowKey

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

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

Examples of org.hibernate.ogm.grid.RowKey

  private final Map<RowKey, Tuple> tuples = new HashMap<RowKey, Tuple>();

  public Neo4jAssociationSnapshot(Node ownerNode, AssociationKey associationKey) {
    for ( Relationship relationship : relationships( ownerNode, associationKey ) ) {
      RowKey rowKey = convert( associationKey, relationship );
      Tuple tuple = new Tuple( new Neo4jTupleSnapshot( relationship ) );
      tuples.put( rowKey, tuple );
    }
  }
View Full Code Here

Examples of org.hibernate.ogm.grid.RowKey

      if ( container.hasProperty( columnName ) ) {
        values[i] = container.getProperty( columnName );
      }
    }

    return new RowKey( associationKey.getTable(), columnNames, values );
  }
View Full Code Here

Examples of org.hibernate.ogm.grid.RowKey

  private final Map<RowKey, Tuple> tuples = new HashMap<RowKey, Tuple>();

  public Neo4jAssociationSnapshot(Node ownerNode, AssociationKey associationKey) {
    for ( Relationship relationship : relationships( ownerNode, associationKey ) ) {
      RowKey rowKey = convert( associationKey, relationship );
      Tuple tuple = new Tuple( new Neo4jTupleSnapshot( relationship ) );
      tuples.put( rowKey, tuple );
    }
  }
View Full Code Here

Examples of org.hibernate.ogm.grid.RowKey

      if ( container.hasProperty( columnName ) ) {
        values[i] = container.getProperty( columnName );
      }
    }

    return new RowKey( associationKey.getTable(), columnNames, values );
  }
View Full Code Here

Examples of org.hibernate.ogm.grid.RowKey

      break;
    }
  }

  private void putAssociationOperation(AssociationKey associationKey, AssociationOperation action) {
    RowKey rowKey = action.getKey();
    Relationship relationship = createRelationshipUnlessExists( findNode( associationKey.getEntityKey() ), associationKey, rowKey );
    applyTupleOperations( relationship.getEndNode(), action.getValue().getOperations() );
  }
View Full Code Here

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

Examples of org.hibernate.ogm.grid.RowKey

      if ( container.hasProperty( columnName ) ) {
        values[i] = container.getProperty( columnName );
      }
    }

    return new RowKey( associationKey.getTable(), columnNames, values );
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.