Monday, May 5, 2014

Can't execute a simple HQL query from Hibernate Tools

When I generated the domain code and the hbm files from my database using Hibernate Tools, the catalog property was set for all my mapping files, so when I execute a query the generated SQL looks for bd.bd.table instead of bd.table.
So I removed the catalog property from all my mapping files
<hibernate-mapping>
<class name="beans.Famille" table="famille">
//...
</class>
</hibernate-mapping>
and now the generated code looks like this:
HQL:
from Famille
SQL:
select
  famille0_.familleID as familleID128_,
  famille0_.libelle as libelle128_ 
 from
  bd.famille famille0_

No comments:

Post a Comment