Examples of EntityKeyMetadata


Examples of org.hibernate.ogm.grid.EntityKeyMetadata

   *
   * @return the {@link EntityKeyMetadata} of the entity type selected by this query or {@code null} in case this
   * query does not select exactly one entity type (e.g. in case of scalar values or joins (if supported in future revisions)).
   */
  public EntityKeyMetadata getSingleEntityKeyMetadataOrNull() {
    EntityKeyMetadata metadata = null;

    for ( Return queryReturn : getCustomQueryReturns() ) {
      if ( queryReturn instanceof RootReturn ) {
        if ( metadata != null ) {
          return null;
        }
        RootReturn rootReturn = (RootReturn) queryReturn;
        OgmEntityPersister persister = (OgmEntityPersister) sessionFactory.getEntityPersister( rootReturn.getEntityName() );
        metadata = new EntityKeyMetadata( persister.getTableName(), persister.getRootTableIdentifierColumnNames() );
      }
    }

    return metadata;
  }
View Full Code Here

Examples of org.hibernate.ogm.grid.EntityKeyMetadata

      }

      query = parseResult.resultValue.build();
    }

    EntityKeyMetadata entityKeyMetadata = customQuery.getSingleEntityKeyMetadataOrNull();
    String collectionName = getCollectionName( customQuery, query, entityKeyMetadata );
    DBCollection collection = provider.getDatabase().getCollection( collectionName );

    switch( query.getOperation() ) {
      case FIND:
View Full Code Here

Examples of org.hibernate.ogm.grid.EntityKeyMetadata

    input.readInt();

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

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

Examples of org.hibernate.ogm.grid.EntityKeyMetadata

    input.readInt();

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

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

Examples of org.hibernate.ogm.grid.EntityKeyMetadata

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

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

Examples of org.hibernate.ogm.model.key.spi.EntityKeyMetadata

    return SingleEntityQueryBuilder.getInstance( new Neo4jPredicateFactory( propertyHelper, resolverDelegate ), propertyHelper );
  }

  private EntityKeyMetadata getKeyMetaData(Class<?> entityType) {
    OgmEntityPersister persister = (OgmEntityPersister) ( sessionFactory ).getEntityPersister( entityType.getName() );
    return new EntityKeyMetadata( persister.getTableName(), persister.getRootTableIdentifierColumnNames() );
  }
View Full Code Here

Examples of org.hibernate.ogm.model.key.spi.EntityKeyMetadata

    for ( String associationKeyColumn : associationKeyColumns ) {
      columnValues[i] = rowKey.getColumnValue( associationKeyColumn );
      i++;
    }

    EntityKeyMetadata entityKeyMetadata = associationKey.getMetadata().getAssociatedEntityKeyMetadata().getEntityKeyMetadata();
    return new EntityKey( entityKeyMetadata, columnValues );
  }
View Full Code Here

Examples of org.hibernate.ogm.model.key.spi.EntityKeyMetadata

  @Test
  public void shouldWriteAndReadTupleInClusteredMode() throws Exception {
    // given
    String[] columnNames = { "foo", "bar", "baz" };
    EntityKeyMetadata keyMetadata = new EntityKeyMetadata( "Foobar", columnNames );
    Object[] values = { 123, "Hello", 456L };

    EntityKey key = new EntityKey( keyMetadata, values );

    // when
View Full Code Here

Examples of org.hibernate.ogm.model.key.spi.EntityKeyMetadata

  private Map<EntityKeyMetadata, Neo4jEntityQueries> initializeEntityQueries(SessionFactoryImplementor sessionFactoryImplementor,
      Map<AssociationKeyMetadata, Neo4jAssociationQueries> associationQueries) {
    Map<EntityKeyMetadata, Neo4jEntityQueries> entityQueries = initializeEntityQueries( sessionFactoryImplementor );
    for ( AssociationKeyMetadata associationKeyMetadata : associationQueries.keySet() ) {
      EntityKeyMetadata entityKeyMetadata = associationKeyMetadata.getAssociatedEntityKeyMetadata().getEntityKeyMetadata();
      if ( !entityQueries.containsKey( entityKeyMetadata ) ) {
        // Embeddables metadata
        entityQueries.put( entityKeyMetadata, new Neo4jEntityQueries( entityKeyMetadata ) );
      }
    }
View Full Code Here

Examples of org.hibernate.ogm.model.key.spi.EntityKeyMetadata

    Map<AssociationKeyMetadata, Neo4jAssociationQueries> queryMap = new HashMap<AssociationKeyMetadata, Neo4jAssociationQueries>();
    Collection<CollectionPersister> collectionPersisters = sessionFactoryImplementor.getCollectionPersisters().values();
    for ( CollectionPersister collectionPersister : collectionPersisters ) {
      if ( collectionPersister instanceof OgmCollectionPersister ) {
        OgmCollectionPersister ogmCollectionPersister = (OgmCollectionPersister) collectionPersister;
        EntityKeyMetadata ownerEntityKeyMetadata = ( (OgmEntityPersister) ( ogmCollectionPersister.getOwnerEntityPersister() ) ).getEntityKeyMetadata();
        AssociationKeyMetadata associationKeyMetadata = ogmCollectionPersister.getAssociationKeyMetadata();
        queryMap.put( associationKeyMetadata, new Neo4jAssociationQueries( ownerEntityKeyMetadata, associationKeyMetadata ) );
      }
    }
    return queryMap;
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.