I get the following error:
[org.hibernate.type.StringType] - <could not read column value from result set: VALUE_DESC; >
2008-07-14 16:24:57,531 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL Error: 17006, SQLState: null>
2008-07-14 16:24:57,562 ERROR [*******.dao.hibernate.util.HibernateExceptionHandler] - <org.hibernate.exception.GenericJDBCException: could not execute query
This is the query code. When I execute the run the sql query myself, everything works fine.
Code:
StringBuffer sb = new StringBuffer();
sb.append("select cwv.id id ");
sb.append(", cwv.display_name display_name ");
sb.append(", cwv.value_desc description ");
sb.append("from cca_subjects_view cwv ");
sb.append(", cca_systems sys ");
sb.append("where cwv.sys_code = sys.code ");
sb.append("and sys.id = :sys_id ");
sb.append("order by display_name ");
Mapping file:
<class name="Subject" table="CCA_SUBJECTS_VIEW">
<id name="id" column="ID">
<generator class="increment"/>
</id>
<property name="description" not-null="true" column="VALUE_DESC" />
<property name="displayName" not-null="true" column="DISPLAY_NAME" />
</class>
What is going wrong??