Hi all,
i am little new to XDoclet..
i have been generating successfully EJBs using XDoclet, but
now i am encountering problems with CMR.
I have two EJBS, UserBean and UserInfoBean which have
1 to 1 relationship.
in the UserBean i have defined following method
/**
* @return return the User associated to this UserInfo
* @ejb.interface-method
* @ejb.transaction type="Required"
* @ejb.relation
* name="UserHasUserInfo"
* role-name="UserHasUserInfo"
* @weblogic.target-column-map
* foreign-key-column="email"
*/
public abstract UserInfoLocal getUserInfo();
and in the UserInfoBean i have defined following method :
/**
* @return return the User associated to this UserInfo
* @ejb.interface-method
* @ejb.transaction type="Required"
* @ejb.relation
* name="UserHasUserInfo"
* role-name="UserInfoPartOfUser"
* @weblogic.target-column-map
* foreign-key-column="email"
**/
public abstract UserLocal getUser();
for some reason, in the weblogic-cmp-rdbms-jar.xml the following part
does not get generated
- <column-map>
<foreign-key-column>email</foreign-key-column>
<key-column>email</key-column>
</column-map>
i have the table tbl_user which contains an email field, and a tbl_userinfo
which also contains an email field, and i have added the constraint email_fk to the
table.
can anyone help me in figuring out what is the problem?
thanx in advance and regards
marco
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of
> ext Pedro
> Salazar
> Sent: 04 November, 2003 20:48
> To: [EMAIL PROTECTED]
> Subject: [Xdoclet-user] relationship 1:N --> CMP field for
> key not found
>
>
> Greetings,
>
> I have a table Access_Permission that _has_ relation 1-N to
> Access_Schedule.
>
> This table Access_Permission has two attributes (uniques), SID_ID and
> PRIMITIVE_ID, that would be the foreign keys of the table
> Access_Schedule.
>
> Access_Permission Access_Schedule
> ----------------- ---------------
> SID_ID -- 1-N --> SID_ID
> PRIMITIVE_ID PRIMITIVE_ID
> ... ...
> (SID_ID,PRIMITIVE_ID) UNIQUE (SID_ID,PRIMITIVE_ID) FK
>
> These tables are mapped in two entity beans (CMP). The Access_Schedule
> bean has *no primary keys*, only foreign keys. I created a
> field in the
> entity that not exist in the database (I don't know if this
> is the right
> procedure):
>
> /**
> * @ejb.pk-field
> * @ejb.interface-method
> * view-type="local"
> * @ejb.persistence
> **/
> public abstract void setUnknownPK(int unknownPK);
>
>
> I'm using xdoclet to generate the descriptors and this is the entry of
> my relation on Access_Permission bean:
> /**
> * @ejb.relation
> * name="access_permission_TO__access_schedule"
> * role-name="access_permission_HAS_schedules"
> * cascade-delete="no"
> * target-ejb="AccessSchedule"
> * target-role-name="schedules_BELONG_TO_access_permission"
> * target-cascade-delete="yes"
> * @ejb.interface-method
> * view-type="local"
> * @ejb.transaction
> * type="Supports"
> * @jboss.relation
> * related-pk-field="SIDId"
> * fk-column="SIDId"
> * @jboss.relation
> * related-pk-field="primitiveId"
> * fk-column="primitiveId"
> * @jboss.target-relation
> * related-pk-field="SIDId"
> * fk-column="SIDId"
> * @jboss.target-relation
> * related-pk-field="primitiveId"
> * fk-column="primitiveId"
> * @jboss.relation-mapping
> * style="relation-table"
> * @jboss.relation-table
> * table-name="uif_access_permission"
> */
> public abstract java.util.Collection getSchedules();
>
> This is the error I got:
>
> ...
> [ObjectName: jboss.j2ee:jndiName=ejb/AccessScheduleLocal,service=EJB
> state: FAILED
> I Depend On:
> Depends On Me: org.jboss.deployment.DeploymentException: CMP
> field for
> key not found: field name=SIDId, ObjectName:
> jboss.j2ee:jndiName=ejb/AccessPermissionLocal,service=EJB
> state: FAILED
> I Depend On:
> Depends On Me: org.jboss.deployment.DeploymentException: CMP
> field for
> key not found: field name=SIDId]
>
> Any comments are welcome!
>
> thanks,
> Pedro Salazar.
> --
> -PS
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive? Does it
> help you create better code? SHARE THE LOVE, and help us help
> YOU! Click Here: http://sourceforge.net/donate/
> _______________________________________________
> xdoclet-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/xdoclet-user
>
-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user