Package org.hibernate.ogm.query.impl

Examples of org.hibernate.ogm.query.impl.NoSQLQueryImpl


  @Override
  public NoSQLQuery createNativeQuery(String nativeQuery) {
    errorIfClosed();

    return new NoSQLQueryImpl(
        nativeQuery,
        this,
        factory.getQueryPlanCache().getSQLParameterMetadata( nativeQuery )
    );
  }
View Full Code Here


  @Override
  public Query getNamedSQLQuery(String queryName) {
    errorIfClosed();
    NamedSQLQueryDefinition nsqlqd = findNamedNativeQuery( queryName );
    Query query = new NoSQLQueryImpl(
        nsqlqd,
        this,
        factory.getQueryPlanCache().getSQLParameterMetadata( nsqlqd.getQuery() )
    );
    query.setComment( "named native query " + queryName );
    return query;
  }
View Full Code Here

  @Override
  public NoSQLQuery createNativeQuery(String nativeQuery) {
    errorIfClosed();

    return new NoSQLQueryImpl(
        nativeQuery,
        this,
        factory.getQueryPlanCache().getSQLParameterMetadata( nativeQuery )
    );
  }
View Full Code Here

  @Override
  public Query getNamedSQLQuery(String queryName) {
    errorIfClosed();
    NamedSQLQueryDefinition nsqlqd = findNamedNativeQuery( queryName );
    Query query = new NoSQLQueryImpl(
        nsqlqd,
        this,
        factory.getQueryPlanCache().getSQLParameterMetadata( nsqlqd.getQuery() )
    );
    query.setComment( "named native query " + queryName );
    return query;
  }
View Full Code Here

    String tableName = ( (OgmEntityPersister) ( sessionImplementor
        .getFactory() )
        .getEntityPersister( result.getEntityType().getName() ) )
        .getTableName();

    NoSQLQuery query = new NoSQLQueryImpl(
        new MongoDBQueryDescriptor(
            tableName,
            Operation.FIND, //so far only SELECT is supported
            result.getQuery(),
            result.getProjection(),
            result.getOrderBy()
        ),
        sessionImplementor,
        new ParameterMetadata( null, null )
    );

    // Register the result types of the query; Currently either a number of scalar values or an entity return
    // are supported only; JP-QL would actually a combination of both, though (see OGM-514)
    if ( result.getProjection() != null ) {
      for ( String field : result.getProjection().keySet() ) {
        query.addScalar( field );
      }
    }
    else {
      query.addEntity( result.getEntityType() );
    }

    return query;
  }
View Full Code Here

  @Override
  public NoSQLQuery createNativeQuery(String nativeQuery) {
    errorIfClosed();

    return new NoSQLQueryImpl(
        nativeQuery,
        this,
        factory.getNativeQueryParameterMetadataCache().getParameterMetadata( nativeQuery )
    );
  }
View Full Code Here

  @Override
  public Query getNamedSQLQuery(String queryName) {
    errorIfClosed();
    NamedSQLQueryDefinition nsqlqd = findNamedNativeQuery( queryName );
    Query query = new NoSQLQueryImpl(
        nsqlqd,
        this,
        factory.getNativeQueryParameterMetadataCache().getParameterMetadata( nsqlqd.getQuery() )
    );
    query.setComment( "named native query " + queryName );
    return query;
  }
View Full Code Here

    NoSQLQuery query = nosqlQuery( session, result );
    return query;
  }

  private NoSQLQuery nosqlQuery(OgmSession session, Neo4jQueryParsingResult result) {
    NoSQLQuery query = new NoSQLQueryImpl( result.getQuery(), (SessionImplementor) session, new ParameterMetadata( null, null ) );
    // Register the result types of the query; Currently either a number of scalar values or an entity return
    // are supported only; JP-QL would actually a combination of both, though (see OGM-514)
    if ( hasProjections( result ) ) {
      for ( String field : result.getProjections() ) {
        query.addScalar( field );
      }
    }
    else {
      query.addEntity( result.getEntityType() );
    }
    return query;
  }
View Full Code Here

  @Override
  public NoSQLQuery createNativeQuery(String nativeQuery) {
    errorIfClosed();

    return new NoSQLQueryImpl(
        nativeQuery,
        this,
        factory.getNativeQueryParameterMetadataCache().getParameterMetadata( nativeQuery )
    );
  }
View Full Code Here

  @Override
  public Query getNamedSQLQuery(String queryName) {
    errorIfClosed();
    NamedSQLQueryDefinition nsqlqd = findNamedNativeQuery( queryName );
    Query query = new NoSQLQueryImpl(
        nsqlqd,
        this,
        factory.getNativeQueryParameterMetadataCache().getParameterMetadata( nsqlqd.getQuery() )
    );
    query.setComment( "named native query " + queryName );
    return query;
  }
View Full Code Here

TOP

Related Classes of org.hibernate.ogm.query.impl.NoSQLQueryImpl

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.