-->
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: one to one association and atributte "column"
PostPosted: Wed Sep 10, 2008 6:18 am 
Beginner
Beginner

Joined: Tue Aug 26, 2008 4:24 pm
Posts: 29
If have one table with two columns: Customer Name, Customer ID(Primary key.
Other table "parking Space" with two columns: "Parking Space Name" and "Id Customer(Foreign key)".
The relations between them are one to one. A customer only has one parking space and it only owns to one customer.

class Customer{
private name;
private id;
//getters an setters

}

class ParkingSpace{
private name;
private Customer;
//getters an setters

}





1)If I have one to one asociation in a mapping file means this property set by "name" is a foreig keyn column in the table, right?
1)Why I cant use the "column" attribute in one to one associations in the ParkingSpace class?
2)How is the Customer property of ParkingSpace class saved an retrieved if there is no a column?
3)What are property-ref and foreign-key attributes for?

Thanks


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.