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

Reply via email to