Check this: http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/CMP4.html#68873
Luis. --- Vineeth Varghese <[EMAIL PROTECTED]> wrote: > > > Hi folks, > > I am new to CMR in EJB2.0 and was going through > RMH's book Enterprise > Javabean. > > I am interested in knowing how the container picks > up the relationships. > I haven't exactly tried an example but am stuck > without a complete > understanding of this. > > In the 1-1 uni-directional relation example of > customer and address, the > schema goes like this :- > Customer has a foreign key pointing to the primary > key of address. > > So in the example when I create a Customer bean I > supply the cusomter > name, age etc and then I create the Address bean and > associate the bean > with this customer bean but I want to know how is > this been translated > to the underlaying database. How will the container > know that the > primary key of Address should be inserted as foreign > key in customer > table. I am guessing that the container will need > some hint from the > developer/deployer to accomplish this. Nothing of > this sort is given in > the book > > I expect an anwser like "Container will extract the > relationship details > from the database" :-) so if this is true but we > decide to go from a > link table which maps customer_id to address_id how > will the data be > inserted there. > > A doubt along similar lines is regarding the one to > many uni-directional > example of customers and their phone numbers. The > phone number table has > a foreign key pointing to customer but the bean is > developed to reverse > this relationship..i.e customer knows all his phone > numbers rather than > phone knowing his customer. We do not specify > anything about the foreign > keys. So when I find a customer and try to retrieve > his phone numbers > how will the container know that it should query the > phones table with > the customer id as the customer_id does figure in > the phone bean > persistance field > > I hope I am clear enough with my queries... > > Note : I am deploy with the SUN J2EE implementation > an using their > deploy tool > > I also have a doubt which is specific to SUN J2EE > 1.4 implementation. > > I am trying to capture the schema details from > pointbase db that come > bundled with J2ee 1.4 > I am running into :- > > D:\>D:\appserver\Sun\bin\capture-schema -dburl > jdbc:pointbase:server://localhost > :9092/vinman -schemaname apps -username apps > -password apps -driver > com.pointb > ase.jdbc.jdbcUniversalDriver -table CustomerBean > -out CustomerBean.dbschema > > using dburl: > jdbc:pointbase:server://localhost:9092/vinman > using username: apps > using password: apps > using driver: com.pointbase.jdbc.jdbcUniversalDriver > using schemaname: apps > java.sql.SQLException: No suitable driver > at > java.sql.DriverManager.getConnection(DriverManager.java:532) > at > java.sql.DriverManager.getConnection(DriverManager.java:171) > at > com.sun.forte4j.modules.dbmodel.jdbcimpl.ConnectionProvider.<init>(Co > nnectionProvider.java:46) > at > com.sun.jdo.api.persistence.mapping.ejb.CaptureSchema.main(CaptureSch > ema.java:120) > Exception in thread "main" > java.lang.NullPointerException > at > com.sun.jdo.api.persistence.mapping.ejb.CaptureSchema.main(CaptureSch > ema.java:177) > > > I have pbembedded.jar from pointbase/lib in the > classpath > > Can someone please tell what I am doing wrong? Do I > have to include > anything more to the classpath? > > > peace, > Vineeth > > > =========================================================================== > To unsubscribe, send email to [EMAIL PROTECTED] > and include in the body > of the message "signoff EJB-INTEREST". For general > help, send email to > [EMAIL PROTECTED] and include in the body of the > message "help". > > ===== Luis Armando Q Araujo +55-21-2422-0168 +55-21-9131-4989 __________________________________ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".