RE: EJB 2.1 CMR Bi-Directional with Compound Key

2007-05-30 Thread Mark Aufdencamp
Thanks for the help guys.  I got it to deploy and the queries look right this time.   I need to test the relationships tomorrow, but it looks a lot better this week than it did last week!:)

 Original Message Subject: Re: EJB 2.1 CMR Bi-Directional with Compound KeyFrom: Dain Sundstrom <[EMAIL PROTECTED]>Date: Wed, May 30, 2007 7:21 pmTo: user@geronimo.apache.org
I also suggest you skip CMP and move directly to JPA.  Knowing CMP 

isn't going to help you lean JPA at all.

-dain


On May 30, 2007, at 1:17 PM, Jay D. McHugh wrote:

> Mark,
>
> I thought about suggesting that you use JPA, but I wasn't sure if  
> there was a reason 'bigger than you' that was requiring you to use  
> EJB2.
>
> I tried to learn how to use EJB2 entity beans and I was defeated.
>
> I am _very_ glad that OpenJPA is integrated into Geronimo now - It  
> is making my life much easier.
>
> If you have any questions once you start working with it I'd be  
> happy to answer any questions you have (if I can).
>
> (BTW: Thanks to any and every one who had a part in getting JPA  
> working in Geronimo!)
>
> Jay
>
> Mark Aufdencamp wrote:
>> Thanks for the response Gianny.  I've wacked out a small demo that  
>> I'm working on right now with a session facade, the three beans,  
>> and the database tables.  I'll let you all know how it goes:)
>>  I'm planning on hittting EJB 3.0 hard once I understand this.  I  
>> want to comprehend the legacy way first!
>>
>>
>>  Original Message 
>> Subject: Re: EJB 2.1 CMR Bi-Directional with Compound Key
>> From: Gianny Damour <gianny.damour@optusnet.com.au>
>> Date: Wed, May 30, 2007 7:07 am
>> To: user@geronimo.apache.org
>>
>> Hi Mark,
>>
>> I had a look to the openejb-jar DD and I think you need to  
>> drop the   element from the  
>> Committee- CommitteeMembers relation. This optional element  
>> means that the  foreign key columns declared in the following  
>>   elements are defined by the CMP declared  
>> by .
>>
>> So, this should work:
>>
>> 
>>Committee-CommitteeMembers> name>
>>
>>  Committee-has-many- 
>> CommitteeMembers
>>  
>>CommitteeEntity
>>  
>>  
>>committeeMembers
>>  
>>  
>>
>>  CommitteeId
>>  CommitteeId
>>
>>  
>>
>> 
>>
>> Also, you do not need to declare both sides of a relationship:  
>> the  above is enough to declare the CMR mapping for the  
>> Committee- CommitteeMembers relation.
>>
>> BTW, I strongly recommend you to upgrade to OpenEJB3: this  
>> should be  a seamless migration from a CMP perspective as the  
>> OpenEJB guys have  done a fantastic work at writing an  
>> OpenEJB2 schema converter.
>>
>> Thanks,
>> Gianny
>>
>> On 30/05/2007, at 1:07 AM, Mark Aufdencamp wrote:
>>
>> > I could really use some help on this!  I have a two Entity  
>> beans  > with a bi-directional relationship, committees  
>> and  > committee_members.  Committees has a single field  
>> primary key of  > committeeId.  Committee_members has a  
>> compound primary key of  > CommitteeId+UserId.  A Foreign Key  
>> constraint has been defined for  > the committee_members table  
>> based on the committeeId.  I can't seem  > to get this to  
>> deploy and believe it's my openejb-jar.xml  > deployment  
>> descriptor in the  section.  I've looked  > at  
>> examples from JBoss and Sun, so I'm fairly certain my ejb- >  
>> jar.xml is correct.
>> >
>> > Does anyone have a working example of a bi-directional  
>> relatioship  > where the many table has a compound key that I  
>> can take a look at?
>> >
>> > Where can I find documentation on how OpenEJB and TranQL  
>> interact  > to create the O/R map?
>> >
>> > This knowledge are really seems to be lacking documentation  
>> in  > Geronimo.  I'd really like to draw some pretty pictures  
>> of tables  > and beans with the seven different relationship  
>> types defined for  > EJB 2.1.  This would be good preliminary  
>> work for documenting EJB  > 3.0 examples.  Please help me  
>> learn, so I can contribute:)
>> >
>> > TIA,
>> > Mark Aufdencamp
>> > Mark@Aufdencamp.com <http://email.secureserver.net/ 
>> pcompose.php? 
>> aEmlPart=0&type=reply&folder=INBOX.Apache.Geronimo.Users&uid=108#Comp 
>> ose>
>>
>>





Re: EJB 2.1 CMR Bi-Directional with Compound Key

2007-05-30 Thread Dain Sundstrom
I also suggest you skip CMP and move directly to JPA.  Knowing CMP  
isn't going to help you lean JPA at all.


-dain


On May 30, 2007, at 1:17 PM, Jay D. McHugh wrote:


Mark,

I thought about suggesting that you use JPA, but I wasn't sure if  
there was a reason 'bigger than you' that was requiring you to use  
EJB2.


I tried to learn how to use EJB2 entity beans and I was defeated.

I am _very_ glad that OpenJPA is integrated into Geronimo now - It  
is making my life much easier.


If you have any questions once you start working with it I'd be  
happy to answer any questions you have (if I can).


(BTW: Thanks to any and every one who had a part in getting JPA  
working in Geronimo!)


Jay

Mark Aufdencamp wrote:
Thanks for the response Gianny.  I've wacked out a small demo that  
I'm working on right now with a session facade, the three beans,  
and the database tables.  I'll let you all know how it goes:)
 I'm planning on hittting EJB 3.0 hard once I understand this.  I  
want to comprehend the legacy way first!



-------- Original Message ----
    Subject: Re: EJB 2.1 CMR Bi-Directional with Compound Key
From: Gianny Damour <[EMAIL PROTECTED]>
Date: Wed, May 30, 2007 7:07 am
To: user@geronimo.apache.org

Hi Mark,

I had a look to the openejb-jar DD and I think you need to  
drop the   element from the  
Committee- CommitteeMembers relation. This optional element  
means that the  foreign key columns declared in the following  
  elements are defined by the CMP declared  
by .


So, this should work:


   Committee-CommitteeMembersname>

   
 Committee-has-many- 
CommitteeMembers

 
   CommitteeEntity
 
 
   committeeMembers
 
 
   
 CommitteeId
 CommitteeId
   
 
   


Also, you do not need to declare both sides of a relationship:  
the  above is enough to declare the CMR mapping for the  
Committee- CommitteeMembers relation.


BTW, I strongly recommend you to upgrade to OpenEJB3: this  
should be  a seamless migration from a CMP perspective as the  
OpenEJB guys have  done a fantastic work at writing an  
OpenEJB2 schema converter.


Thanks,
Gianny

On 30/05/2007, at 1:07 AM, Mark Aufdencamp wrote:

> I could really use some help on this!  I have a two Entity  
beans  > with a bi-directional relationship, committees  
and  > committee_members.  Committees has a single field  
primary key of  > committeeId.  Committee_members has a  
compound primary key of  > CommitteeId+UserId.  A Foreign Key  
constraint has been defined for  > the committee_members table  
based on the committeeId.  I can't seem  > to get this to  
deploy and believe it's my openejb-jar.xml  > deployment  
descriptor in the  section.  I've looked  > at  
examples from JBoss and Sun, so I'm fairly certain my ejb- >  
jar.xml is correct.

>
> Does anyone have a working example of a bi-directional  
relatioship  > where the many table has a compound key that I  
can take a look at?

>
> Where can I find documentation on how OpenEJB and TranQL  
interact  > to create the O/R map?

>
> This knowledge are really seems to be lacking documentation  
in  > Geronimo.  I'd really like to draw some pretty pictures  
of tables  > and beans with the seven different relationship  
types defined for  > EJB 2.1.  This would be good preliminary  
work for documenting EJB  > 3.0 examples.  Please help me  
learn, so I can contribute:)

>
> TIA,
> Mark Aufdencamp
> [EMAIL PROTECTED] <http://email.secureserver.net/ 
pcompose.php? 
aEmlPart=0&type=reply&folder=INBOX.Apache.Geronimo.Users&uid=108#Comp 
ose>







Re: EJB 2.1 CMR Bi-Directional with Compound Key

2007-05-30 Thread Jay D. McHugh

Mark,

I thought about suggesting that you use JPA, but I wasn't sure if there 
was a reason 'bigger than you' that was requiring you to use EJB2.


I tried to learn how to use EJB2 entity beans and I was defeated.

I am _very_ glad that OpenJPA is integrated into Geronimo now - It is 
making my life much easier.


If you have any questions once you start working with it I'd be happy to 
answer any questions you have (if I can).


(BTW: Thanks to any and every one who had a part in getting JPA working 
in Geronimo!)


Jay

Mark Aufdencamp wrote:
Thanks for the response Gianny.  I've wacked out a small demo that I'm 
working on right now with a session facade, the three beans, and the 
database tables.  I'll let you all know how it goes:)
 
I'm planning on hittting EJB 3.0 hard once I understand this.  I want 
to comprehend the legacy way first!



 Original Message ----
    Subject: Re: EJB 2.1 CMR Bi-Directional with Compound Key
From: Gianny Damour <[EMAIL PROTECTED]>
Date: Wed, May 30, 2007 7:07 am
To: user@geronimo.apache.org

Hi Mark,

I had a look to the openejb-jar DD and I think you need to drop the  
 element from the Committee- 
CommitteeMembers relation. This optional element means that the  
foreign key columns declared in the following   
elements are defined by the CMP declared by .


So, this should work:


   Committee-CommitteeMembers
   
 Committee-has-many-CommitteeMembersejb-relationship-role-name>

 
   CommitteeEntity
 
 
   committeeMembers
 
 
   
 CommitteeId
 CommitteeId
   
 
   


Also, you do not need to declare both sides of a relationship: the  
above is enough to declare the CMR mapping for the Committee- 
CommitteeMembers relation.


BTW, I strongly recommend you to upgrade to OpenEJB3: this should be  
a seamless migration from a CMP perspective as the OpenEJB guys have  
done a fantastic work at writing an OpenEJB2 schema converter.


Thanks,
Gianny

On 30/05/2007, at 1:07 AM, Mark Aufdencamp wrote:

> I could really use some help on this!  I have a two Entity beans  
> with a bi-directional relationship, committees and  
> committee_members.  Committees has a single field primary key of  
> committeeId.  Committee_members has a compound primary key of  
> CommitteeId+UserId.  A Foreign Key constraint has been defined for  
> the committee_members table based on the committeeId.  I can't seem  
> to get this to deploy and believe it's my openejb-jar.xml  
> deployment descriptor in the  section.  I've looked  
> at examples from JBoss and Sun, so I'm fairly certain my ejb- 
> jar.xml is correct.

>
> Does anyone have a working example of a bi-directional relatioship  
> where the many table has a compound key that I can take a look at?

>
> Where can I find documentation on how OpenEJB and TranQL interact  
> to create the O/R map?

>
> This knowledge are really seems to be lacking documentation in  
> Geronimo.  I'd really like to draw some pretty pictures of tables  
> and beans with the seven different relationship types defined for  
> EJB 2.1.  This would be good preliminary work for documenting EJB  
> 3.0 examples.  Please help me learn, so I can contribute:)

>
> TIA,
> Mark Aufdencamp
> [EMAIL PROTECTED] 
<http://email.secureserver.net/pcompose.php?aEmlPart=0&type=reply&folder=INBOX.Apache.Geronimo.Users&uid=108#Compose>





RE: EJB 2.1 CMR Bi-Directional with Compound Key

2007-05-30 Thread Mark Aufdencamp

Thanks for the response Gianny.  I've wacked out a small demo that
I'm working on right now with a session facade, the three beans, and the database tables.  I'll let you all know how it goes:)
 

I'm planning on hittting EJB 3.0 hard once I understand this.  I
want to comprehend the legacy way first!

 Original Message Subject: Re: EJB 2.1 CMR Bi-Directional with Compound KeyFrom: Gianny Damour <[EMAIL PROTECTED]>Date: Wed, May 30, 2007 7:07 amTo: user@geronimo.apache.orgHi Mark,

I had a look to the openejb-jar DD and I think you need to drop the  
 element from the Committee- 
CommitteeMembers relation. This optional element means that the  
foreign key columns declared in the following   
elements are defined by the CMP declared by .

So, this should work:


   Committee-CommitteeMembers
   
 Committee-has-many-CommitteeMembers
 
   CommitteeEntity
 
 
   committeeMembers
 
 
   
 CommitteeId
 CommitteeId
   
 
   


Also, you do not need to declare both sides of a relationship: the  
above is enough to declare the CMR mapping for the Committee- 
CommitteeMembers relation.

BTW, I strongly recommend you to upgrade to OpenEJB3: this should be  
a seamless migration from a CMP perspective as the OpenEJB guys have  
done a fantastic work at writing an OpenEJB2 schema converter.

Thanks,
Gianny

On 30/05/2007, at 1:07 AM, Mark Aufdencamp wrote:

> I could really use some help on this!  I have a two Entity beans  
> with a bi-directional relationship, committees and  
> committee_members.  Committees has a single field primary key of  
> committeeId.  Committee_members has a compound primary key of  
> CommitteeId+UserId.  A Foreign Key constraint has been defined for  
> the committee_members table based on the committeeId.  I can't seem  
> to get this to deploy and believe it's my openejb-jar.xml  
> deployment descriptor in the  section.  I've looked  
> at examples from JBoss and Sun, so I'm fairly certain my ejb- 
> jar.xml is correct.
>
> Does anyone have a working example of a bi-directional relatioship  
> where the many table has a compound key that I can take a look at?
>
> Where can I find documentation on how OpenEJB and TranQL interact  
> to create the O/R map?
>
> This knowledge are really seems to be lacking documentation in  
> Geronimo.  I'd really like to draw some pretty pictures of tables  
> and beans with the seven different relationship types defined for  
> EJB 2.1.  This would be good preliminary work for documenting EJB  
> 3.0 examples.  Please help me learn, so I can contribute:)
>
> TIA,
> Mark Aufdencamp
> Mark@Aufdencamp.com





Re: EJB 2.1 CMR Bi-Directional with Compound Key

2007-05-30 Thread Gianny Damour

Hi Mark,

I had a look to the openejb-jar DD and I think you need to drop the  
 element from the Committee- 
CommitteeMembers relation. This optional element means that the  
foreign key columns declared in the following   
elements are defined by the CMP declared by .


So, this should work:


  Committee-CommitteeMembers
  
Committee-has-many-CommitteeMembersejb-relationship-role-name>


  CommitteeEntity


  committeeMembers


  
CommitteeId
CommitteeId
  

  


Also, you do not need to declare both sides of a relationship: the  
above is enough to declare the CMR mapping for the Committee- 
CommitteeMembers relation.


BTW, I strongly recommend you to upgrade to OpenEJB3: this should be  
a seamless migration from a CMP perspective as the OpenEJB guys have  
done a fantastic work at writing an OpenEJB2 schema converter.


Thanks,
Gianny

On 30/05/2007, at 1:07 AM, Mark Aufdencamp wrote:

I could really use some help on this!  I have a two Entity beans  
with a bi-directional relationship, committees and  
committee_members.  Committees has a single field primary key of  
committeeId.  Committee_members has a compound primary key of  
CommitteeId+UserId.  A Foreign Key constraint has been defined for  
the committee_members table based on the committeeId.  I can't seem  
to get this to deploy and believe it's my openejb-jar.xml  
deployment descriptor in the  section.  I've looked  
at examples from JBoss and Sun, so I'm fairly certain my ejb- 
jar.xml is correct.


Does anyone have a working example of a bi-directional relatioship  
where the many table has a compound key that I can take a look at?


Where can I find documentation on how OpenEJB and TranQL interact  
to create the O/R map?


This knowledge are really seems to be lacking documentation in  
Geronimo.  I'd really like to draw some pretty pictures of tables  
and beans with the seven different relationship types defined for  
EJB 2.1.  This would be good preliminary work for documenting EJB  
3.0 examples.  Please help me learn, so I can contribute:)


TIA,
Mark Aufdencamp
[EMAIL PROTECTED]