I have 2 classes viz. Product and ProductBasic
Code:
class Product{
String productId;
ProductBasic productBasic;
}
class ProductBasic{
String productId;
String useType;
TimeStamp startTimeStamp;
Product product;
}
Product is mapped to a table PRODUCT which has PRODUCTID as PK.
ProductBasic is mapped to a table PRODUCTBASIC which has PRODUCTID,USETYPE and STARTTTIMESTAMP as composite key. Also PRODUCTID
is the foreign key referencing PRODUCT table...
How can i define my one-to-one mapping considering ProductBasic.productId should get its value from Product.productId