[JBoss-user] [Persistence & CMP/JBoss] - CMP storing serialized object in relation instead of integer

2004-06-29 Thread amarpatel
Please advise on the following issues described below:
1. no ejb-relationship-role-name defined error.
2. serialized UserType being stored in RDBMS table users, instead of foreign key 
integer.

I have 2 entities: User and UserType.  The relationship between the User entity and 
UserType etity is as follows:
1 User can only have 1 UserType, but 1 UserType can belong to many Users. Furthermore, 
User maintains a reference to UserType, but UserType does not have a reference to 
User. So in ejb-jar.xml, we have defined the one-to-many unidirectional relationship 
between the UserEJB and the UserTypeEJB is as follows:



User-UserType

One

UserTypeEJB



User-has-a-UserType
Many

UserEJB


userTypeLocal


UserType-has-many-Users




I have also added the following to jbosscmp-jdbc.xml:



User-UserType


UserType-has-many-Users


User-has-a-UserType
true


userTypeLocal
user_type_id







However, when the inserting the above xml fragment into jbosscmp-jdbc.xml, I get an 
error saying that there is no ejb-relationship-tag-name element. I do not know the 
reason for this, as I have followed the dtd for jbosscmp-jdbc.xml, and confirmed that 
the ejb-relationship-role-name tags match in both jbosscmp-jdbc.xml and ejb-jar.xml.

Another modification I have tried is removing the relationships tag altogether from 
jbosscmp-jdbc.xml. This allowed me to deploy my beans. I also added the following 
cmp-field to the 'user' entity in jbosscmp-jdbc.xml:

userTypeLocal
UTL

type
user_type
VARCHAR
VARCHAR(20)


This xml fragment is in jbosscmp.xml. The result of this is that there is a field 
called utl in the user_types table in the database. But the value being inserted into 
this field is not the foreign key integer id of the user_types table, but a serialized 
version of the UserTypeEJB.


Thank you.

Amar
[EMAIL PROTECTED]

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3840281#3840281

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3840281


---
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [Beginners Corner] - CMP 2.0 EJB relationship problem

2004-06-28 Thread amarpatel
The relationship between the User entity and UserType etity is as follows:
1 User can only have 1 UserType, but 1 UserType can belong to many Users. Furthermore, 
User maintains a reference to UserType, but UserType does not have a reference to 
User. So in ejb-jar.xml, we have defined the one-to-many unidirectional relationship 
between the UserEJB and the UserTypeEJB is as follows:

 
   
 User-UserType
 
   One
   
 UserTypeEJB
   
 
 
   User-has-a-UserType
   Many
   
 UserEJB
   
   
 userTypeLocal
   
 
 UserType-has-many-Users
   
  


I have also added the following to jbosscmp-jdbc.xml:

 
 
User-UserType


  
UserType-has-many-Users


  User-has-a-UserType
   true

 
   userTypeLocal
   user_type_id
 
   

 
 


However, when the inserting the above xml fragment into jbosscmp-jdbc.xml, I get an 
error saying that there is no ejb-relationship-tag-name element.  I do not know the 
reason for this, as I have followed the dtd for jbosscmp-jdbc.xml, and confirmed that 
the ejb-relationship-role-name tags match in both jbosscmp-jdbc.xml and ejb-jar.xml.

Another modification I have tried is removing the relationships tag altogether from 
jbosscmp-jdbc.xml.  This allowed me to deploy my beans.  I also added the following 
cmp-field to the 'user' entity in jbosscmp-jdbc.xml:

   userTypeLocal
   UTL
   
 type
 user_type
 VARCHAR
 VARCHAR(20)
   

This xml fragment is in jbosscmp.xml.  The result of this is that there is a field 
called utl in the user_types table in the database. But the value being inserted into 
this field is not the foreign key integer id of the user_types table, but a serialized 
version of the UserTypeEJB. 

Please advise on the following issues described above:
1. no ejb-relationship-role-name defined error.
2. serialized UserType being stored in RDBMS table users, instead of foreign key 
integer.

Thank you.

Amar
[EMAIL PROTECTED]

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3840181#3840181

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3840181


---
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user