Hi!
I'm using hibernate with Sybase ASE, I would like to recover data of my table department, but hibernate returns an error:
The column prefix 'area1_' does not match with a table name or alias name used in the query. Either the table is not specified in the FROM clause or it has a correlation name which must be used instead.
The generated query is:
select this.DEPARTMENT_ID as DEPARTME1_1_, this.NUMBER as NUMBER1_, this.AREA_ID as AREA_ID1_, area1_.AREA_ID as AREA_ID0_, area1_.COUNTRY_ID as COUNTRY_ID0_ from DEPARTMENT this left outer join AREA area1_ on this.AREA_ID=area1_.AREA_ID where 1=1
The mapping file is:
<hibernate-mapping package="fr.lunasquare.admin.prospect.logic.area"> <class name="Department" table="DEPARTMENT"> <id column="DEPARTMENT_ID" name="Id" type="integer"> <generator class="native" /> </id> <property column="NUMBER" length="5" name="Number" not-null="true" type="string"/> <many-to-one class="fr.lunasquare.admin.prospect.logic.area.Area" name="Area" not-null="true"> <column name="AREA_ID" /> </many-to-one> </class> </hibernate-mapping>
The hibernate file:
<hibernate-configuration> <session-factory> <!-- properties --> <property name="connection.username">sa</property> <property name="show_sql">true</property> <property name="dialect"> net.sf.hibernate.dialect.SQLServerDialect </property> <property name="use_outer_join">true</property> ... </session-factory> </hibernate-configuration>
I would like what's the matter with that error and how to solve it.
thanks !
|