Hi,
here is the log message. Can you please help find where the error is as am unable to find it.
I did try " select count(*) " in mysql i got the correct result.
11:54:22,353 DEBUG DTDEntityResolver:22 - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd]
11:54:22,353 DEBUG DTDEntityResolver:24 - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
11:54:22,353 DEBUG DTDEntityResolver:34 - located [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] in classpath
11:54:22,673 DEBUG Configuration:1269 - hibernate.connection.driver_class=com.mysql.jdbc.Driver
11:54:22,673 DEBUG Configuration:1269 - hibernate.connection.url=jdbc:mysql:///test
11:54:22,683 DEBUG Configuration:1269 - hibernate.connection.username=root
11:54:22,683 DEBUG Configuration:1269 - hibernate.connection.password=pwd
11:54:22,723 DEBUG Configuration:1269 - dialect=org.hibernate.dialect.MySQLDialect
11:54:22,723 DEBUG Configuration:1269 - current_session_context_class=thread
11:54:22,723 DEBUG Configuration:1269 - connection.pool_size=1
11:54:22,723 DEBUG Configuration:1269 - hbm2ddl.auto=create
11:54:22,723 DEBUG Configuration:1269 - cache.provider_class=org.hibernate.cache.NoCacheProvider
11:54:22,743 DEBUG Configuration:1269 - show_sql=true
11:54:22,803 DEBUG Configuration:1269 - hbm2ddl.auto=create
11:54:22,834 DEBUG Configuration:1269 - transaction.factory_class=org.hibernate.transaction.JDBCTransactionFactory
11:54:22,834 DEBUG Configuration:1464 - null<-org.dom4j.tree.DefaultAttribute@10ef90c [Attribute: name resource value "pack/Hris.hbm.xml"]
11:54:22,834 INFO Configuration:469 - Reading mappings from resource: pack/Hris.hbm.xml
11:54:22,854 DEBUG DTDEntityResolver:22 - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]
11:54:22,854 DEBUG DTDEntityResolver:24 - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
11:54:22,864 DEBUG DTDEntityResolver:34 - located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath
11:54:23,855 INFO HbmBinder:309 - Mapping class: pack.Hris -> candidate
11:54:23,905 DEBUG HbmBinder:1261 - Mapped property: id -> candidateid
11:54:23,995 DEBUG HbmBinder:1261 - Mapped property: firstname -> firstname
11:54:24,005 DEBUG HbmBinder:1261 - Mapped property: lastname -> lastname
11:54:24,005 DEBUG HbmBinder:1261 - Mapped property: state -> state
11:54:24,005 INFO Configuration:1419 - Configured SessionFactory: null
11:54:24,025 DEBUG Configuration:1167 - Preparing to build session factory with filters : {}
11:54:24,035 DEBUG Configuration:1002 - processing extends queue
11:54:24,035 DEBUG Configuration:1006 - processing collection mappings
11:54:24,035 DEBUG Configuration:1017 - processing native query and ResultSetMapping mappings
11:54:24,035 DEBUG Configuration:1025 - processing association property references
11:54:24,035 DEBUG Configuration:1047 - processing foreign key constraints
11:54:24,596 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
11:54:24,596 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 1
11:54:24,606 INFO DriverManagerConnectionProvider:45 - autocommit mode: false
11:54:24,666 INFO DriverManagerConnectionProvider:80 - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql:///test
11:54:24,666 INFO DriverManagerConnectionProvider:83 - connection properties: {user=root, password=pwd}
11:54:24,666 DEBUG DriverManagerConnectionProvider:93 - total checked-out connections: 0
11:54:24,666 DEBUG DriverManagerConnectionProvider:109 - opening new JDBC connection
11:54:26,479 DEBUG DriverManagerConnectionProvider:115 - created connection to: jdbc:mysql:///test, Isolation Level: 4
11:54:26,489 INFO SettingsFactory:77 - RDBMS: MySQL, version: 4.1.15-nt
11:54:26,489 INFO SettingsFactory:78 - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.13 ( $Date: 2005-11-17 15:53:48 +0100 (Thu, 17 Nov 2005) $, $Revision$ )
11:54:26,489 DEBUG DriverManagerConnectionProvider:129 - returning connection to pool, pool size: 1
11:54:26,609 INFO Dialect:103 - Using dialect: org.hibernate.dialect.MySQLDialect
11:54:26,649 INFO TransactionFactoryFactory:34 - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
11:54:26,659 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
11:54:26,669 INFO SettingsFactory:125 - Automatic flush during beforeCompletion(): disabled
11:54:26,669 INFO SettingsFactory:129 - Automatic session close at end of transaction: disabled
11:54:26,669 INFO SettingsFactory:136 - JDBC batch size: 15
11:54:26,679 INFO SettingsFactory:139 - JDBC batch updates for versioned data: disabled
11:54:26,679 INFO SettingsFactory:144 - Scrollable result sets: enabled
11:54:26,679 DEBUG SettingsFactory:148 - Wrap result sets: disabled
11:54:26,679 INFO SettingsFactory:152 - JDBC3 getGeneratedKeys(): enabled
11:54:26,689 INFO SettingsFactory:160 - Connection release mode: auto
11:54:26,689 INFO SettingsFactory:184 - Maximum outer join fetch depth: 2
11:54:26,689 INFO SettingsFactory:187 - Default batch fetch size: 1
11:54:26,699 INFO SettingsFactory:191 - Generate SQL with comments: disabled
11:54:26,699 INFO SettingsFactory:195 - Order SQL updates by primary key: disabled
11:54:26,699 INFO SettingsFactory:338 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
11:54:26,709 INFO ASTQueryTranslatorFactory:24 - Using ASTQueryTranslatorFactory
11:54:26,719 INFO SettingsFactory:203 - Query language substitutions: {}
11:54:26,729 INFO SettingsFactory:209 - Second-level cache: enabled
11:54:26,739 INFO SettingsFactory:213 - Query cache: disabled
11:54:26,749 INFO SettingsFactory:325 - Cache provider: org.hibernate.cache.NoCacheProvider
11:54:26,759 INFO SettingsFactory:228 - Optimize cache for minimal puts: disabled
11:54:26,769 INFO SettingsFactory:237 - Structured second-level cache entries: disabled
11:54:26,779 DEBUG SQLExceptionConverterFactory:52 - Using dialect defined converter
11:54:26,799 INFO SettingsFactory:257 - Echoing all SQL to stdout
11:54:26,799 INFO SettingsFactory:264 - Statistics: disabled
11:54:26,799 INFO SettingsFactory:268 - Deleted entity synthetic identifier rollback: disabled
11:54:26,799 INFO SettingsFactory:283 - Default entity-mode: pojo
11:54:27,020 INFO SessionFactoryImpl:154 - building session factory
11:54:27,030 DEBUG SessionFactoryImpl:165 - Session factory
11:54:28,872 DEBUG AbstractEntityPersister:2447 - Static SQL for entity: pack.Hris
11:54:28,882 DEBUG AbstractEntityPersister:2449 - Version select: select candidateid from candidate where candidateid =?
11:54:28,882 DEBUG AbstractEntityPersister:2450 - Snapshot select: select hris_.candidateid, hris_.firstname as firstname0_, hris_.lastname as lastname0_, hris_.state as state0_ from candidate hris_ where hris_.candidateid=?
11:54:28,882 DEBUG AbstractEntityPersister:2452 - Insert 0: insert into candidate (firstname, lastname, state, candidateid) values (?, ?, ?, ?)
11:54:28,882 DEBUG AbstractEntityPersister:2453 - Update 0: update candidate set firstname=?, lastname=?, state=? where candidateid=?
11:54:28,882 DEBUG AbstractEntityPersister:2454 - Delete 0: delete from candidate where candidateid=?
11:54:28,882 DEBUG AbstractEntityPersister:2457 - Identity insert: insert into candidate (firstname, lastname, state) values (?, ?, ?)
11:54:29,052 DEBUG EntityLoader:79 - Static select for entity pack.Hris: select hris0_.candidateid as candidat1_0_0_, hris0_.firstname as firstname0_0_, hris0_.lastname as lastname0_0_, hris0_.state as state0_0_ from candidate hris0_ where hris0_.candidateid=?
11:54:29,052 DEBUG EntityLoader:79 - Static select for entity pack.Hris: select hris0_.candidateid as candidat1_0_0_, hris0_.firstname as firstname0_0_, hris0_.lastname as lastname0_0_, hris0_.state as state0_0_ from candidate hris0_ where hris0_.candidateid=?
11:54:29,052 DEBUG EntityLoader:79 - Static select for entity pack.Hris: select hris0_.candidateid as candidat1_0_0_, hris0_.firstname as firstname0_0_, hris0_.lastname as lastname0_0_, hris0_.state as state0_0_ from candidate hris0_ where hris0_.candidateid=? for update
11:54:29,062 DEBUG EntityLoader:79 - Static select for entity pack.Hris: select hris0_.candidateid as candidat1_0_0_, hris0_.firstname as firstname0_0_, hris0_.lastname as lastname0_0_, hris0_.state as state0_0_ from candidate hris0_ where hris0_.candidateid=? for update
11:54:29,123 DEBUG EntityLoader:34 - Static select for action ACTION_MERGE on entity pack.Hris: select hris0_.candidateid as candidat1_0_0_, hris0_.firstname as firstname0_0_, hris0_.lastname as lastname0_0_, hris0_.state as state0_0_ from candidate hris0_ where hris0_.candidateid=?
11:54:29,123 DEBUG EntityLoader:34 - Static select for action ACTION_REFRESH on entity pack.Hris: select hris0_.candidateid as candidat1_0_0_, hris0_.firstname as firstname0_0_, hris0_.lastname as lastname0_0_, hris0_.state as state0_0_ from candidate hris0_ where hris0_.candidateid=?
11:54:29,193 DEBUG SessionFactoryObjectFactory:39 - initializing class SessionFactoryObjectFactory
11:54:29,213 DEBUG SessionFactoryObjectFactory:76 - registered: 40288fe40d8ec7e2010d8ec7eb030000 (unnamed)
11:54:29,223 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured
11:54:29,223 DEBUG SessionFactoryImpl:293 - instantiated session factory
11:54:29,253 DEBUG Configuration:1002 - processing extends queue
11:54:29,253 DEBUG Configuration:1006 - processing collection mappings
11:54:29,253 DEBUG Configuration:1017 - processing native query and ResultSetMapping mappings
11:54:29,253 DEBUG Configuration:1025 - processing association property references
11:54:29,253 DEBUG Configuration:1047 - processing foreign key constraints
11:54:29,253 DEBUG Configuration:1002 - processing extends queue
11:54:29,263 DEBUG Configuration:1006 - processing collection mappings
11:54:29,263 DEBUG Configuration:1017 - processing native query and ResultSetMapping mappings
11:54:29,263 DEBUG Configuration:1025 - processing association property references
11:54:29,263 DEBUG Configuration:1047 - processing foreign key constraints
11:54:29,263 INFO SchemaExport:152 - Running hbm2ddl schema export
11:54:29,273 DEBUG SchemaExport:168 - import file not found: /import.sql
11:54:29,273 INFO SchemaExport:177 - exporting generated schema to database
11:54:29,273 DEBUG DriverManagerConnectionProvider:93 - total checked-out connections: 0
11:54:29,273 DEBUG DriverManagerConnectionProvider:99 - using pooled JDBC connection, pool size: 0
11:54:29,283 DEBUG SchemaExport:301 - drop table if exists candidate
11:54:29,373 DEBUG SchemaExport:301 - create table candidate (candidateid bigint not null auto_increment, firstname varchar(30), lastname varchar(30), state varchar(2), primary key (candidateid))
11:54:29,463 INFO SchemaExport:194 - schema export complete
11:54:29,463 DEBUG DriverManagerConnectionProvider:129 - returning connection to pool, pool size: 1
11:54:29,493 DEBUG SessionFactoryImpl:354 - Checking 0 named HQL queries
11:54:29,493 DEBUG SessionFactoryImpl:374 - Checking 0 named SQL queries
Session factory Initialized
11:54:29,743 DEBUG SessionImpl:219 - opened session at timestamp: 11577416694
Session Initialized
11:54:29,763 DEBUG JDBCTransaction:54 - begin
11:54:29,763 DEBUG ConnectionManager:415 - opening JDBC connection
11:54:29,763 DEBUG DriverManagerConnectionProvider:93 - total checked-out connections: 0
11:54:29,763 DEBUG DriverManagerConnectionProvider:99 - using pooled JDBC connection, pool size: 0
11:54:29,763 DEBUG JDBCTransaction:59 - current autocommit status: false
11:54:29,763 DEBUG JDBCContext:194 - after transaction begin
11:54:29,804 DEBUG QueryPlanCache:69 - unable to locate HQL query plan in cache; generating (select hris from pack.Hris as hris where hris.id>100)
11:54:30,234 DEBUG QueryTranslatorImpl:236 - parse() - HQL: select hris from pack.Hris as hris where hris.id>100
11:54:30,334 DEBUG AST:252 - --- HQL AST ---
\-[QUERY] 'query'
+-[SELECT_FROM] 'SELECT_FROM'
| +-[FROM] 'from'
| | \-[RANGE] 'RANGE'
| | +-[DOT] '.'
| | | +-[IDENT] 'pack'
| | | \-[IDENT] 'Hris'
| | \-[ALIAS] 'hris'
| \-[SELECT] 'select'
| \-[IDENT] 'hris'
\-[WHERE] 'where'
\-[GT] '>'
+-[DOT] '.'
| +-[IDENT] 'hris'
| \-[IDENT] 'id'
\-[NUM_INT] '100'
11:54:30,334 DEBUG ErrorCounter:68 - throwQueryException() : no errors
11:54:30,645 DEBUG HqlSqlBaseWalker:111 - select << begin [level=1, statement=select]
11:54:30,775 DEBUG FromElement:104 - FromClause{level=1} : pack.Hris (hris) -> hris0_
11:54:30,795 DEBUG FromReferenceNode:51 - Resolved : hris -> hris0_.candidateid
11:54:30,815 DEBUG FromReferenceNode:51 - Resolved : hris -> hris0_.candidateid
11:54:30,835 DEBUG DotNode:541 - getDataType() : id -> org.hibernate.type.LongType@1f6226
11:54:30,845 DEBUG FromReferenceNode:51 - Resolved : hris.id -> hris0_.candidateid
11:54:30,855 DEBUG HqlSqlBaseWalker:117 - select : finishing up [level=1, statement=select]
11:54:30,855 DEBUG HqlSqlWalker:511 - processQuery() : ( SELECT ( {select clause} hris0_.candidateid ) ( FromClause{level=1} candidate hris0_ ) ( where ( > ( hris0_.candidateid hris0_.candidateid id ) 100 ) ) )
11:54:30,905 DEBUG JoinProcessor:128 - Using FROM fragment [candidate hris0_]
11:54:30,905 DEBUG HqlSqlBaseWalker:123 - select >> end [level=1, statement=select]
11:54:30,945 DEBUG AST:222 - --- SQL AST ---
\-[SELECT] QueryNode: 'SELECT' querySpaces (candidate)
+-[SELECT_CLAUSE] SelectClause: '{select clause}'
| +-[ALIAS_REF] IdentNode: 'hris0_.candidateid as candidat1_0_' {alias=hris, className=pack.Hris, tableAlias=hris0_}
| \-[SQL_TOKEN] SqlFragment: 'hris0_.firstname as firstname0_, hris0_.lastname as lastname0_, hris0_.state as state0_'
+-[FROM] FromClause: 'from' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[hris], fromElementByTableAlias=[hris0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
| \-[FROM_FRAGMENT] FromElement: 'candidate hris0_' FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=hris,role=null,tableName=candidate,tableAlias=hris0_,origin=null,colums={,className=pack.Hris}}
\-[WHERE] SqlNode: 'where'
\-[GT] BinaryLogicOperatorNode: '>'
+-[DOT] DotNode: 'hris0_.candidateid' {propertyName=id,dereferenceType=4,propertyPath=id,path=hris.id,tableAlias=hris0_,className=pack.Hris,classAlias=hris}
| +-[ALIAS_REF] IdentNode: 'hris0_.candidateid' {alias=hris, className=pack.Hris, tableAlias=hris0_}
| \-[IDENT] IdentNode: 'id' {originalText=id}
\-[NUM_INT] LiteralNode: '100'
11:54:30,955 DEBUG ErrorCounter:68 - throwQueryException() : no errors
11:54:31,035 DEBUG QueryTranslatorImpl:206 - HQL: select hris from pack.Hris as hris where hris.id>100
11:54:31,045 DEBUG QueryTranslatorImpl:207 - SQL: select hris0_.candidateid as candidat1_0_, hris0_.firstname as firstname0_, hris0_.lastname as lastname0_, hris0_.state as state0_ from candidate hris0_ where hris0_.candidateid>100
11:54:31,045 DEBUG ErrorCounter:68 - throwQueryException() : no errors
11:54:31,085 DEBUG HQLQueryPlan:219 - HQL param location recognition took 10 mills (select hris from pack.Hris as hris where hris.id>100)
11:54:31,176 DEBUG QueryPlanCache:75 - located HQL query plan in cache (select hris from pack.Hris as hris where hris.id>100)
11:54:31,186 DEBUG HQLQueryPlan:148 - find: select hris from pack.Hris as hris where hris.id>100
11:54:31,196 DEBUG QueryParameters:262 - named parameters: {}
11:54:31,206 DEBUG AbstractBatcher:311 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
11:54:31,206 DEBUG SQL:346 - select hris0_.candidateid as candidat1_0_, hris0_.firstname as firstname0_, hris0_.lastname as lastname0_, hris0_.state as state0_ from candidate hris0_ where hris0_.candidateid>100
Hibernate: select hris0_.candidateid as candidat1_0_, hris0_.firstname as firstname0_, hris0_.lastname as lastname0_, hris0_.state as state0_ from candidate hris0_ where hris0_.candidateid>100
11:54:31,206 DEBUG AbstractBatcher:424 - preparing statement
11:54:31,326 DEBUG AbstractBatcher:327 - about to open ResultSet (open ResultSets: 0, globally: 0)
11:54:31,326 DEBUG Loader:682 - processing result set
11:54:31,336 DEBUG Loader:709 - done processing result set (0 rows)
11:54:31,336 DEBUG AbstractBatcher:334 - about to close ResultSet (open ResultSets: 1, globally: 1)
11:54:31,336 DEBUG AbstractBatcher:319 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
11:54:31,336 DEBUG AbstractBatcher:470 - closing statement
11:54:31,346 DEBUG Loader:839 - total objects hydrated: 0
11:54:31,356 DEBUG StatefulPersistenceContext:748 - initializing non-lazy collections
The result value is : []
The list is empty:[]
11:54:31,366 DEBUG SessionImpl:268 - closing session
11:54:31,366 DEBUG ConnectionManager:374 - performing cleanup
11:54:31,366 DEBUG ConnectionManager:435 - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
11:54:31,366 DEBUG DriverManagerConnectionProvider:129 - returning connection to pool, pool size: 1
Session Closed
Please help me.
|