Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » J2EE Interest »

Re: How are containers handling (or supposed to handle) CMR & capture-schema issue in SUN J2EE 1.4

sankara rao

2004-02-06


Hi vineeth,

You can read the chapter 3 "Using Container-Managed Persistence for Entity Beans" of http://java.sun.com/j2ee/1.4/docs/devguide/index.html

regards
sankar

Stefano De Giorgi wrote:
> Sorry Vineeth,
> I never used Sun J2EE reference implementation but I suppose it did it
> in some way but don't know how you specify the mapping exactly ...
>
> Stefano
>
>
> Vineeth Varghese wrote:
>
>> Thanks Stefano in that case does SUN J2EE 1.4 server support this? if
>> it does how can this be done
>>
>> Stefano De Giorgi wrote:
>>
>>> Hi Vineeth,
>>>
>>> container retrieve persistence information from proprietary
>>> deployment descriptors, where you specify
>>> mapping column for CMP fields and mapping column for the relation field
>>>
>>> Best Regards
>>> Stefano
>>>
>>>
>>>
>>>
>>>
>>>> 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 listserv@(protected)
>>>> the body
>>>> of the message "signoff J2EE-INTEREST". For general help, send
>>>> email to
>>>> listserv@(protected)".
>>>>
>>>>
>>>>
>>>>
>>>
>>> ===========================================================================
>>>
>>> To unsubscribe, send email to listserv@(protected)
>>> the body
>>> of the message "signoff J2EE-INTEREST". For general help, send email to
>>> listserv@(protected)".
>>>
>>>
>>>
>> ===========================================================================
>>
>> To unsubscribe, send email to listserv@(protected)
>> body of the message "signoff J2EE-INTEREST". For general help, send
>> email to listserv@(protected)
>> "help".
>>
>
> ===========================================================================
> To unsubscribe, send email to listserv@(protected)
> of the message "signoff J2EE-INTEREST". For general help, send email to
> listserv@(protected)".


--
Every great movement must experience three stages:
            ridicule, discussion, adoption.

    --    John Stuart Mill

===========================================================================
To unsubscribe, send email to listserv@(protected)
of the message "signoff J2EE-INTEREST". For general help, send email to
listserv@(protected)".


©2008 junlu.com - Jax Systems, LLC, U.S.A.