EJB - help me with a simple CMR - please!!
Posted on 2004-11-25
Please Im pretty new to CMR and appreciate if you could help me answer a simple question.
I ve two CMP entities: WriterBean and BookBean
I ve set the relations between Writer and Books, and it works as far as a writer only has one book.
That because I set the FK also as a PK to the BookBean. And when I try to create next book for a writer it fails with duplicate-exception, logicaly.
Can I solve this without any need of specifing a primary key for books at all?
How is CMP handling no-pk entity and is relations working without any pk?
Do EJB vendors manage no pk ejbs? what about ejb restrictions.
I ve read that there must be a primary key, but not necessery a database field - HOW? could you please explain!
Please this is very urgent and I Thank you very much!!