Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
3.0.1 product
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<!--
Auto-generated mapping file from
the hibernate.org cfg2hbm engine
-->
<class
name="test.Counter"
table="counter"
catalog="lportal"
>
<id
name="Name"
type="java.lang.String"
>
<column name="name" length="100" not-null="true" unique="true" sql-type="varchar" />
<generator class="assigned" />
</id>
<property
name="CurrentId"
type="java.lang.Integer"
>
<column name="currentId" length="11" not-null="false" sql-type="int" />
</property>
</class>
</hibernate-mapping>:
No
org.hibernate.QueryException:undefined alias:c[select c.Name from test.Counter as c;]
MySQL4.01 innoDB:
No
INFO:
Hi everyone:
After I config hibernate eclipse console(generate *.htm and *.java) ,I test it and I execute a HQL query in hibernate console.But I get the following exception:
Code:
org.hibernate.QueryException:undefined alias:c[select c.Name from test.Counter as c;]
org.hibernate.QueryException:undefined alias:c[select c.Name from test.Counter as c;]
But the HQL is correct indeed! What's wrong with the HQL ? Thks!
[/code]