Announcement Announcement Module
Collapse
No announcement yet.
hibernate pagination Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • hibernate pagination

    I want to make a method that returns a subset of a list.
    The method below throws an Exception.

    could not execute query;
    bad SQL grammar
    [select grouping0_.group_code as group1_, grouping0_.group_name as group2_0_ from grouping grouping0_ where (upper(group_name)like upper(?)) and group_code>0 order by group_name];

    nested exception is java.sql.SQLException: Syntax error or access violation message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1"

    when i uncomment the setMax and setFirst method calls, it works fine, except of course, there is no pagination.

    What could be wrong?



    Below is the method body and the one after it is the named query.

    public List getGroupingListSubset(SearchGroupingBean sgb) {
    HibernateTemplate ht = getHibernateTemplate();
    ht.setMaxResults(sgb.getMaxPageItems());
    ht.setFetchSize(sgb.getItemOffset());
    List al = ht.findByNamedQueryAndNamedParam("getGroupingListS ubset", "substring", sgb.getSubstring());
    log.debug("Size: " + al.size());
    return al;
    }

    <query name="getGroupingListSubset"><![CDATA[
    from Grouping WHERE UPPER(group_name) LIKE UPPER(:substring) AND group_code>0 ORDER by group_name
    ]]></query>

  • #2
    Re: hibernate pagination

    Originally posted by oliverchua
    bad SQL grammar
    [select grouping0_.group_code as group1_, grouping0_.group_name as group2_0_ from grouping grouping0_ where (upper(group_name)like upper(?)) and group_code>0 order by group_name];

    nested exception is java.sql.SQLException: Syntax error or access violation message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1"
    One thing I don't understand is that the statement the exception is complaining about does not contain anything that is related to paginating the result.

    Could you post the SQL statements Hibernate generates with pagination and without pagination?

    Erik

    Comment


    • #3
      hi erikfk.

      Sorry, you're right. There was actually 2 parts of the exception from the same method, I posted the second part, thinking they were the same.
      Below is the error log for the part with pagination...

      17:21:34,690 DEBUG SQL:324 - select grouping0_.group_code as group1_, grouping0_.group_name as group2_0_ from grouping grouping0_ where (upper(group_name)like upper(?)) and group_code>0 order by group_name limit ?
      17:21:34,801 DEBUG AbstractBatcher:378 - preparing statement
      17:21:34,811 DEBUG JDBCExceptionReporter:63 - SQL Exception
      java.sql.SQLException: Syntax error or access violation message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1"
      ...
      17:21:34,821 WARN JDBCExceptionReporter:71 - SQL Error: 1064, SQLState: 42000
      17:21:34,821 ERROR JDBCExceptionReporter:72 - Syntax error or access violation message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1"
      17:21:34,821 DEBUG JDBCExceptionReporter:63 - could not execute query [select grouping0_.group_code as group1_, grouping0_.group_name as group2_0_ from grouping grouping0_ where (upper(group_name)like upper(?)) and group_code>0 order by group_name]
      java.sql.SQLException: Syntax error or access violation message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1"
      ...

      17:21:34,831 WARN JDBCExceptionReporter:71 - SQL Error: 1064, SQLState: 42000
      17:21:34,831 ERROR JDBCExceptionReporter:72 - Syntax error or access violation message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1"
      17:21:34,831 DEBUG JDBCContext:322 - after autocommit
      17:21:34,831 DEBUG SessionImpl:403 - after transaction completion
      17:21:34,841 DEBUG SessionImpl:269 - closing session
      17:21:34,841 DEBUG ConnectionManager:317 - closing JDBC connection [ (open PreparedStatements: 1, globally: 1) (open ResultSets: 0, globally: 0)]
      17:21:34,841 DEBUG JDBCContext:283 - after transaction completion
      17:21:34,841 DEBUG SessionImpl:403 - after transaction completion


      This is for the one without pagination...
      this is just the sql since there was no exception

      17:27:49,049 DEBUG SQL:324 - select grouping0_.group_code as group1_, grouping0_.group_name as group2_0_ from grouping grouping0_ where (upper(group_name)like upper(?)) and group_code>0 order by group_name

      Comment


      • #4
        Originally posted by oliverchua
        17:21:34,811 DEBUG JDBCExceptionReporter:63 - SQL Exception
        java.sql.SQLException: Syntax error or access violation message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1"
        That's a bit strange...

        I would need the Hibernate debug trace to be able to say more. Can you provide it for the case where pagination is active?

        Other question: what happens when you interactively enter
        Code:
        select grouping0_.group_code as group1_, grouping0_.group_name as group2_0_ from grouping grouping0_ where &#40;upper&#40;group_name&#41;like upper&#40;?&#41;&#41; and group_code>0 order by group_name limit ?
        (replacing '?'s with proper values of course :-))?

        Erik

        Comment


        • #5
          What is the named query? It appears that the named query uses index parameters (i.e. ?), but you are specify named parameters, i.e.

          Code:
           List al = ht.findByNamedQueryAndNamedParam&#40;"getGroupingListSubset", "substring", sgb.getSubstring&#40;&#41;&#41;;
          Either change your code to set position parameters, or change your query to use
          Code:
          upper&#40;&#58;substring&#41;
          instead of
          Code:
          upper&#40;?&#41;

          Comment


          • #6
            ErikFK:
            thanks for your help.
            I tried running it in mysql, it is working fine.

            I also tried using another way,
            public List getGroupingListSubset(final SearchGroupingBean sgb) {
            HibernateTemplate ht = getHibernateTemplate();
            List al = ht.executeFind(new HibernateCallback() {
            public Object doInHibernate(Session session) throws HibernateException {
            Query q = session.getNamedQuery("getGroupingListSubset");
            q.setMaxResults(sgb.getMaxPageItems());
            q.setFirstResult(sgb.getItemOffset());
            q.setString("substring", sgb.getSubstring());
            List al = q.list();
            return al;
            }
            });
            log.debug("Size: " + al.size());
            return al;
            }
            but the problem is still the same

            here is the full debug trace...

            21:27:32,500 INFO Environment:464 - Hibernate 3.0.5
            21:27:32,510 INFO Environment:477 - hibernate.properties not found
            21:27:32,510 INFO Environment:510 - using CGLIB reflection optimizer
            21:27:32,520 INFO Environment:540 - using JDK 1.4 java.sql.Timestamp handling
            21:27:32,680 DEBUG DTDEntityResolver:42 - trying to locate http://hibernate.sourceforge.net/hib...apping-3.0.dtd in classpath under org/hibernate/
            21:27:32,690 DEBUG DTDEntityResolver:53 - found http://hibernate.sourceforge.net/hib...apping-3.0.dtd in classpath
            21:27:32,851 INFO HbmBinder:260 - Mapping class: com.tougher.intranet.employee.grouping.Grouping -> grouping
            21:27:32,861 DEBUG HbmBinder:1099 - Mapped property: groupingCode -> group_code
            21:27:32,881 DEBUG HbmBinder:1099 - Mapped property: groupingName -> group_name
            21:27:32,881 DEBUG HbmBinder:2233 - Named query: getGroupingList ->
            from Grouping WHERE group_code>0 order by group_name

            21:27:32,881 DEBUG HbmBinder:2233 - Named query: getGroupingListSubset ->
            from Grouping WHERE UPPER(group_name) LIKE UPPER(:substring) AND group_code>0 ORDER by group_name

            21:27:32,891 DEBUG HbmBinder:2233 - Named query: getGroupingListSubsetCount ->
            select count(*) from Grouping WHERE UPPER(group_name) LIKE UPPER(:substring) AND group_code>0 ORDER by group_name

            21:27:32,891 DEBUG HbmBinder:2233 - Named query: groupingExists ->
            SELECT groupingName FROM Grouping WHERE UPPER(group_name) = UPPER(:groupingName)

            21:27:32,891 DEBUG HbmBinder:2233 - Named query: groupingExistsUpdate ->
            SELECT groupingName FROM Grouping WHERE UPPER(group_name) = UPPER(:groupingName) AND group_code<>:groupingCode

            21:27:32,901 DEBUG Configuration:998 - Preparing to build session factory with filters : {}
            21:27:32,901 INFO Configuration:875 - processing extends queue
            21:27:32,901 INFO Configuration:879 - processing collection mappings
            21:27:32,901 INFO Configuration:888 - processing association property references
            21:27:32,901 INFO Configuration:917 - processing foreign key constraints
            21:27:33,011 INFO ConnectionProviderFactory:53 - Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSource ConnectionProvider
            21:27:33,311 INFO SettingsFactory:77 - RDBMS: MySQL, version: 4.1.12a-nt
            21:27:33,321 INFO SettingsFactory:78 - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.2-alpha ( $Date: 2004/05/20 20:34:41 $, $Revision: 1.27.4.34 $ )
            21:27:33,341 INFO Dialect:92 - Using dialect: org.hibernate.dialect.MySQLDialect
            21:27:33,351 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)
            21:27:33,361 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
            21:27:33,361 INFO SettingsFactory:125 - Automatic flush during beforeCompletion(): disabled
            21:27:33,361 INFO SettingsFactory:129 - Automatic session close at end of transaction: disabled
            21:27:33,361 INFO SettingsFactory:136 - JDBC batch size: 15
            21:27:33,361 INFO SettingsFactory:139 - JDBC batch updates for versioned data: disabled
            21:27:33,371 INFO SettingsFactory:144 - Scrollable result sets: enabled
            21:27:33,371 DEBUG SettingsFactory:148 - Wrap result sets: disabled
            21:27:33,371 INFO SettingsFactory:152 - JDBC3 getGeneratedKeys(): enabled
            21:27:33,371 INFO SettingsFactory:160 - Connection release mode: null
            21:27:33,371 INFO SettingsFactory:184 - Maximum outer join fetch depth: 2
            21:27:33,371 INFO SettingsFactory:187 - Default batch fetch size: 1
            21:27:33,371 INFO SettingsFactory:191 - Generate SQL with comments: disabled
            21:27:33,381 INFO SettingsFactory:195 - Order SQL updates by primary key: disabled
            21:27:33,391 INFO SettingsFactory:334 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
            21:27:33,401 INFO ASTQueryTranslatorFactory:21 - Using ASTQueryTranslatorFactory
            21:27:33,401 INFO SettingsFactory:203 - Query language substitutions: {}
            21:27:33,401 INFO SettingsFactory:209 - Second-level cache: enabled
            21:27:33,401 INFO SettingsFactory:213 - Query cache: disabled
            21:27:33,401 INFO SettingsFactory:321 - Cache provider: org.hibernate.cache.EhCacheProvider
            21:27:33,411 INFO SettingsFactory:228 - Optimize cache for minimal puts: disabled
            21:27:33,411 INFO SettingsFactory:237 - Structured second-level cache entries: disabled
            21:27:33,411 DEBUG SQLExceptionConverterFactory:52 - Using dialect defined converter
            21:27:33,452 INFO SettingsFactory:261 - Statistics: disabled
            21:27:33,452 INFO SettingsFactory:265 - Deleted entity synthetic identifier rollback: disabled
            21:27:33,462 INFO SettingsFactory:279 - Default entity-mode: pojo
            21:27:33,652 INFO SessionFactoryImpl:152 - building session factory
            21:27:33,652 DEBUG SessionFactoryImpl:161 - Session factory constructed with filter configurations : {}
            21:27:33,652 DEBUG SessionFactoryImpl:164 - instantiating session factory with properties: {java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, sun.boot.library.path=C:\Java\j2sdk1.4.2_04\jre\bi n, java.vm.version=1.4.2_04-b05, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=US, sun.os.patch.level=Service Pack 2, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\Projects\MySpringStruts, java.runtime.version=1.4.2_04-b05, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironm ent, java.endorsed.dirs=C:\Java\j2sdk1.4.2_04\jre\lib\e ndorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\Toffer\LOCALS~1\Temp\, line.separator=
            , java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows XP, sun.java2d.fontpath=, java.library.path=C:\Java\j2sdk1.4.2_04\bin;.;C:\W INDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\ WINDOWS;C:\WINDOWS\System32\Wbem, java.specification.name=Java Platform API Specification, java.class.version=48.0, java.util.prefs.PreferencesFactory=java.util.prefs .WindowsPreferencesFactory, os.version=5.1, user.home=C:\Documents and Settings\Toffer, user.timezone=Australia/Sydney, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.4, user.name=Toffer, java.class.path=/c:/Java/eclipse/plugins/org.eclipse.jdt.junit_3.1.0/junitsupport.jar;/c:/Java/eclipse/plugins/org.eclipse.jdt.junit.runtime_3.1.0/junitruntime.jar;C:\Projects\MySpringStruts\bin;C: \Projects\MySpringStruts\Jars\hibernate\hibernate3 .jar;C:\Projects\MySpringStruts\Jars\spring\spring .jar;C:\Projects\MySpringStruts\Jars\log4j\log4j-1.2.9.jar;C:\Projects\MySpringStruts\Jars\hibernat e\commons-logging-1.0.4.jar;C:\Projects\MySpringStruts\Jars\junit\ju nit.jar;C:\Projects\MySpringStruts\Jars\mysql\mysq l-connector-java-3.1.2-alpha-bin.jar;C:\Projects\MySpringStruts\Jars\spring\dom 4j-1.4.jar;C:\Projects\MySpringStruts\Jars\hibernate\ antlr-2.7.5H3.jar;C:\Projects\MySpringStruts\Jars\hibern ate\asm.jar;C:\Projects\MySpringStruts\Jars\hibern ate\asm-attrs.jar;C:\Projects\MySpringStruts\Jars\hibernat e\cglib-2.1.jar;C:\Projects\MySpringStruts\Jars\hibernate\ commons-collections-2.1.1.jar;C:\Projects\MySpringStruts\Jars\hibernat e\dom4j-1.6.jar;C:\Projects\MySpringStruts\Jars\hibernate\ ehcache-1.1.jar;C:\Projects\MySpringStruts\Jars\hibernate\ jdbc2_0-stdext.jar;C:\Projects\MySpringStruts\Jars\hiberna te\jta.jar;C:\Projects\MySpringStruts\Jars\hiberna te\xml-apis.jar, java.vm.specification.version=1.0, java.home=C:\Java\j2sdk1.4.2_04\jre, sun.arch.data.model=32, hibernate.dialect=org.hibernate.dialect.MySQLDiale ct, user.language=en, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=true, java.vm.info=mixed mode, java.version=1.4.2_04, java.ext.dirs=C:\Java\j2sdk1.4.2_04\jre\lib\ext, sun.boot.class.path=C:\Java\j2sdk1.4.2_04\jre\lib\ rt.jar;C:\Java\j2sdk1.4.2_04\jre\lib\i18n.jar;C:\J ava\j2sdk1.4.2_04\jre\lib\sunrsasign.jar;C:\Java\j 2sdk1.4.2_04\jre\lib\jsse.jar;C:\Java\j2sdk1.4.2_0 4\jre\lib\jce.jar;C:\Java\j2sdk1.4.2_04\jre\lib\ch arsets.jar;C:\Java\j2sdk1.4.2_04\jre\classes, java.vendor=Sun Microsystems Inc., file.separator=\, hibernate.connection.provider_class=org.springfram ework.orm.hibernate3.LocalDataSourceConnectionProv ider, hibernate.hbm2ddl.auto=update, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, sun.cpu.isalist=pentium i486 i386}
            21:27:33,662 WARN Configurator:126 - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/Projects/MySpringStruts/Jars/hibernate/ehcache-1.1.jar!/ehcache-failsafe.xml
            21:27:34,123 DEBUG BasicEntityPersister:2220 - Static SQL for entity: com.tougher.intranet.employee.grouping.Grouping
            21:27:34,123 DEBUG BasicEntityPersister:2222 - Version select: select group_code from grouping where group_code =?
            21:27:34,123 DEBUG BasicEntityPersister:2223 - Snapshot select: select grouping_.group_code, grouping_.group_name as group2_0_ from grouping grouping_ where grouping_.group_code=?
            21:27:34,123 DEBUG BasicEntityPersister:2225 - Insert 0: insert into grouping (group_name, group_code) values (?, ?)
            21:27:34,133 DEBUG BasicEntityPersister:2226 - Update 0: update grouping set group_name=? where group_code=?
            21:27:34,133 DEBUG BasicEntityPersister:2227 - Delete 0: delete from grouping where group_code=?
            21:27:34,133 DEBUG BasicEntityPersister:2230 - Identity insert: insert into grouping (group_name) values (?)
            21:27:34,163 DEBUG EntityLoader:95 - Static select for entity com.tougher.intranet.employee.grouping.Grouping: select grouping0_.group_code as group1_0_, grouping0_.group_name as group2_0_0_ from grouping grouping0_ where grouping0_.group_code=?
            21:27:34,163 DEBUG EntityLoader:95 - Static select for entity com.tougher.intranet.employee.grouping.Grouping: select grouping0_.group_code as group1_0_, grouping0_.group_name as group2_0_0_ from grouping grouping0_ where grouping0_.group_code=?
            21:27:34,163 DEBUG EntityLoader:95 - Static select for entity com.tougher.intranet.employee.grouping.Grouping: select grouping0_.group_code as group1_0_, grouping0_.group_name as group2_0_0_ from grouping grouping0_ where grouping0_.group_code=? for update
            21:27:34,163 DEBUG EntityLoader:95 - Static select for entity com.tougher.intranet.employee.grouping.Grouping: select grouping0_.group_code as group1_0_, grouping0_.group_name as group2_0_0_ from grouping grouping0_ where grouping0_.group_code=? for update
            21:27:34,173 DEBUG SessionFactoryObjectFactory:39 - initializing class SessionFactoryObjectFactory
            21:27:34,173 DEBUG SessionFactoryObjectFactory:76 - registered: 402880820682bcf6010682bcf91d0000 (unnamed)
            21:27:34,183 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured
            21:27:34,183 DEBUG SessionFactoryImpl:262 - instantiated session factory
            21:27:34,183 INFO Dialect:92 - Using dialect: org.hibernate.dialect.MySQLDialect
            21:27:34,183 INFO ConnectionProviderFactory:53 - Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSource ConnectionProvider
            21:27:34,183 INFO SchemaUpdate:105 - Running hbm2ddl schema update
            21:27:34,183 INFO SchemaUpdate:117 - fetching database metadata
            21:27:34,213 INFO SchemaUpdate:133 - updating schema
            21:27:34,223 INFO Configuration:875 - processing extends queue
            21:27:34,223 INFO Configuration:879 - processing collection mappings
            21:27:34,223 INFO Configuration:888 - processing association property references
            21:27:34,223 INFO Configuration:917 - processing foreign key constraints
            21:27:34,313 INFO TableMetadata:38 - table found: .grouping
            21:27:34,313 INFO TableMetadata:39 - columns: [group_name, group_code]
            21:27:34,313 INFO TableMetadata:40 - foreign keys: []
            21:27:34,313 INFO TableMetadata:41 - indexes: [primary]
            21:27:34,313 INFO SchemaUpdate:153 - schema update complete
            21:27:34,313 INFO SessionFactoryImpl:379 - Checking 5 named queries
            21:27:34,313 DEBUG SessionFactoryImpl:386 - Checking named query: groupingExistsUpdate
            21:27:34,403 DEBUG QueryTranslatorImpl:207 - parse() - HQL:
            SELECT groupingName FROM com.tougher.intranet.employee.grouping.Grouping WHERE UPPER(group_name) = UPPER(:groupingName) AND group_code<>:groupingCode

            21:27:34,443 DEBUG AST:223 - --- HQL AST ---
            \-[QUERY] 'query'
            +-[SELECT_FROM] 'SELECT_FROM'
            | +-[FROM] 'FROM'
            | | \-[RANGE] 'RANGE'
            | | \-[DOT] '.'
            | | +-[DOT] '.'
            | | | +-[DOT] '.'
            | | | | +-[DOT] '.'
            | | | | | +-[DOT] '.'
            | | | | | | +-[IDENT] 'com'
            | | | | | | \-[IDENT] 'tougher'
            | | | | | \-[IDENT] 'intranet'
            | | | | \-[IDENT] 'employee'
            | | | \-[IDENT] 'grouping'
            | | \-[IDENT] 'Grouping'
            | \-[SELECT] 'SELECT'
            | \-[IDENT] 'groupingName'
            \-[WHERE] 'WHERE'
            \-[AND] 'AND'
            +-[EQ] '='
            | +-[METHOD_CALL] '('
            | | +-[IDENT] 'UPPER'
            | | \-[EXPR_LIST] 'exprList'
            | | \-[IDENT] 'group_name'
            | \-[METHOD_CALL] '('
            | +-[IDENT] 'UPPER'
            | \-[EXPR_LIST] 'exprList'
            | \-[COLON] ':'
            | \-[IDENT] 'groupingName'
            \-[NE] '<>'
            +-[IDENT] 'group_code'
            \-[COLON] ':'
            \-[IDENT] 'groupingCode'

            21:27:34,443 DEBUG ErrorCounter:72 - throwQueryException() : no errors
            21:27:34,493 DEBUG HqlSqlBaseWalker:120 - query() << begin, level = 1
            21:27:34,533 DEBUG FromElement:88 - FromClause{level=1} : com.tougher.intranet.employee.grouping.Grouping (no alias) -> grouping0_
            21:27:34,533 DEBUG FromReferenceNode:48 - Resolved : groupingName -> grouping0_.group_name
            21:27:34,543 DEBUG HqlSqlBaseWalker:125 - query() : finishing up , level = 1
            21:27:34,573 DEBUG HqlSqlWalker:331 - processQuery() : ( SELECT ( {select clause} grouping0_.group_name ) ( FromClause{level=1} grouping grouping0_ ) ( WHERE ( AND ( = ( ( UPPER ( exprList group_name ) ) ( ( UPPER ( exprList ? ) ) ) ( <> group_code ? ) ) ) )
            21:27:34,593 DEBUG JoinProcessor:112 - Using FROM fragment [grouping grouping0_]
            21:27:34,593 DEBUG HqlSqlBaseWalker:128 - query() >> end, level = 1
            21:27:34,603 DEBUG AST:193 - --- SQL AST ---
            \-[SELECT] QueryNode: 'SELECT' querySpaces (grouping)
            +-[SELECT_CLAUSE] SelectClause: '{select clause}'
            | +-[SQL_TOKEN] IdentNode: 'grouping0_.group_name' {originalText=groupingName}
            | \-[SELECT_COLUMNS] SqlNode: ' as col_0_0_'
            +-[FROM] FromClause: 'FROM' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[], fromElementByTableAlias=[grouping0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
            | \-[FROM_FRAGMENT] FromElement: 'grouping grouping0_' FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=gro uping,tableAlias=grouping0_,colums={,className=com .tougher.intranet.employee.grouping.Grouping}}
            \-[WHERE] SqlNode: 'WHERE'
            \-[AND] SqlNode: 'AND'
            +-[EQ] SqlNode: '='
            | +-[METHOD_CALL] MethodNode: '('
            | | +-[METHOD_NAME] IdentNode: 'UPPER' {originalText=UPPER}
            | | \-[EXPR_LIST] SqlNode: 'exprList'
            | | \-[IDENT] IdentNode: 'group_name' {originalText=group_name}
            | \-[METHOD_CALL] MethodNode: '('
            | +-[METHOD_NAME] IdentNode: 'UPPER' {originalText=UPPER}
            | \-[EXPR_LIST] SqlNode: 'exprList'
            | \-[NAMED_PARAM] SqlNode: '?'
            \-[NE] SqlNode: '<>'
            +-[IDENT] IdentNode: 'group_code' {originalText=group_code}
            \-[NAMED_PARAM] SqlNode: '?'

            21:27:34,603 DEBUG ErrorCounter:72 - throwQueryException() : no errors
            21:27:34,623 DEBUG QueryTranslatorImpl:177 - HQL:
            SELECT groupingName FROM com.tougher.intranet.employee.grouping.Grouping WHERE UPPER(group_name) = UPPER(:groupingName) AND group_code<>:groupingCode

            21:27:34,623 DEBUG QueryTranslatorImpl:178 - SQL: select grouping0_.group_name as col_0_0_ from grouping grouping0_ where upper(group_name)=upper(?) and group_code<>?
            21:27:34,623 DEBUG ErrorCounter:72 - throwQueryException() : no errors
            21:27:34,633 DEBUG SessionFactoryImpl:386 - Checking named query: groupingExists
            21:27:34,633 DEBUG QueryTranslatorImpl:207 - parse() - HQL:
            SELECT groupingName FROM com.tougher.intranet.employee.grouping.Grouping WHERE UPPER(group_name) = UPPER(:groupingName)

            21:27:34,643 DEBUG AST:223 - --- HQL AST ---
            \-[QUERY] 'query'
            +-[SELECT_FROM] 'SELECT_FROM'
            | +-[FROM] 'FROM'
            | | \-[RANGE] 'RANGE'
            | | \-[DOT] '.'
            | | +-[DOT] '.'
            | | | +-[DOT] '.'
            | | | | +-[DOT] '.'
            | | | | | +-[DOT] '.'
            | | | | | | +-[IDENT] 'com'
            | | | | | | \-[IDENT] 'tougher'
            | | | | | \-[IDENT] 'intranet'
            | | | | \-[IDENT] 'employee'
            | | | \-[IDENT] 'grouping'
            | | \-[IDENT] 'Grouping'
            | \-[SELECT] 'SELECT'
            | \-[IDENT] 'groupingName'
            \-[WHERE] 'WHERE'
            \-[EQ] '='
            +-[METHOD_CALL] '('
            | +-[IDENT] 'UPPER'
            | \-[EXPR_LIST] 'exprList'
            | \-[IDENT] 'group_name'
            \-[METHOD_CALL] '('
            +-[IDENT] 'UPPER'
            \-[EXPR_LIST] 'exprList'
            \-[COLON] ':'
            \-[IDENT] 'groupingName'

            21:27:34,643 DEBUG ErrorCounter:72 - throwQueryException() : no errors
            21:27:34,643 DEBUG HqlSqlBaseWalker:120 - query() << begin, level = 1
            21:27:34,643 DEBUG FromElement:88 - FromClause{level=1} : com.tougher.intranet.employee.grouping.Grouping (no alias) -> grouping0_
            21:27:34,643 DEBUG FromReferenceNode:48 - Resolved : groupingName -> grouping0_.group_name
            21:27:34,653 DEBUG HqlSqlBaseWalker:125 - query() : finishing up , level = 1
            21:27:34,653 DEBUG HqlSqlWalker:331 - processQuery() : ( SELECT ( {select clause} grouping0_.group_name ) ( FromClause{level=1} grouping grouping0_ ) ( WHERE ( = ( ( UPPER ( exprList group_name ) ) ( ( UPPER ( exprList ? ) ) ) ) )
            21:27:34,653 DEBUG JoinProcessor:112 - Using FROM fragment [grouping grouping0_]
            21:27:34,653 DEBUG HqlSqlBaseWalker:128 - query() >> end, level = 1
            21:27:34,653 DEBUG AST:193 - --- SQL AST ---
            \-[SELECT] QueryNode: 'SELECT' querySpaces (grouping)
            +-[SELECT_CLAUSE] SelectClause: '{select clause}'
            | +-[SQL_TOKEN] IdentNode: 'grouping0_.group_name' {originalText=groupingName}
            | \-[SELECT_COLUMNS] SqlNode: ' as col_0_0_'
            +-[FROM] FromClause: 'FROM' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[], fromElementByTableAlias=[grouping0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
            | \-[FROM_FRAGMENT] FromElement: 'grouping grouping0_' FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=gro uping,tableAlias=grouping0_,colums={,className=com .tougher.intranet.employee.grouping.Grouping}}
            \-[WHERE] SqlNode: 'WHERE'
            \-[EQ] SqlNode: '='
            +-[METHOD_CALL] MethodNode: '('
            | +-[METHOD_NAME] IdentNode: 'UPPER' {originalText=UPPER}
            | \-[EXPR_LIST] SqlNode: 'exprList'
            | \-[IDENT] IdentNode: 'group_name' {originalText=group_name}
            \-[METHOD_CALL] MethodNode: '('
            +-[METHOD_NAME] IdentNode: 'UPPER' {originalText=UPPER}
            \-[EXPR_LIST] SqlNode: 'exprList'
            \-[NAMED_PARAM] SqlNode: '?'

            21:27:34,653 DEBUG ErrorCounter:72 - throwQueryException() : no errors
            21:27:34,653 DEBUG QueryTranslatorImpl:177 - HQL:
            SELECT groupingName FROM com.tougher.intranet.employee.grouping.Grouping WHERE UPPER(group_name) = UPPER(:groupingName)

            21:27:34,663 DEBUG QueryTranslatorImpl:178 - SQL: select grouping0_.group_name as col_0_0_ from grouping grouping0_ where upper(group_name)=upper(?)
            21:27:34,663 DEBUG ErrorCounter:72 - throwQueryException() : no errors
            21:27:34,663 DEBUG SessionFactoryImpl:386 - Checking named query: getGroupingList
            21:27:34,663 DEBUG QueryTranslatorImpl:207 - parse() - HQL:
            from com.tougher.intranet.employee.grouping.Grouping WHERE group_code>0 order by group_name

            21:27:34,663 DEBUG AST:223 - --- HQL AST ---
            \-[QUERY] 'query'
            +-[SELECT_FROM] 'SELECT_FROM'
            | \-[FROM] 'from'
            | \-[RANGE] 'RANGE'
            | \-[DOT] '.'
            | +-[DOT] '.'
            | | +-[DOT] '.'
            | | | +-[DOT] '.'
            | | | | +-[DOT] '.'
            | | | | | +-[IDENT] 'com'
            | | | | | \-[IDENT] 'tougher'
            | | | | \-[IDENT] 'intranet'
            | | | \-[IDENT] 'employee'
            | | \-[IDENT] 'grouping'
            | \-[IDENT] 'Grouping'
            +-[WHERE] 'WHERE'
            | \-[GT] '>'
            | +-[IDENT] 'group_code'
            | \-[NUM_INT] '0'
            \-[ORDER] 'order'
            \-[IDENT] 'group_name'

            21:27:34,673 DEBUG ErrorCounter:72 - throwQueryException() : no errors
            21:27:34,673 DEBUG HqlSqlBaseWalker:120 - query() << begin, level = 1
            21:27:34,673 DEBUG FromElement:88 - FromClause{level=1} : com.tougher.intranet.employee.grouping.Grouping (no alias) -> grouping0_
            21:27:34,703 DEBUG HqlSqlBaseWalker:125 - query() : finishing up , level = 1
            21:27:34,703 DEBUG HqlSqlWalker:331 - processQuery() : ( SELECT ( FromClause{level=1} grouping grouping0_ ) ( WHERE ( > group_code 0 ) ) ( order group_name ) )
            21:27:34,713 DEBUG HqlSqlWalker:451 - Derived SELECT clause created.
            21:27:34,713 DEBUG JoinProcessor:112 - Using FROM fragment [grouping grouping0_]
            21:27:34,713 DEBUG HqlSqlBaseWalker:128 - query() >> end, level = 1
            21:27:34,723 DEBUG AST:193 - --- SQL AST ---
            \-[SELECT] QueryNode: 'SELECT' querySpaces (grouping)
            +-[SELECT_CLAUSE] SelectClause: '{derived select clause}'
            | +-[SELECT_EXPR] SelectExpressionImpl: 'grouping0_.group_code as group1_' {FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=gro uping,tableAlias=grouping0_,colums={,className=com .tougher.intranet.employee.grouping.Grouping}}}
            | \-[SQL_TOKEN] SqlFragment: 'grouping0_.group_name as group2_0_'
            +-[FROM] FromClause: 'from' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[], fromElementByTableAlias=[grouping0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
            | \-[FROM_FRAGMENT] FromElement: 'grouping grouping0_' FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=gro uping,tableAlias=grouping0_,colums={,className=com .tougher.intranet.employee.grouping.Grouping}}
            +-[WHERE] SqlNode: 'WHERE'
            | \-[GT] SqlNode: '>'
            | +-[IDENT] IdentNode: 'group_code' {originalText=group_code}
            | \-[NUM_INT] LiteralNode: '0'
            \-[ORDER] OrderByClause: 'order'
            \-[IDENT] IdentNode: 'group_name' {originalText=group_name}

            21:27:34,723 DEBUG ErrorCounter:72 - throwQueryException() : no errors
            21:27:34,723 DEBUG QueryTranslatorImpl:177 - HQL:
            from com.tougher.intranet.employee.grouping.Grouping WHERE group_code>0 order by group_name

            21:27:34,723 DEBUG QueryTranslatorImpl:178 - SQL: select grouping0_.group_code as group1_, grouping0_.group_name as group2_0_ from grouping grouping0_ where group_code>0 order by group_name
            21:27:34,723 DEBUG ErrorCounter:72 - throwQueryException() : no errors
            21:27:34,723 DEBUG SessionFactoryImpl:386 - Checking named query: getGroupingListSubset
            21:27:34,733 DEBUG QueryTranslatorImpl:207 - parse() - HQL:
            from com.tougher.intranet.employee.grouping.Grouping WHERE UPPER(group_name) LIKE UPPER(:substring) AND group_code>0 ORDER by group_name

            21:27:34,733 DEBUG AST:223 - --- HQL AST ---
            \-[QUERY] 'query'
            +-[SELECT_FROM] 'SELECT_FROM'
            | \-[FROM] 'from'
            | \-[RANGE] 'RANGE'
            | \-[DOT] '.'
            | +-[DOT] '.'
            | | +-[DOT] '.'
            | | | +-[DOT] '.'
            | | | | +-[DOT] '.'
            | | | | | +-[IDENT] 'com'
            | | | | | \-[IDENT] 'tougher'
            | | | | \-[IDENT] 'intranet'
            | | | \-[IDENT] 'employee'
            | | \-[IDENT] 'grouping'
            | \-[IDENT] 'Grouping'
            +-[WHERE] 'WHERE'
            | \-[AND] 'AND'
            | +-[LIKE] 'like'
            | | +-[METHOD_CALL] '('
            | | | +-[IDENT] 'UPPER'
            | | | \-[EXPR_LIST] 'exprList'
            | | | \-[IDENT] 'group_name'
            | | \-[METHOD_CALL] '('
            | | +-[IDENT] 'UPPER'
            | | \-[EXPR_LIST] 'exprList'
            | | \-[COLON] ':'
            | | \-[IDENT] 'substring'
            | \-[GT] '>'
            | +-[IDENT] 'group_code'
            | \-[NUM_INT] '0'
            \-[ORDER] 'ORDER'
            \-[IDENT] 'group_name'

            21:27:34,733 DEBUG ErrorCounter:72 - throwQueryException() : no errors
            21:27:34,733 DEBUG HqlSqlBaseWalker:120 - query() << begin, level = 1
            21:27:34,733 DEBUG FromElement:88 - FromClause{level=1} : com.tougher.intranet.employee.grouping.Grouping (no alias) -> grouping0_
            21:27:34,743 DEBUG HqlSqlBaseWalker:125 - query() : finishing up , level = 1
            21:27:34,743 DEBUG HqlSqlWalker:331 - processQuery() : ( SELECT ( FromClause{level=1} grouping grouping0_ ) ( WHERE ( AND ( like ( ( UPPER ( exprList group_name ) ) ( ( UPPER ( exprList ? ) ) ) ( > group_code 0 ) ) ) ( ORDER group_name ) )
            21:27:34,753 DEBUG HqlSqlWalker:451 - Derived SELECT clause created.
            21:27:34,753 DEBUG JoinProcessor:112 - Using FROM fragment [grouping grouping0_]
            21:27:34,753 DEBUG HqlSqlBaseWalker:128 - query() >> end, level = 1
            21:27:34,753 DEBUG AST:193 - --- SQL AST ---
            \-[SELECT] QueryNode: 'SELECT' querySpaces (grouping)
            +-[SELECT_CLAUSE] SelectClause: '{derived select clause}'
            | +-[SELECT_EXPR] SelectExpressionImpl: 'grouping0_.group_code as group1_' {FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=gro uping,tableAlias=grouping0_,colums={,className=com .tougher.intranet.employee.grouping.Grouping}}}
            | \-[SQL_TOKEN] SqlFragment: 'grouping0_.group_name as group2_0_'
            +-[FROM] FromClause: 'from' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[], fromElementByTableAlias=[grouping0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
            | \-[FROM_FRAGMENT] FromElement: 'grouping grouping0_' FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=gro uping,tableAlias=grouping0_,colums={,className=com .tougher.intranet.employee.grouping.Grouping}}
            +-[WHERE] SqlNode: 'WHERE'
            | \-[AND] SqlNode: 'AND'
            | +-[LIKE] SqlNode: 'like'
            | | +-[METHOD_CALL] MethodNode: '('
            | | | +-[METHOD_NAME] IdentNode: 'UPPER' {originalText=UPPER}
            | | | \-[EXPR_LIST] SqlNode: 'exprList'
            | | | \-[IDENT] IdentNode: 'group_name' {originalText=group_name}
            | | \-[METHOD_CALL] MethodNode: '('
            | | +-[METHOD_NAME] IdentNode: 'UPPER' {originalText=UPPER}
            | | \-[EXPR_LIST] SqlNode: 'exprList'
            | | \-[NAMED_PARAM] SqlNode: '?'
            | \-[GT] SqlNode: '>'
            | +-[IDENT] IdentNode: 'group_code' {originalText=group_code}
            | \-[NUM_INT] LiteralNode: '0'
            \-[ORDER] OrderByClause: 'ORDER'
            \-[IDENT] IdentNode: 'group_name' {originalText=group_name}

            21:27:34,763 DEBUG ErrorCounter:72 - throwQueryException() : no errors
            21:27:34,763 DEBUG QueryTranslatorImpl:177 - HQL:
            from com.tougher.intranet.employee.grouping.Grouping WHERE UPPER(group_name) LIKE UPPER(:substring) AND group_code>0 ORDER by group_name

            21:27:34,763 DEBUG QueryTranslatorImpl:178 - SQL: select grouping0_.group_code as group1_, grouping0_.group_name as group2_0_ from grouping grouping0_ where (upper(group_name)like upper(?)) and group_code>0 order by group_name
            21:27:34,763 DEBUG ErrorCounter:72 - throwQueryException() : no errors
            21:27:34,763 DEBUG SessionFactoryImpl:386 - Checking named query: getGroupingListSubsetCount
            21:27:34,773 DEBUG QueryTranslatorImpl:207 - parse() - HQL:
            select count(*) from com.tougher.intranet.employee.grouping.Grouping WHERE UPPER(group_name) LIKE UPPER(:substring) AND group_code>0 ORDER by group_name

            21:27:34,773 DEBUG AST:223 - --- HQL AST ---
            \-[QUERY] 'query'
            +-[SELECT_FROM] 'SELECT_FROM'
            | +-[FROM] 'from'
            | | \-[RANGE] 'RANGE'
            | | \-[DOT] '.'
            | | +-[DOT] '.'
            | | | +-[DOT] '.'
            | | | | +-[DOT] '.'
            | | | | | +-[DOT] '.'
            | | | | | | +-[IDENT] 'com'
            | | | | | | \-[IDENT] 'tougher'
            | | | | | \-[IDENT] 'intranet'
            | | | | \-[IDENT] 'employee'
            | | | \-[IDENT] 'grouping'
            | | \-[IDENT] 'Grouping'
            | \-[SELECT] 'select'
            | \-[COUNT] 'count'
            | \-[ROW_STAR] '*'
            +-[WHERE] 'WHERE'
            | \-[AND] 'AND'
            | +-[LIKE] 'like'
            | | +-[METHOD_CALL] '('
            | | | +-[IDENT] 'UPPER'
            | | | \-[EXPR_LIST] 'exprList'
            | | | \-[IDENT] 'group_name'
            | | \-[METHOD_CALL] '('
            | | +-[IDENT] 'UPPER'
            | | \-[EXPR_LIST] 'exprList'
            | | \-[COLON] ':'
            | | \-[IDENT] 'substring'
            | \-[GT] '>'
            | +-[IDENT] 'group_code'
            | \-[NUM_INT] '0'
            \-[ORDER] 'ORDER'
            \-[IDENT] 'group_name'

            21:27:34,773 DEBUG ErrorCounter:72 - throwQueryException() : no errors
            21:27:34,773 DEBUG HqlSqlBaseWalker:120 - query() << begin, level = 1
            21:27:34,773 DEBUG FromElement:88 - FromClause{level=1} : com.tougher.intranet.employee.grouping.Grouping (no alias) -> grouping0_
            21:27:34,783 DEBUG HqlSqlBaseWalker:125 - query() : finishing up , level = 1
            21:27:34,783 DEBUG HqlSqlWalker:331 - processQuery() : ( SELECT ( {select clause} ( count * ) ) ( FromClause{level=1} grouping grouping0_ ) ( WHERE ( AND ( like ( ( UPPER ( exprList group_name ) ) ( ( UPPER ( exprList ? ) ) ) ( > group_code 0 ) ) ) ( ORDER group_name ) )
            21:27:34,783 DEBUG JoinProcessor:112 - Using FROM fragment [grouping grouping0_]
            21:27:34,793 DEBUG HqlSqlBaseWalker:128 - query() >> end, level = 1
            21:27:34,793 DEBUG AST:193 - --- SQL AST ---
            \-[SELECT] QueryNode: 'SELECT' querySpaces (grouping)
            +-[SELECT_CLAUSE] SelectClause: '{select clause}'
            | +-[COUNT] CountNode: 'count'
            | | \-[ROW_STAR] SqlNode: '*'
            | \-[SELECT_COLUMNS] SqlNode: ' as col_0_0_'
            +-[FROM] FromClause: 'from' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[], fromElementByTableAlias=[grouping0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
            | \-[FROM_FRAGMENT] FromElement: 'grouping grouping0_' FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=gro uping,tableAlias=grouping0_,colums={,className=com .tougher.intranet.employee.grouping.Grouping}}
            +-[WHERE] SqlNode: 'WHERE'
            | \-[AND] SqlNode: 'AND'
            | +-[LIKE] SqlNode: 'like'
            | | +-[METHOD_CALL] MethodNode: '('
            | | | +-[METHOD_NAME] IdentNode: 'UPPER' {originalText=UPPER}
            | | | \-[EXPR_LIST] SqlNode: 'exprList'
            | | | \-[IDENT] IdentNode: 'group_name' {originalText=group_name}
            | | \-[METHOD_CALL] MethodNode: '('
            | | +-[METHOD_NAME] IdentNode: 'UPPER' {originalText=UPPER}
            | | \-[EXPR_LIST] SqlNode: 'exprList'
            | | \-[NAMED_PARAM] SqlNode: '?'
            | \-[GT] SqlNode: '>'
            | +-[IDENT] IdentNode: 'group_code' {originalText=group_code}
            | \-[NUM_INT] LiteralNode: '0'
            \-[ORDER] OrderByClause: 'ORDER'
            \-[IDENT] IdentNode: 'group_name' {originalText=group_name}

            21:27:34,793 DEBUG ErrorCounter:72 - throwQueryException() : no errors
            21:27:34,793 DEBUG QueryTranslatorImpl:177 - HQL:
            select count(*) from com.tougher.intranet.employee.grouping.Grouping WHERE UPPER(group_name) LIKE UPPER(:substring) AND group_code>0 ORDER by group_name

            21:27:34,793 DEBUG QueryTranslatorImpl:178 - SQL: select count(*) as col_0_0_ from grouping grouping0_ where (upper(group_name)like upper(?)) and group_code>0 order by group_name
            21:27:34,803 DEBUG ErrorCounter:72 - throwQueryException() : no errors
            21:27:35,304 DEBUG SessionImpl:250 - opened session at timestamp: 4618137007120384
            21:27:35,344 DEBUG SessionImpl:829 - find:
            from Grouping WHERE UPPER(group_name) LIKE UPPER(:substring) AND group_code>0 ORDER by group_name

            21:27:35,344 DEBUG QueryParameters:224 - named parameters: {substring=%eA%}
            21:27:35,344 DEBUG QueryTranslatorImpl:113 - compile() : The query is already compiled, skipping...
            21:27:35,454 DEBUG AbstractBatcher:290 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
            21:27:35,454 DEBUG ConnectionManager:296 - opening JDBC connection
            21:27:35,474 DEBUG SQL:324 - select grouping0_.group_code as group1_, grouping0_.group_name as group2_0_ from grouping grouping0_ where (upper(group_name)like upper(?)) and group_code>0 order by group_name limit ?
            21:27:35,474 DEBUG AbstractBatcher:378 - preparing statement
            21:27:35,494 DEBUG JDBCExceptionReporter:63 - SQL Exception
            java.sql.SQLException: Syntax error or access violation message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1"
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:2551)
            at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:14 43)
            at com.mysql.jdbc.ServerPreparedStatement.serverPrepa re(ServerPreparedStatement.java:1378)
            at com.mysql.jdbc.ServerPreparedStatement.<init>(Serv erPreparedStatement.java:140)
            at com.mysql.jdbc.Connection.prepareStatement(Connect ion.java:1286)
            at com.mysql.jdbc.Connection.prepareStatement(Connect ion.java:1258)
            at org.hibernate.jdbc.AbstractBatcher.getPreparedStat ement(AbstractBatcher.java:396)
            at org.hibernate.jdbc.AbstractBatcher.getPreparedStat ement(AbstractBatcher.java:334)
            at org.hibernate.jdbc.AbstractBatcher.prepareQuerySta tement(AbstractBatcher.java:88)
            at org.hibernate.loader.Loader.prepareQueryStatement( Loader.java:1162)
            at org.hibernate.loader.Loader.doQuery(Loader.java:39 0)
            at org.hibernate.loader.Loader.doQueryAndInitializeNo nLazyCollections(Loader.java:218)
            at org.hibernate.loader.Loader.doList(Loader.java:159 3)
            at org.hibernate.loader.Loader.list(Loader.java:1577)
            at org.hibernate.loader.hql.QueryLoader.list(QueryLoa der.java:395)
            at org.hibernate.hql.ast.QueryTranslatorImpl.list(Que ryTranslatorImpl.java:271)
            at org.hibernate.impl.SessionImpl.list(SessionImpl.ja va:844)
            at org.hibernate.impl.QueryImpl.list(QueryImpl.java:7 4)
            at com.tougher.intranet.employee.grouping.GroupingDAO Hibernate$1.doInHibernate(GroupingDAOHibernate.jav a:36)
            at org.springframework.orm.hibernate3.HibernateTempla te.execute(HibernateTemplate.java:358)
            at org.springframework.orm.hibernate3.HibernateTempla te.executeFind(HibernateTemplate.java:335)
            at com.tougher.intranet.employee.grouping.GroupingDAO Hibernate.getGroupingListSubset(GroupingDAOHiberna te.java:30)
            at com.tougher.intranet.employee.grouping.GroupingFac ade.getGroupingListSubset(GroupingFacade.java:77)
            at com.tougher.intranet.employee.grouping.testing.Gro upingFacadeTest.testgetGroupingListWithSubstring(G roupingFacadeTest.java:96)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at junit.framework.TestCase.runTest(TestCase.java:154 )
            at junit.framework.TestCase.runBare(TestCase.java:127 )
            at junit.framework.TestResult$1.protect(TestResult.ja va:106)
            at junit.framework.TestResult.runProtected(TestResult .java:124)
            at junit.framework.TestResult.run(TestResult.java:109 )
            at junit.framework.TestCase.run(TestCase.java:118)
            at junit.framework.TestSuite.runTest(TestSuite.java:2 08)
            at junit.framework.TestSuite.run(TestSuite.java:203)
            at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:474)
            at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:342)
            at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:194)
            21:27:35,494 WARN JDBCExceptionReporter:71 - SQL Error: 1064, SQLState: 42000
            21:27:35,494 ERROR JDBCExceptionReporter:72 - Syntax error or access violation message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1"
            21:27:35,504 DEBUG JDBCExceptionReporter:63 - could not execute query [select grouping0_.group_code as group1_, grouping0_.group_name as group2_0_ from grouping grouping0_ where (upper(group_name)like upper(?)) and group_code>0 order by group_name]
            java.sql.SQLException: Syntax error or access violation message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1"
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:2551)
            at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:14 43)
            at com.mysql.jdbc.ServerPreparedStatement.serverPrepa re(ServerPreparedStatement.java:1378)
            at com.mysql.jdbc.ServerPreparedStatement.<init>(Serv erPreparedStatement.java:140)
            at com.mysql.jdbc.Connection.prepareStatement(Connect ion.java:1286)
            at com.mysql.jdbc.Connection.prepareStatement(Connect ion.java:1258)
            at org.hibernate.jdbc.AbstractBatcher.getPreparedStat ement(AbstractBatcher.java:396)
            at org.hibernate.jdbc.AbstractBatcher.getPreparedStat ement(AbstractBatcher.java:334)
            at org.hibernate.jdbc.AbstractBatcher.prepareQuerySta tement(AbstractBatcher.java:88)
            at org.hibernate.loader.Loader.prepareQueryStatement( Loader.java:1162)
            at org.hibernate.loader.Loader.doQuery(Loader.java:39 0)
            at org.hibernate.loader.Loader.doQueryAndInitializeNo nLazyCollections(Loader.java:218)
            at org.hibernate.loader.Loader.doList(Loader.java:159 3)
            at org.hibernate.loader.Loader.list(Loader.java:1577)
            at org.hibernate.loader.hql.QueryLoader.list(QueryLoa der.java:395)
            at org.hibernate.hql.ast.QueryTranslatorImpl.list(Que ryTranslatorImpl.java:271)
            at org.hibernate.impl.SessionImpl.list(SessionImpl.ja va:844)
            at org.hibernate.impl.QueryImpl.list(QueryImpl.java:7 4)
            at com.tougher.intranet.employee.grouping.GroupingDAO Hibernate$1.doInHibernate(GroupingDAOHibernate.jav a:36)
            at org.springframework.orm.hibernate3.HibernateTempla te.execute(HibernateTemplate.java:358)
            at org.springframework.orm.hibernate3.HibernateTempla te.executeFind(HibernateTemplate.java:335)
            at com.tougher.intranet.employee.grouping.GroupingDAO Hibernate.getGroupingListSubset(GroupingDAOHiberna te.java:30)
            at com.tougher.intranet.employee.grouping.GroupingFac ade.getGroupingListSubset(GroupingFacade.java:77)
            at com.tougher.intranet.employee.grouping.testing.Gro upingFacadeTest.testgetGroupingListWithSubstring(G roupingFacadeTest.java:96)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at junit.framework.TestCase.runTest(TestCase.java:154 )
            at junit.framework.TestCase.runBare(TestCase.java:127 )
            at junit.framework.TestResult$1.protect(TestResult.ja va:106)
            at junit.framework.TestResult.runProtected(TestResult .java:124)
            at junit.framework.TestResult.run(TestResult.java:109 )
            at junit.framework.TestCase.run(TestCase.java:118)
            at junit.framework.TestSuite.runTest(TestSuite.java:2 08)
            at junit.framework.TestSuite.run(TestSuite.java:203)
            at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:474)
            at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:342)
            at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:194)
            21:27:35,525 WARN JDBCExceptionReporter:71 - SQL Error: 1064, SQLState: 42000
            21:27:35,525 ERROR JDBCExceptionReporter:72 - Syntax error or access violation message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1"
            21:27:35,525 DEBUG JDBCContext:322 - after autocommit
            21:27:35,535 DEBUG SessionImpl:403 - after transaction completion
            21:27:35,535 DEBUG SessionImpl:269 - closing session
            21:27:35,535 DEBUG ConnectionManager:317 - closing JDBC connection [ (open PreparedStatements: 1, globally: 1) (open ResultSets: 0, globally: 0)]
            21:27:35,535 DEBUG JDBCContext:283 - after transaction completion
            21:27:35,535 DEBUG SessionImpl:403 - after transaction completion

            Comment


            • #7
              yatesco:

              the query that I used is stated in my first post.
              I've used named parameters.

              Comment


              • #8
                I found the following: http://bugs.mysql.com/bug.php?id=4718

                It seems that MySQL had an issue with LIMIT - could you check that your MySQL version contains a correction of the issue?

                Erik

                Comment


                • #9
                  ErikFK,

                  That's right on the spot! Your good.

                  The frustrating thing is I've already encountered this problem before.
                  I haven't thought of it because the old version of the app is working, because the connect string is in a property file. When I tried porting it to Spring, the connect string is in another xml file.

                  Thanks for the help. Really appreciate it.

                  Comment

                  Working...
                  X