[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3035) could not read column value from result set: MEDFAC1_14_0_; Invalid column name SQL Error: 17006, SQLState: null

sanjeev singh (JIRA) noreply at atlassian.com
Fri Dec 28 11:46:05 EST 2007


could not read column value from result set: MEDFAC1_14_0_; Invalid column name SQL Error: 17006, SQLState: null
----------------------------------------------------------------------------------------------------------------

                 Key: HHH-3035
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3035
             Project: Hibernate3
          Issue Type: Bug
          Components: core, query-criteria, query-hql, query-sql
    Affects Versions: 3.2.2
         Environment: JDK5 , Hibernate Junit Test case,WIndows XP
            Reporter: sanjeev singh


The following is my section of hibernate mapping file.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
	"-//Hibernate/Hibernate mapping DTD 3.0//EN"
	"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="gov.njdhss.hippocrates.ems.valueobjects">
	<class name="HeprEmsMedfacFacilityVO" table="HEPR_MEDFAC">
		<id name="medfacId" column="MEDFAC_ID" type="java.lang.Long">
			<generator class="sequence">
				<param name="sequence">HEPR_MEDFAC_SEQ</param>
			</generator>
		</id>

		<property name="medfacName" type="java.lang.String"
			column="MEDFAC_NAME" update="true" insert="true">
		</property>
		<property name="facCode" type="java.lang.String"
			column="FAC_CODE" update="true" insert="true">
		</property>

	</class>
	
	<sql-query name="allfacility">
		<return alias="facilities" class="HeprEmsMedfacFacilityVO" >
		<return-property name="medfacName" column="MEDFAC_NAME"/>
		</return>
		<![CDATA[
		select facilities.MEDFAC_NAME AS medfacName
		from  HEPR_MEDFAC facilities
		]]> 
	</sql-query>
</hibernate-mapping>


I am trying to execute the query using the following client code:

  public List getAllFacility() {

	List listAllFacilities = null;

	listAllFacilities = getHibernateTemplate().findByNamedQuery(
		"allfacility");

	return listAllFacilities;

    }

The following is the error:

Hibernate: 
    select
        facilities.MEDFAC_NAME AS medfacName   
    from
        HEPR_MEDFAC facilities
- could not read column value from result set: MEDFAC1_14_0_; Invalid column name
- SQL Error: 17006, SQLState: null
- Invalid column name
- Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
- SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]


Any idea if it is a bug or there is any error in my code.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list