Package org.hibernate.engine.query.sql

Examples of org.hibernate.engine.query.sql.NativeSQLQuerySpecification


      // this will throw an error if there's something wrong.
      try {
        log.debug("Checking named SQL query: " + queryName);
        // TODO : would be really nice to cache the spec on the query-def so as to not have to re-calc the hash;
        // currently not doable though because of the resultset-ref stuff...
        NativeSQLQuerySpecification spec;
        if ( qd.getResultSetRef() != null ) {
          ResultSetMappingDefinition definition = ( ResultSetMappingDefinition ) sqlResultSetMappings.get( qd.getResultSetRef() );
          if ( definition == null ) {
            throw new MappingException( "Unable to find resultset-ref definition: " + qd.getResultSetRef() );
          }
          spec = new NativeSQLQuerySpecification(
              qd.getQueryString(),
                  definition.getQueryReturns(),
                  qd.getQuerySpaces()
          );
        }
        else {
          spec =  new NativeSQLQuerySpecification(
              qd.getQueryString(),
                  qd.getQueryReturns(),
                  qd.getQuerySpaces()
          );
        }
View Full Code Here


  public List list() throws HibernateException {
    verifyParameters();
    before();

    Map namedParams = getNamedParams();
    NativeSQLQuerySpecification spec = generateQuerySpecification( namedParams );

    try {
      return getSession().list( spec, getQueryParameters( namedParams ) );
    }
    finally {
View Full Code Here

      after();
    }
  }

  private NativeSQLQuerySpecification generateQuerySpecification(Map namedParams) {
    return new NativeSQLQuerySpecification(
            expandParameterLists(namedParams),
            getQueryReturns(),
            querySpaces
    );
  }
View Full Code Here

  public ScrollableResults scroll(ScrollMode scrollMode) throws HibernateException {
    verifyParameters();
    before();

    Map namedParams = getNamedParams();
    NativeSQLQuerySpecification spec = generateQuerySpecification( namedParams );

    QueryParameters qp = getQueryParameters( namedParams );
    qp.setScrollMode( scrollMode );

    try {
View Full Code Here

  public List list() throws HibernateException {
    verifyParameters();
    before();

    Map namedParams = getNamedParams();
    NativeSQLQuerySpecification spec = generateQuerySpecification( namedParams );

    try {
      return getSession().list( spec, getQueryParameters( namedParams ) );
    }
    finally {
View Full Code Here

      after();
    }
  }

  private NativeSQLQuerySpecification generateQuerySpecification(Map namedParams) {
    return new NativeSQLQuerySpecification(
            expandParameterLists(namedParams),
            getQueryReturns(),
            querySpaces
    );
  }
View Full Code Here

  public ScrollableResults scroll(ScrollMode scrollMode) throws HibernateException {
    verifyParameters();
    before();

    Map namedParams = getNamedParams();
    NativeSQLQuerySpecification spec = generateQuerySpecification( namedParams );

    QueryParameters qp = getQueryParameters( namedParams );
    qp.setScrollMode( scrollMode );

    try {
View Full Code Here

      // this will throw an error if there's something wrong.
      try {
        log.debug("Checking named SQL query: " + queryName);
        // TODO : would be really nice to cache the spec on the query-def so as to not have to re-calc the hash;
        // currently not doable though because of the resultset-ref stuff...
        NativeSQLQuerySpecification spec;
        if ( qd.getResultSetRef() != null ) {
          ResultSetMappingDefinition definition = ( ResultSetMappingDefinition ) sqlResultSetMappings.get( qd.getResultSetRef() );
          if ( definition == null ) {
            throw new MappingException( "Unable to find resultset-ref definition: " + qd.getResultSetRef() );
          }
          spec = new NativeSQLQuerySpecification(
              qd.getQueryString(),
                  definition.getQueryReturns(),
                  qd.getQuerySpaces()
          );
        }
        else {
          spec =  new NativeSQLQuerySpecification(
              qd.getQueryString(),
                  qd.getQueryReturns(),
                  qd.getQuerySpaces()
          );
        }
View Full Code Here

      // this will throw an error if there's something wrong.
      try {
        log.debug("Checking named SQL query: " + queryName);
        // TODO : would be really nice to cache the spec on the query-def so as to not have to re-calc the hash;
        // currently not doable though because of the resultset-ref stuff...
        NativeSQLQuerySpecification spec;
        if ( qd.getResultSetRef() != null ) {
          ResultSetMappingDefinition definition = ( ResultSetMappingDefinition ) sqlResultSetMappings.get( qd.getResultSetRef() );
          if ( definition == null ) {
            throw new MappingException( "Unable to find resultset-ref definition: " + qd.getResultSetRef() );
          }
          spec = new NativeSQLQuerySpecification(
              qd.getQueryString(),
                  definition.getQueryReturns(),
                  qd.getQuerySpaces()
          );
        }
        else {
          spec =  new NativeSQLQuerySpecification(
              qd.getQueryString(),
                  qd.getQueryReturns(),
                  qd.getQuerySpaces()
          );
        }
View Full Code Here

  public List list() throws HibernateException {
    verifyParameters();
    before();

    Map namedParams = getNamedParams();
    NativeSQLQuerySpecification spec = generateQuerySpecification( namedParams );

    try {
      return getSession().list( spec, getQueryParameters( namedParams ) );
    }
    finally {
View Full Code Here

TOP

Related Classes of org.hibernate.engine.query.sql.NativeSQLQuerySpecification

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.