This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Help for Mapping tow BOs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Help for Mapping tow BOs" Watch "Help for Mapping tow BOs" New topic

Help for Mapping tow BOs

Kiran Mallela

Joined: Aug 11, 2009
Posts: 4
Hi to all,
I have two business objects like this

public class Person{
private int pid;
private String name;
private Phone phone;

public class Phone{

private long number;


can you any one Help me for mapping these two BOs in hibernate.
<***Phone doesn't contains pid>
David Newton

Joined: Sep 29, 2008
Posts: 12617

Welcome to JavaRanch!

Please see the JavaRanch naming policy and change your display name to conform with this policy. Thanks!

Also, Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read.

Have you read any of the Hibernate mapping tutorials available on the web? It's almost always quicker to SearchFirst, especially when it's a general question easily answerable through other mechanisms.
It is sorta covered in the JavaRanch Style Guide.
subject: Help for Mapping tow BOs
Similar Threads
one to one unidirectional mapping in jpa
mutex on multiple cpus
Excepion: mapping cannot have columns in this context(JPA/OpenJPA OneToMany using single table)
question about entity PK
Need an idea regarding my billing application.