Package org.hibernate.ogm.grid

Examples of org.hibernate.ogm.grid.RowKey


      while ( entries.hasNext() ) {
        Object entry = entries.next();
        if ( collection.needsInserting( entry, i, elementType ) ) {
          //TODO: copy/paste from recreate()
          final Map<String, Object> newTupleId = buildTupleForInsert( id, collection, session, i, entry );
          RowKey key = buildRowKey( newTupleId );
          final Map<String, Object> newTuple = completeTuple( newTupleId, collection, session, entry );
          metadataProvider.getCollectionMetadata().put( key, newTuple );
          updateInverseSideOfAssociationNavigation( session, newTuple, Action.ADD, key );
          collection.afterRowInsert( this, entry, i );
          count++;
View Full Code Here


        while ( entries.hasNext() ) {
          final Object entry = entries.next();
          if ( collection.entryExists( entry, i ) ) {
            //TODO: copy/paste from insertRows()
            final Map<String, Object> newTupleId = buildTupleForInsert( id, collection, session, i, entry );
            RowKey key = buildRowKey( newTupleId );
            final Map<String, Object> newTuple = completeTuple( newTupleId, collection, session, entry );
            metadataProvider.getCollectionMetadata().put( key, newTuple );
            updateInverseSideOfAssociationNavigation( session, newTuple, Action.ADD, key );
            collection.afterRowInsert( this, entry, i );
            count++;
View Full Code Here

    final int length = columnNamesArray.length;
    Object[] columnValuesArray = new Object[length];
    for (int index = 0 ; index < length ; index++ ) {
      columnValuesArray[index] = values.get( columnNamesArray[index] );
    }
    return new RowKey( tableName, columnNamesArray, columnValuesArray );
  }
View Full Code Here

              persister.getPropertyColumnNames( propertyIndex ),
              includeColumns[propertyIndex],
              session
          );
    Object[] columnValues = LogicalPhysicalConverterHelper.getColumnValuesFromResultset(tuple, identifierColumnNames);
    final RowKey rowKey = new RowKey( persister.getTableName(), identifierColumnNames, columnValues );
    propertyValues.put( rowKey, tuple );
    metadataProvider.flushToCache();
  }
View Full Code Here

        .tableName( persister.getTableName( tableIndex ) );
    Map<String,Object> idTuple = getTupleKey();
    Map<RowKey,Map<String,Object>> propertyValues = metadataProvider.getCollectionMetadata();
    if ( propertyValues != null ) {
      //Map's equals operation delegates to all it's key and value, should be fine for now
      final RowKey matchingTuple = metadataProvider.findMatchingTuple( idTuple );
      //TODO what should we do if that's null?
      if (matchingTuple != null) {
        metadataProvider.getCollectionMetadata().remove( matchingTuple );
      }
      metadataProvider.flushToCache();
View Full Code Here

        GridMetadataManagerHelper.getIdentifierCache( gridManager ).getAdvancedCache();
    final Map<String, Object> tuple = new HashMap<String, Object>( 1 );
    final Object segmentColumnValue = nullSafeSet(
        segmentGridType, segmentValue, segmentColumnName, session, tuple
    );
    RowKey key = new RowKey(
        tableName,
        new String[] { segmentColumnName },
        new Object[] { segmentColumnValue }
    );
    IntegralDataTypeHolder value = IdentifierGeneratorHelper.getIntegralDataTypeHolder( identifierType.getReturnedClass() );
View Full Code Here

    }
  }

  public RowKey findMatchingTuple(Map<String, Object> tupleKey) {
    //FIXME Optimize this method, we probably can compute RowKey insead of finding it by value
    RowKey matchingTuple = null;
    for ( Map.Entry<RowKey,Map<String,Object>> collTuple : getCollectionMetadata().entrySet() ) {
      boolean notFound = false;
      final RowKey key = collTuple.getKey();
      final Map<String, Object> value = collTuple.getValue();
      for ( String columnName : tupleKey.keySet() ) {
        final Object columnValue = value.get( columnName );
        //values should not be null
        if ( ! tupleKey.get(columnName).equals( columnValue ) ) {
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

  @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(), null ) );
    }

    return rowKeys;
  }
View Full Code Here

        }
        if ( getFromMongoData == true ) {
          columnValues.add( mongodbColumnData.get( columnKey ) );
        }
      }
      RowKey rowKey = new RowKey(
          key.getTable(),
          columnNames.toArray( new String[columnNames.size()] ),
          columnValues.toArray() );

      this.map.put( rowKey, row );
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.