after review again the code i found out that the
problem is occurred at the tag used via xdoclet.
for instance, the tag marks relation field originally
using upperclass, EMAIL. that's the place where
issuing error.
now it works fine. 
thanks your help, sincerely.
<code>
         *
         * @jboss:relation
         *      fk-column="email"  -> EMAIL 
         *      related-pk-field="email" -> EMAIL
         * ...
</code>


 --- "Harkness, David" <[EMAIL PROTECTED]>
的訊息:> One line looks suspect to me, though I don't
know if
> it's the source of your trouble.
> 
> > @ejb:table-name     User
> 
> The correct tag is
> 
>     @ejb:persistence table-name="User"
> 
> At least that's what I'm using.
> 
> David Harkness
> Sr. Software Engineer
> Sony Pictures Digital Networks
> (310) 482-4756
> 
> 
> > -----Original Message-----
> > From: [mailto:[EMAIL PROTECTED] 
> > Sent: Tuesday, December 30, 2003 11:45 PM
> > To: [EMAIL PROTECTED]
> > Subject: [Xdoclet-user] [problem] one-one cmr
> bidirection
> > 
> > 
> > hi, i'm new to xdoclet and currently learning how
> to
> > compose cmr thru xdoclet.
> > however, there's a problem occurred. it issues
> "CMP
> > field for key not found".
> > the env contains j2sdk1.4.1_01,
> > jboss3.0.4-tomcat4.1.12, xdoclet-1.2b3.
> > the source is as A):
> > build file is as B):
> > i appreciate any suggestions, sincerely.
> > thank you very much.
> > 
> > =====A)======
> > package test.auth;
> > 
> > import javax.ejb.*;
> > import javax.naming.*;
> > import java.util.*;
> > import test.domain.*;
> > 
> > /**
> >  *
> >  * @ejb:bean        type="CMP"
> >  *          cmp-version="2.x"
> >  *          name="User"
> >  *          jndi.name="cmr.User"
> >  *          view-type="local"
> >  * @ejb:home        generate="local"        
> >  *          local-class="test.domain.UserLocalHome"
> >  * @ejb:interface   
> >  *          generate="local"
> >  *          local-class="test.domain.UserLocal"
> >  * @ejb:table-name  User
> >  * @ejb:finder
> >  *          signature="Collection findAll()"
> >  *          unchecked="true"
> >  *          query="select distinct Object(user) from User
> > user"
> >  *          result-type-mapping="Local"
> >  * @ejb:pk
> >  */
> > public abstract class UserBean implements
> EntityBean{
> >     /**
> >      * @ejb:create-method
> >      */
> >     public UserPK ejbCreate(String email, String
> > password) 
> >                     throws CreateException{
> >             setEmail(email);
> >             setPassword(password);
> >             return new UserPK(email);
> >     }
> >     public void ejbPostCreate(String email, String
> > password) 
> >                     throws CreateException{ }
> >     /**
> >      * @ejb:pk-field
> >      * @ejb:persistent-field
> >      * @jboss:column-name EMAIL
> >      * @ejb:interface-method        view-type="local"
> >      */
> >     public abstract String getEmail();
> >     /**
> >      * @ejb:persistent-field        view-type="local"
> >      */
> >     public abstract void setEmail(String email);
> >     /**
> >      * @ejb:persistent-field
> >      * @jboss:column-name PASSWORD
> >      * @ejb:interface-method        view-type="local"
> >      */
> >     public abstract String getPassword();
> >     /**
> >      * @ejb:interface-method        view-type="local"
> >      */
> >     public abstract void setPassword(String
> passwrod);
> > 
> >     /**
> >      * @ejb:interface-method        view-type="local"
> >      * @ejb:transaction     type="Required"
> >      * @ejb:relation        
> >      *      name="UserHasUserInfo"
> >      *      role-name="UserHasUserInfo"
> >      *      target-role-name="UserInofContainedByUser"
> >      * @jboss:relation
> >      *      fk-column="EMAIL"
> >      *      related-pk-field="EMAIL"
> >      */
> >     public abstract test.domain.UserInfoLocal
> > getUserInfo();
> >     /**
> >      * @ejb:interface-method        view-type="local"
> >      */
> >     public abstract void
> > setUserInfo(test.domain.UserInfoLocal userInfo);
> > 
> >             public void setEntityContext(EntityContext
> > context){ }
> >             public void unsetEntityContext(){ }
> >             public void ejbRemove() throws
> > javax.ejb.RemoveException{ }
> >             public void ejbLoad(){ }
> >             public void ejbStore(){ }
> >             public void ejbPassivate(){ }
> >             public void ejbActivate(){ }
> > 
> >     
> > }
> > 
> > ------------
> > package test.auth;
> > 
> > import javax.ejb.*;
> > import javax.naming.*;
> > import test.domain.*;
> > 
> > /**
> >  * @ejb:bean        type="CMP"
> >  *          cmp-version="2.x"
> >  *          name="UserInfo"
> >  *          jndi.name="cmr.UserInfo"
> >  *          view-type="local"
> >  * @ejb:home        generate="local"        
> >  *          local-class="test.domain.UserInfoLocalHome"
> >  * @ejb:interface   generate="local"
> >  *                  local-class="test.domain.UserInfoLocal"
> >  * @jboss:table-name        UserInfo
> >  * @ejb:finder
> signature="test.domain.UserInfoLocal
> > findByEmail(java.lang.String email)"
> >  *          unchecked="true"
> >  *          query="select distinct object(userinfo) from
> > UserInfo userinfo where userinfo.email = ?1"
> >  *          result-type-mapping="Local"
> >  * @ejb.pk
> >  */
> > public abstract class UserInfoBean implements
> > EntityBean{
> >     /**
> >      * @ejb:create-method
> >      */
> >     public UserInfoPK ejbCreate(String name, String
> > email, String dept,
> >                             String phone, boolean isEmployee) 
> >                     throws CreateException{
> >             setName(name);
> >             setEmail(email);
> >             setDept(dept);
> >             setPhone(phone);
> >             setEmployee(isEmployee);
> >             return new UserInfoPK(email);
> >     }
> > 
> >     public void ejbPostCreate(String name, String
> email,
> > String dept,
> >                             String phone, boolean isEmployee) 
> >                     throws CreateException{ }
> >     /**
> >      * @ejb:pk-field
> >      * @ejb:persistent-field
> >      * @jboss:column-field
> >      * ejb:interface-method         view-type="local"
> >      */
> >     public abstract String getEmail();
> >     /**
> >      * @ejb:persistent-field        view-type="local"
> >      */
> >     public abstract void setEmail(String value);
> > 
> >     /**
> >      * @ejb:persistent-field
> >      * @jboss:column-name   NAME
> 
=== message truncated === 

-----------------------------------------------------------------
每天都 Yahoo!奇摩
海的顏色、風的氣息、愛你的溫度,盡在信紙底圖
http://tw.promo.yahoo.com/mail_premium/stationery.html


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to