not to be a nuisanse but i'm restarting the thread from
http://forum.hibernate.org/viewtopic.php?t=932115&highlight= due to a severe drop visibility :-).
consider A-->B-->C as a many-to-one mapping. i use an mpath like "b.c" to form criteria objets (where the root is A.class and b,c represent A.getB() and B.getC()). now the sql generated is fine in this case.
this whole thing blows up with the message
Quote:
Not unique
when A has a joined subclass A'.
Code:
java.sql.SQLException: Invalid argument value, message from server: "Not unique table/alias: 'x0_'"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1651)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:889)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:956)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1874)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1538)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:795)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:189)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:950)
at net.sf.hibernate.loader.Loader.list(Loader.java:941)
at net.sf.hibernate.loader.CriteriaLoader.list(CriteriaLoader.java:118)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3571)
at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:223)
if anyone can hint if this is a bug or a usage... please let me know.
thanks
ravi