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.
|