aspose file tools
The moose likes Object Relational Mapping and the fly likes mapping one pojo with multiple tables Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "mapping one pojo with multiple tables" Watch "mapping one pojo with multiple tables" New topic
Author

mapping one pojo with multiple tables

vineet java
Greenhorn

Joined: Sep 13, 2011
Posts: 1
Hibernate version 3.2

i have 3 tables and a single pojo is mapped with three in hbm.file with entity-name defined as ::

<class name="com.hr.dto.CandidateRecruitmentDTO" table="TB_SOFT_INTRV_DETAILS" entity-name="softwareObject">

<class name="com.hr.dto.CandidateRecruitmentDTO" table="TB_SOFT_INTRV_DETAILS" entity-name="bpoObject">

<class name="com.hr.dto.CandidateRecruitmentDTO" table="TB_SOFT_INTRV_DETAILS" entity-name="othersObject">

How to fetch data from table based on entity-name as defined in hbm.file. I am using the following qury in DAO class:
recruitmentlist = session.createSQLQuery(" FROM NewCandidateRecruitmentDTO as e").addEntity("softwareObject", NewCandidateRecruitmentDTO.class).list();

Its throwing exception ::: org.hibernate.MappingException: Unknown entity: com.ebix.hrms.dto.CandidateRecruitmentDTO

help me out.....
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: mapping one pojo with multiple tables
 
Similar Threads
Annotations attributes and multiple DB Schemas
Create tables in different database schemas using EJB 3 Entity Persistent
Heap exception while loading complete table data from database
Mapping same POJO to more than one table in Hibernate XML mapping files
LAzy fetch for specific named queries in a POJO class