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