If I select all the column then its working fine.
Code:
<sql-query name="catalogBySeason">
<return class="testhibernateapp.Catalog" alias="c"/>
SELECT p.I_COMPANY ,p.I_SEASON,p.I_CATALOG,p.S_CATALOGNAME,p.I_CIRCULATION_ACT FROM P_CATALOG p
</sql-query>
But If I miss any one of the column then its complaining.
Code:
<sql-query name="catalogBySeason">
<return class="testhibernateapp.Catalog" alias="c"/>
SELECT p.I_COMPANY, p.I_SEASON FROM P_CATALOG p
</sql-query>
Code:
Hibernate:
SELECT
p.I_COMPANY ,
p.I_SEASON
FROM
P_CATALOG p
Feb 5, 2009 2:29:04 PM org.hibernate.type.NullableType nullSafeGet
INFO: could not read column value from result set: I_CATALOG; Invalid column name
Feb 5, 2009 2:29:04 PM org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 17006, SQLState: null
Feb 5, 2009 2:29:04 PM org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: Invalid column name
Exception :org.hibernate.exception.GenericJDBCException: could not execute query