-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: selecting data from multiple tables
PostPosted: Thu Aug 28, 2008 5:02 am 
Newbie

Joined: Mon Aug 25, 2008 4:13 am
Posts: 2
I am begging for help, I'm absolutely feckless.

I'm using hibernate with JBoss Seam, everything goes well, but i don't know how to create entity from two or more different database tables, joined on some of their foreign keys.

If there is no @Table annotation after @Entity annotation in java entity class, i receive exception, that database table which corresponds with entity cannot be found.
Also i haven't found any way how to join some entities using annotations and hql. @Entity with @NamedQuery doesn't work, when i wanna select from more than one table.
I was also wondering if it is possible to create entity for database view, so i created view in my db and used seam to generate entity from it, it worked well and create @Table annotation with name of my db view as attribute name. But when i started my app it hasn't worked again, i received hibernate exception that table with such name cannot be found.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.