This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
I have 2 classes viz. Product and ProductBasic having one-to-one relationship
Product is mapped to a table PRODUCT which has PRODUCTID as PK.
ProductBasic is mapped to a table PRODUCTBASIC which has PRODUCTID,USECODE and STARTTTIME as composite key.
My database is legacy and i cannot change it.
I get the one-to-one relationship by applying the condition as:
PRODUCT.PRODUCTID=PRODUCTBASIC.PRODUCTID and USECODE='008' and STARTTIME < CURRENTIME < ENDTIME..
My database values are such that if i apply this condition i will only get once record..