aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Help Please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Help Please" Watch "Help Please" New topic
Author

Help Please

Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
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.

Thanks
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

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 ]

[My Blog]
All roads lead to JavaRanch
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

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 ]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

The Trailer entity bean
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

The MovieMaker session bean (makes a moive, a trailer, and sets each other)
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Finally, the client app

Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

The deployment descriptor.
Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
Thanks Satou kurinosuke
Now i will try this example.
Please send me .ear file of above example.
Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
my email id is gowher_naik@rediffmail.com
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

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.
Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
i deployed and run above bean successfully.
I have some doubts which i will ask you.
Thanks
Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
Hi Satou
Tables created by above bean are as follows

SQL> select * from "TrailerBeanTable";

_movie_movieId description trailerId
------------- ----------- --------
RB1 Trailer for RB1 TR1

SQL> select * from "MovieBeanTable";

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

Thanks
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help Please