Hibernate version:
Core 3.2.6 GA
Annotations 3.3.1 GA
Entity Manager 3.3.2 GA
Name and version of the database you are using:
PostgreSQL 8.0.15
Problem
Hi Experts
I have applied the solution as given in
http://forum.hibernate.org/viewtopic.php?t=947709 regarding the deeply nested join problem but haven't been able to find a working solution. I keep getting the following exception and have no idea why:
org.postgresql.util.PSQLException: ERROR: table name "comp1x2_" specified more than once
As you can see from the exception I am currently using PostgreSQL for the database but I have also tested the snippet of code with MySQL and obtained a similar MySQL exception. The Hibernate Criteria code snippet producing the exception is as follows:
Code:
Criteria criteria = em.getSession().createCriteria(Customer.class);
criteria.createAlias("supplier", "supp1");
criteria.createAlias("supp1.company", "comp1");
criteria.add(Restrictions.eq("comp1.name", "Test Name"));
List<Customer> customers = criteria.list();
Any help would be appreciated!
Ristretto