Examples of Association


Examples of org.hibernate.ogm.datastore.spi.Association

  }

  @Override
  public Association getAssociation(AssociationKey key, AssociationContext associationContext) {
    Map<RowKey, Map<String, Object>> associationMap = provider.getAssociation( key );
    return associationMap == null ? null : new Association( new MapAssociationSnapshot( associationMap ) );
  }
View Full Code Here

Examples of org.hibernate.ogm.datastore.spi.Association

  @Override
  public Association createAssociation(AssociationKey key, AssociationContext associationContext) {
    Map<RowKey, Map<String, Object>> associationMap = new HashMap<RowKey, Map<String,Object>>();
    provider.putAssociation( key, associationMap );
    return new Association( new MapAssociationSnapshot( associationMap ) );
  }
View Full Code Here

Examples of org.hibernate.ogm.datastore.spi.Association

      tupleKey.put( propertyColumnNames[index], oldColumnValue[index] );
    }
    //add id value in TupleKey
    gridIdentifierType.nullSafeSet( tupleKey, id, persister.getIdentifierColumnNames(), session );

    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() )
View Full Code Here

Examples of org.hibernate.ogm.model.spi.Association

    RowKey rowKey = new RowKey( columnNames, values );
    Tuple tuple = new Tuple();
    tuple.put( "zip", "zap" );

    // when
    Association association = dialect1.createAssociation( key, null );
    association.put( rowKey, tuple );
    dialect1.insertOrUpdateAssociation( key, association, null );

    // then
    Association readAssociation = dialect2.getAssociation( key, null );
    Tuple readKey = readAssociation.get( rowKey );
    assertThat( readKey ).isNotNull();
    assertThat( readKey.get( "zip" ) ).isEqualTo( "zap" );
  }
View Full Code Here

Examples of org.hibernate.ogm.model.spi.Association

    Node entityNode = entityQueries.get( entityKey.getMetadata() ).findEntity( executionEngine, entityKey.getColumnValues() );
    GraphLogger.log( "Found owner node: %1$s", entityNode );
    if ( entityNode == null ) {
      return null;
    }
    return new Association(
        new Neo4jAssociationSnapshot(
            entityNode,
            associationKey,
            associationContext.getAssociationTypeContext().getAssociatedEntityKeyMetadata(),
            associationContext.getAssociationTypeContext().getRoleOnMainSide()
View Full Code Here

Examples of org.hibernate.ogm.model.spi.Association

    );
  }

  @Override
  public Association createAssociation(AssociationKey associationKey, AssociationContext associationContext) {
    return new Association();
  }
View Full Code Here

Examples of org.hibernate.ogm.model.spi.Association

      return null;
    }
    else {
      @SuppressWarnings("unchecked")
      Map<SerializableRowKey, Map<String, Object>> associationRows = (Map<SerializableRowKey, Map<String, Object>>) element.getObjectValue();
      return new Association( new SerializableMapAssociationSnapshot( associationRows ) );
    }
  }
View Full Code Here

Examples of org.hibernate.ogm.model.spi.Association

  @Override
  public Association createAssociation(AssociationKey key, AssociationContext associationContext) {
    final Cache<SerializableAssociationKey> associationCache = datastoreProvider.getAssociationCache();
    Map<SerializableRowKey, Map<String, Object>> association = new HashMap<SerializableRowKey, Map<String, Object>>();
    associationCache.put( new Element( new SerializableAssociationKey( key ), association ) );
    return new Association( new SerializableMapAssociationSnapshot( association ) );
  }
View Full Code Here

Examples of org.hibernate.ogm.model.spi.Association

      if ( association != null ) {
        couchDBAssociation = CouchDBAssociation.fromAssociationDocument( association );
      }
    }

    return couchDBAssociation != null ? new Association( new CouchDBAssociationSnapshot( couchDBAssociation, key ) ) : null;
  }
View Full Code Here

Examples of org.hibernate.ogm.model.spi.Association

    else {
      AssociationDocument association = new AssociationDocument( Identifier.createAssociationId( key ) );
      couchDBAssociation = CouchDBAssociation.fromAssociationDocument( association );
    }

    return new Association( new CouchDBAssociationSnapshot( couchDBAssociation, key ) );
  }
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.