| Author |
Different Mapping Types in Hibernate
|
Rajendra Prakash
Ranch Hand
Joined: Sep 10, 2009
Posts: 293
|
|
One-to-One mapping means one pojo mapped with one table ,is it .
i read tutorials , but it was confusing.
|
 |
Sridhar Santhanakrishnan
Ranch Hand
Joined: Mar 20, 2007
Posts: 317
|
|
What tutorials did you read? A mapping refers to relationship between entities.
Look at this for more detail. one-one mapping
|
 |
Rajendra Prakash
Ranch Hand
Joined: Sep 10, 2009
Posts: 293
|
|
I already saw this link. For one-to-one mapping why many-to-one is specified
|
 |
Eduardo YaƱez Parareda
Ranch Hand
Joined: Oct 09, 2008
Posts: 92
|
|
Rajendra Prakash wrote:One-to-One mapping means one pojo mapped with one table ,is it .
i read tutorials , but it was confusing.
Don't read tutorials, read the reference manual. This chapter explains what a mapping is and the relationships.
http://docs.jboss.org/hibernate/core/3.3/reference/en/html/mapping.html
|
http://serfj.sourceforge.net - Simplest Ever REST Framework for Java
|
 |
Sridhar Santhanakrishnan
Ranch Hand
Joined: Mar 20, 2007
Posts: 317
|
|
I meant the scenario that the OP described.
I have an Employee object and a Parking Space Object. The have a one to one relation i.e., an employee will always be associated to only one parking space, that parking space should not be associated to any other employee.
|
 |
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Joined: Aug 26, 2006
Posts: 4967
|
|
One to one infers the relationship between objects, not the relationship between the object and the table.
Here is an example of a one-to-one mapping between objects, but both objects link to the same database table.
Tutorial on Mapping Two Classes to One Table
|
Author of Hibernate Made Easy, What is WebSphere???, JSF 2.0 Made Easy and the SCJA Certification Guides
|
 |
 |
|
|
subject: Different Mapping Types in Hibernate
|
|
|