Re: [JBoss-user] CMP2.0 Foreign Key (?) Problem

2002-02-21 Thread Richard Lim

Please take me out from your mailing list!
I did not subscribe to any of these.


[EMAIL PROTECTED]


--- Dain Sundstrom <[EMAIL PROTECTED]> wrote:
>This is definitely a job for the jbosscmp-jdbc.xml file.  What version 
>of JBoss are you using?  The structure of this file changed between the 
>alpha and the beta.  The xml for the classic Order-LineItem in JBoss 3.0 
>beta follows:
>
>
>Order-LineItem
>
>
>order.getLineitems()
>   
>  
> ordernumber
> ORDER_NUMBER
>  
>   
>
>
>lineitem.getOrder()
>   
>
>
>
>As you can see the roles have been moved out of the foreign-key-mapping 
>element and keys are always specified in terms of the current entity 
>which is backwards from the old foreign key mapping but exactly the same 
>as the table-mapping.  Read the dtd for more info.
>
>-dain
>
>
>Robertson, Jason wrote:
>
>> I have two prebuilt tables that look like this:
>> 
>> mysql> select * from organizationtype;
>> +---+---+
>> | name  | description   |
>> +---+---+
>> | type1 | orgtype-desc1 |
>> | type2 | orgtype-desc2 |
>> +---+---+
>> 2 rows in set (0.00 sec)
>> 
>> mysql> select * from role;
>> +---+-+-+
>> | name  | description | orgTypeName |
>> +---+-+-+
>> | role1 | role-desc1  | type1   |
>> | role2 | role-desc2  | type1   |
>> | role3 | role-desc3  | type1   |
>> | role4 | role-desc4  | type2   |
>> +---+-+-+
>> 4 rows in set (0.00 sec)
>> 
>> Where role->orgTypeName is a foreign key to organizationtype->name.
>> 
>> I was an accessor RoleEntity.getOrganizationType() to return an
>> OrganizationTypeEntity. When I set the relationship up in ejb-jar.xml, the
>> SQL is generated with a field name of organizationType where I need it to be
>> orgTypeName. It's my understanding that this is a job for
>> foreign-key-mapping in jbosscmp-jdbc.xml, but I can't get it to work. Is
>> this the proper place to do this mapping? What is the correct configuration?
>> 
>> Here's a template, and no matter what I stick in for the '???' areas, I
>> can't seem to ever get orgTypeName into the SQL query:
>> 
>>   
>> 
>>   Role-OrganizationType
>> 
>>   
>> 
>> 
>>   
>> Role-Spawns-OrgType
>>   
>>   
>> 
>>   ???
>>   ???
>> 
>>   
>> 
>> 
>> 
>>   
>>  OrgType-Fulfills-Role
>>   
>>   
>> 
>>   ???
>>   ???
>> 
>>   
>> 
>> 
>>   
>> 
>>  
>>
>> 
>> I've "solved" this problem by renaming my column "organizationType" in my
>> database, but I'd still like to understand how to set this up for the
>> example given above.
>> 
>> Thanks,
>> Jason
>> 
>> 
>> 
>> 
>> ___
>> JBoss-user mailing list
>> [EMAIL PROTECTED]
>> https://lists.sourceforge.net/lists/listinfo/jboss-user
>> 
>
>
>
>___
>JBoss-user mailing list
>[EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/jboss-user

_
Get your FREE 6MB web-based e-mail @ 1800-Mail.com
A FREE service by  WIZIW.COM 
Powered by one of the fastest e-mail engines, EveryOneNet.
UserID : YourName @ 1800-Mail.com

___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] CMP2.0 Foreign Key (?) Problem

2002-02-21 Thread Richard Lim


Please take me out from your mailing list!
I did not subscribe to any of these.


[EMAIL PROTECTED]



--- "Robertson, Jason" <[EMAIL PROTECTED]> wrote:
>If we weren't exchanging messages over email you'd see me doing a little
>victory dance right now! Which, not too surprisingly, makes me glad we're
>exchanging messages over email.
>
>I was using a version of JBoss pulled from CVS in the last day or two, but
>was using examples and docs that applied to the alpha release. Right before
>your email I had decided that JBoss was completely ignoring everything I had
>in my jbosscmp-jdbc.xml file - which it was, because I was using the old
>style where  and  wrapped the roles. 
>
>Who would have thought to go look at the DTD? I mean, it's only the exact
>description of how I should be formatting the config file. Sigh...
>
>Thanks for kicking me in the right direction, everything works wonderfully
>now.
>
>Jason
>
>-Original Message-
>From: Dain Sundstrom [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, February 21, 2002 3:48 PM
>To: Robertson, Jason
>Cc: JBoss User (E-mail)
>Subject: Re: [JBoss-user] CMP2.0 Foreign Key (?) Problem
>
>
>This is definitely a job for the jbosscmp-jdbc.xml file.  What version 
>of JBoss are you using?  The structure of this file changed between the 
>alpha and the beta.  The xml for the classic Order-LineItem in JBoss 3.0 
>beta follows:
>
>
>Order-LineItem
>
>
>order.getLineitems()>
>   
>  
> ordernumber
> ORDER_NUMBER
>  
>   
>
>
>lineitem.getOrder()
>   
>
>
>
>As you can see the roles have been moved out of the foreign-key-mapping 
>element and keys are always specified in terms of the current entity 
>which is backwards from the old foreign key mapping but exactly the same 
>as the table-mapping.  Read the dtd for more info.
>
>-dain
>
>
>Robertson, Jason wrote:
>
>> I have two prebuilt tables that look like this:
>> 
>> mysql> select * from organizationtype;
>> +---+---+
>> | name  | description   |
>> +---+---+
>> | type1 | orgtype-desc1 |
>> | type2 | orgtype-desc2 |
>> +---+---+
>> 2 rows in set (0.00 sec)
>> 
>> mysql> select * from role;
>> +---+-+-+
>> | name  | description | orgTypeName |
>> +---+-+-+
>> | role1 | role-desc1  | type1   |
>> | role2 | role-desc2  | type1   |
>> | role3 | role-desc3  | type1   |
>> | role4 | role-desc4  | type2   |
>> +---+-+-+
>> 4 rows in set (0.00 sec)
>> 
>> Where role->orgTypeName is a foreign key to organizationtype->name.
>> 
>> I was an accessor RoleEntity.getOrganizationType() to return an
>> OrganizationTypeEntity. When I set the relationship up in ejb-jar.xml, the
>> SQL is generated with a field name of organizationType where I need it to
>be
>> orgTypeName. It's my understanding that this is a job for
>> foreign-key-mapping in jbosscmp-jdbc.xml, but I can't get it to work. Is
>> this the proper place to do this mapping? What is the correct
>configuration?
>> 
>> Here's a template, and no matter what I stick in for the '???' areas, I
>> can't seem to ever get orgTypeName into the SQL query:
>> 
>>   
>> 
>>   Role-OrganizationType
>> 
>>   
>> 
>> 
>>   
>> Role-Spawns-OrgType
>>   
>>   
>> 
>>   ???
>>   ???
>> 
>>   
>> 
>> 
>> 
>>   
>>  OrgType-Fulfills-Role
>>   
>>   
>> 
>>   ???
>>   ???
>> 
>>   
>> 
>> 
>>   
>> 
>>  
>>
>> 
>> I've "solved" this problem by renaming my column "organizationType" in my
>> database, but I'd still like to understand how to set this up for the
>> example given above.
>> 
>> Thanks,
>> Jason
>> 
>> 
>> 
>> 
>> ___
>> JBoss-user mailing list
>> [EMAIL PROTECTED]
>> https://lists.sourceforge.net/lists/listinfo/jboss-user
>> 
>
>
>
>___
>JBoss-user mailing list
>[EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/jboss-user

_
Get your FREE 6MB web-based e-mail @ 1800-Mail.com
A FREE service by  WIZIW.COM 
Powered by one of the fastest e-mail engines, EveryOneNet.
UserID : YourName @ 1800-Mail.com

___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] CMP2.0 Foreign Key (?) Problem

2002-02-21 Thread Robertson, Jason

If we weren't exchanging messages over email you'd see me doing a little
victory dance right now! Which, not too surprisingly, makes me glad we're
exchanging messages over email.

I was using a version of JBoss pulled from CVS in the last day or two, but
was using examples and docs that applied to the alpha release. Right before
your email I had decided that JBoss was completely ignoring everything I had
in my jbosscmp-jdbc.xml file - which it was, because I was using the old
style where  and  wrapped the roles. 

Who would have thought to go look at the DTD? I mean, it's only the exact
description of how I should be formatting the config file. Sigh...

Thanks for kicking me in the right direction, everything works wonderfully
now.

Jason

-Original Message-
From: Dain Sundstrom [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 3:48 PM
To: Robertson, Jason
Cc: JBoss User (E-mail)
Subject: Re: [JBoss-user] CMP2.0 Foreign Key (?) Problem


This is definitely a job for the jbosscmp-jdbc.xml file.  What version 
of JBoss are you using?  The structure of this file changed between the 
alpha and the beta.  The xml for the classic Order-LineItem in JBoss 3.0 
beta follows:


Order-LineItem


order.getLineitems()
   
  
 ordernumber
 ORDER_NUMBER
  
   


lineitem.getOrder()
   



As you can see the roles have been moved out of the foreign-key-mapping 
element and keys are always specified in terms of the current entity 
which is backwards from the old foreign key mapping but exactly the same 
as the table-mapping.  Read the dtd for more info.

-dain


Robertson, Jason wrote:

> I have two prebuilt tables that look like this:
> 
> mysql> select * from organizationtype;
> +---+---+
> | name  | description   |
> +---+---+
> | type1 | orgtype-desc1 |
> | type2 | orgtype-desc2 |
> +---+---+
> 2 rows in set (0.00 sec)
> 
> mysql> select * from role;
> +---+-+-+
> | name  | description | orgTypeName |
> +---+-+-+
> | role1 | role-desc1  | type1   |
> | role2 | role-desc2  | type1   |
> | role3 | role-desc3  | type1   |
> | role4 | role-desc4  | type2   |
> +---+-+-+
> 4 rows in set (0.00 sec)
> 
> Where role->orgTypeName is a foreign key to organizationtype->name.
> 
> I was an accessor RoleEntity.getOrganizationType() to return an
> OrganizationTypeEntity. When I set the relationship up in ejb-jar.xml, the
> SQL is generated with a field name of organizationType where I need it to
be
> orgTypeName. It's my understanding that this is a job for
> foreign-key-mapping in jbosscmp-jdbc.xml, but I can't get it to work. Is
> this the proper place to do this mapping? What is the correct
configuration?
> 
> Here's a template, and no matter what I stick in for the '???' areas, I
> can't seem to ever get orgTypeName into the SQL query:
> 
>   
> 
>   Role-OrganizationType
> 
>   
> 
> 
>   
> Role-Spawns-OrgType
>   
>   
> 
>   ???
>   ???
> 
>   
> 
> 
> 
>   
>  OrgType-Fulfills-Role
>   
>   
> 
>   ???
>   ???
> 
>   
> 
> 
>   
> 
>  
>
> 
> I've "solved" this problem by renaming my column "organizationType" in my
> database, but I'd still like to understand how to set this up for the
> example given above.
> 
> Thanks,
> Jason
> 
> 
> 
> 
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 



___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] CMP2.0 Foreign Key (?) Problem

2002-02-21 Thread Dain Sundstrom

This is definitely a job for the jbosscmp-jdbc.xml file.  What version 
of JBoss are you using?  The structure of this file changed between the 
alpha and the beta.  The xml for the classic Order-LineItem in JBoss 3.0 
beta follows:


Order-LineItem


order.getLineitems()
   
  
 ordernumber
 ORDER_NUMBER
  
   


lineitem.getOrder()
   



As you can see the roles have been moved out of the foreign-key-mapping 
element and keys are always specified in terms of the current entity 
which is backwards from the old foreign key mapping but exactly the same 
as the table-mapping.  Read the dtd for more info.

-dain


Robertson, Jason wrote:

> I have two prebuilt tables that look like this:
> 
> mysql> select * from organizationtype;
> +---+---+
> | name  | description   |
> +---+---+
> | type1 | orgtype-desc1 |
> | type2 | orgtype-desc2 |
> +---+---+
> 2 rows in set (0.00 sec)
> 
> mysql> select * from role;
> +---+-+-+
> | name  | description | orgTypeName |
> +---+-+-+
> | role1 | role-desc1  | type1   |
> | role2 | role-desc2  | type1   |
> | role3 | role-desc3  | type1   |
> | role4 | role-desc4  | type2   |
> +---+-+-+
> 4 rows in set (0.00 sec)
> 
> Where role->orgTypeName is a foreign key to organizationtype->name.
> 
> I was an accessor RoleEntity.getOrganizationType() to return an
> OrganizationTypeEntity. When I set the relationship up in ejb-jar.xml, the
> SQL is generated with a field name of organizationType where I need it to be
> orgTypeName. It's my understanding that this is a job for
> foreign-key-mapping in jbosscmp-jdbc.xml, but I can't get it to work. Is
> this the proper place to do this mapping? What is the correct configuration?
> 
> Here's a template, and no matter what I stick in for the '???' areas, I
> can't seem to ever get orgTypeName into the SQL query:
> 
>   
> 
>   Role-OrganizationType
> 
>   
> 
> 
>   
> Role-Spawns-OrgType
>   
>   
> 
>   ???
>   ???
> 
>   
> 
> 
> 
>   
>  OrgType-Fulfills-Role
>   
>   
> 
>   ???
>   ???
> 
>   
> 
> 
>   
> 
>  
>
> 
> I've "solved" this problem by renaming my column "organizationType" in my
> database, but I'd still like to understand how to set this up for the
> example given above.
> 
> Thanks,
> Jason
> 
> 
> 
> 
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 



___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user