hi can anyone pass me a simple example using relationship(entity beans with relationship).I am not able to find any simple example so that i will be able to understand concept.i tried google search also but i was not successfull. I tried roster example for sun but it is bit complex to understand.
I'll send you mine, but I can't use email. I'll try to post the code at the ranch tomorrow, but you'll have to do the container config yourself. I've used J2EE RI. [ March 22, 2007: Message edited by: Satou kurinosuke ]
I'm sending you my java files and the descriptor generated by the Deploytool. You'll have to generate client stubs, SQL... I've tested it with J2EE RI and Cloudscape. It's pretty dirty and almost no comment, but I hope it can help. Movie and Trailer entity beans have a One-To-One relationship. This code checks : 1. The One-To-One relationship 2. Finder method 3. Select method 4. Home business method
The Movie entity bean
[ March 22, 2007: Message edited by: Satou kurinosuke ]
gowher, I wanted to send you the ear, but I can't use email. I've made this sample at my office, and the security policy is really strict.(no mail, no ftp. I'm lucky enough to be able to use the ranch !) I hope you can make one yourself. It's not difficult to make one with Deploytool. Sorry for the inconvenience.
_trailer_trailerId movieId movieName ------------------ --------- ---------- TR1 RB1 Return of the beans
In "TrailerBeanTable" table what is _movie_movieId?
In "MovieBeanTable" table what is _trailer_trailerId?
if they are Foreign keys then why DB let me insert row(using oracle console directly) for "TrailerBeanTable" which is not present in "MovieBeanTable" table?
It depends on the way the tool creates tables. It may not be foreign keys. In the Deploytool, you can check the generated SQLs when using "Auto generate SQL". It might be only standard columns refering to another table's column.