Bookmark Topic Watch Topic
  • New Topic

Join using HQL  RSS feed

Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Report post to moderator
I have two tables: a1 and b2 in MYSQL.

The structure for table a1 is column "identity"(int type) and column "name"(varchar type).

The structure for table b2 is column "id"(int type),column "name"(varchar type) and column "name"(varchar type).

Corresponding to these two tables i have to java classes: and b2. java.

My hibernate.cfg.xml file looks like the following:

And my mapping file, join.hbm.xml looks like the following:

I have a third class where i am trying to join tables a1 and b2. This class looks like the following:

When i execute this class, i get the following message:

log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
unexpected AST node: b2 [from a1 left join b2]

Could anybody tell me where i went wrong? I guess, the HQL query is incorrect. What should be the correct query? Kindly advise.

    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!