Package org.hibernate.ogm.grid

Examples of org.hibernate.ogm.grid.RowKey


    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


        //otherwise read it from the database structure
        if ( getFromMongoData == true ) {
          columnValues.add( mongodbColumnData.get( columnKey ) );
        }
      }
      RowKey rowKey = new RowKey(
          key.getTable(),
          columnNames.toArray( new String[columnNames.size()] ),
          columnValues.toArray() );
      //Stock database structure per RowKey
      this.map.put( rowKey, row );
View Full Code Here

  @Override
  public Set<RowKey> getRowKeys() {
    Set<RowKey> rowKeys = new HashSet<RowKey>( associationMap.size() );

    for ( SerializableKey key : associationMap.keySet() ) {
      rowKeys.add( new RowKey( key.getTable(), key.getColumnNames(), key.getColumnValues() ) );
    }

    return rowKeys;
  }
View Full Code Here

        //otherwise read it from the database structure
        if ( getFromMongoData == true ) {
          columnValues.add( mongodbColumnData.get( columnKey ) );
        }
      }
      RowKey rowKey = new RowKey(
          key.getTable(),
          columnNames.toArray( new String[columnNames.size()] ),
          columnValues.toArray() );
      //Stock database structure per RowKey
      this.map.put( rowKey, row );
View Full Code Here

      query = assocSnapshot.getQueryObject();
      associationField = ROWS_FIELDNAME;
    }

    for ( AssociationOperation action : association.getOperations() ) {
      RowKey rowKey = action.getKey();
      Tuple rowValue = action.getValue();

      DBObject update = null;

      switch ( action.getType() ) {
View Full Code Here

  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

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

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

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

    return new RowKey( tableName, columnNames, values );
  }
View Full Code Here

      if ( collection.needsUpdating( entry, i, elementType ) ) {
        //get the tuple Key
        Map<String, Object> tupleKey = getTupleKeyForUpdate( key, collection, session, i, entry );

        //find the matching element
        RowKey matchingTupleKey = metadataProvider.findMatchingTuple( tupleKey );
        if ( matchingTupleKey == null ) {
          throw new AssertionFailure( "Updating a collection tuple that is not present: " +
              "table {" + getTableName() + "} collectionKey {" + key + "} entry {" + entry + "}" );
        }
        //copy on read to avoid concurrent transactions issues
View Full Code Here

          final Map<String, Object> tupleKey = getTupleKeyForDelete(
              id, collection, session, entry, deleteByIndex
          );

          //find the matching element
          RowKey matchingTupleKey = metadataProvider.findMatchingTuple( tupleKey );
          if ( matchingTupleKey == null ) {
            throw new AssertionFailure( "Deleting a collection tuple that is not present: " +
                "table {" + getTableName() + "} collectionKey {" + id + "} entry {" + entry + "}" );
          }
          Map<String,Object> matchingTuple = metadataProvider.getCollectionMetadata().get( matchingTupleKey );
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.