I'm not using Middlegen. Does it apply only for a 1:1 relation? If I remove the Fk Persistence tags for a 1:N relation. I get the following error.
"Both roles of a relation-table mapped relationship must have key fields: ejb-relation-name=userolesmap-role" .If I use those persistence tags for Fk fields, then I get an error during ejbCreate that there are multiple fk-columns. Thanks for all your help. -----Original Message----- From: Aslak Hellesoy [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 1:17 PM To: Shankar Srinivasan; [EMAIL PROTECTED] Subject: RE: [Xdoclet-user] CMR Remove the userIdFk persistence tags. This looks like middlegen output. Run middlegen with fkcmp="false". The container error is due to a JBoss limitation. See recent posts an this subject on the mailing list. Aslak > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Shankar > Srinivasan > Sent: 6. desember 2002 21:11 > To: [EMAIL PROTECTED] > Subject: [Xdoclet-user] CMR > > > I have two entities(UserMap and User) that are in a 1:1 relation. Userid > in User is a foreign key in UserMap..I don't have any problems with > creating a User entity. When I try to add to UserMap using UserLocal in > my ejbCreate, I get an exception that multiple userid_fk found. When I > checked my deployment descriptor, I found userid_fk under a cmp-field > and key-field. Is this causing the problem or my usage of any of the > tags is wrong? Please let me know. > Thanks > > Here is a code snippet.. > This wot the usermap contains > > /** > * Returns the userIdFk > * > * @return the userIdFk > * @ejb.persistent-field > * @ejb.persistence > * column-name="c_userid_fk" > * jdbc-type="INTEGER" > * sql-type="INTEGER" > */ > public abstract Long getUserIdFk(); > /** > * Sets the userIdFk > * > * @param java.lang.Long the new userIdFk value > */ > public abstract void setUserIdFk(Long userIdFk); > > /** > * Returns the related UserLocal > * > * @return the related UserLocal > * @ejb.interface-method > * view-type="local" > * @ejb.relation > * name="usermap-user" > * role-name="extuserid-maps-to-userid" > * @weblogic.column-map > * foreign-key-column="c_userid_fk" > * @jboss.relation > * fk-column="c_userid_fk" > * related-pk-field="userId" > */ > public abstract com.postx.common.interfaces.UserLocal getUser(); > > /** > * Sets the related UserLocal > * > * @param ContentLocal the related UserLocal > * @ejb.interface-method > * view-type="local" > * @param user the new CMR value > */ > public abstract void setUser(com.postx.common.interfaces.UserLocal > user); > > here is the ejbcreate abd postcreate for usermap > public java.lang.String ejbCreate(String > extUserId,com.postx.common.interfaces.UserLocal user,long userType,int > numericField,String textField) throws CreateException { > > public void ejbPostCreate(String > extUserId,com.postx.common.interfaces.UserLocal user,long userType,int > numericField,String textField) throws CreateException { > setUser(user); > } > > > This what I'm doing on the user entity side > > /** > * Returns a handle to UserMapLocal > * > * @return UserMapLocal > * @ejb.interface-method > * view-type="local" > * @ejb.relation > * name="usermap-user" > * role-name="UserId-maps-to-ExtUserId" > * target-ejb="UserMap" > * target-role-name="extuserid-maps-to-userid" > * @weblogic.target-column-map > * foreign-key-column="c_userid_fk" > * @jboss:target-relation > * related-pk-field="userId" > * fk-column="c_userid_fk" > */ > public abstract com.postx.common.interfaces.UserMapLocal > getUserMap(); > /** > * Sets a collection of related UserMapLocal > * > * @param UserMapLocal related usermap > * @ejb.interface-method > * view-type="local" > * @param usermap the new CMR value > */ > public abstract void > setUserMap(com.postx.common.interfaces.UserMapLocal usermap); > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Xdoclet-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/xdoclet-user ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
