In your case you do not need to specify the pk-class. Instead, include the class-level tag "@ejb.bean primkey-field" and mark the accessor (setGroupName) with "@ejb.pk-field". Here's how I have AddressEJB tagged (I'm using Integer as the pk class):
/** * @ejb.bean * name="Address" * primkey-field="id" */ public class AddressEJB ... ... /** * @ejb.pk-field * @ejb.interface-method * @ejb.transaction type="Supports" * @ejb.persistence * column-name="id" */ public abstract Integer getId ( ) ; public abstract void setId ( Integer id ) ; That should be all you need. David Harkness Sony Pictures Digital Networks (310) 482-4756 -----Original Message----- From: Bryce Fischer [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 6:54 PM To: [EMAIL PROTECTED] Subject: [Xdoclet-user] Value Objects (and BMP Entities) Trying to generate a ValueObject from a BMP Entity Bean. The PK is a String, and I've specified @ejb.pk class = "java.lang.String". When it generates the Value Object, it insists on using the PK as if it was a custom PK class (pk.setGroupName(groupName)). I've included the source below with tags. It generates the following (Incorrect) methods: public void setGroupName( java.lang.String groupName ) { this.groupName = groupName; groupNameHasBeenSet = true; pk.setGroupName(groupName); } and public void setGroupName( java.lang.String groupName ) { this.groupName = groupName; groupNameHasBeenSet = true; pk.setGroupName(groupName); } The Getter's seem to be correct... Help... p.s. Here's the Bean Code (I've removed the bodies to make it shorter): package com.berzerkersoft.bisweb.db.ejb; /** * XDoclet-based BMP entity bean. * * To generate code: * <br> * <ul> * <li> Add Standard EJB module to XDoclet project properties * <li> Customize XDoclet configuration * <li> Run XDoclet * </ul> * <br> * Please see the included XDoclet Overview * and the XDoclet Reference in the help system for details * * @ejb.bean name = "Role" * type = "BMP" * display-name = "RoleItem" * description = "Role EJB" * view-type = "both" * jndi-name = "ejb/RoleHome" * local-jndi-name = "ejb/RoleLocalHome" * * @ejb.pk class = "java.lang.String" generate = "false" * * @ejb.util * generate="physical" * * @ejb.transaction type="Required" * * @ejb.resource-ref * res-ref-name = "jdbc/DaytonaDS" * res-type = "javax.sql.DataSource" * res-auth = "Container" * * @jboss.resource-ref * res-ref-name = "jdbc/DaytonaDS" * jndi-name = "java:/DaytonaDS" * * @ejb.value-object * name = "RoleVO" * match = "value" */ public abstract class RoleBean implements javax.ejb.EntityBean { private String groupName; private String password; private String userType; private String fullname; private String allowInsert; private String allowEdit; private String allowDelete; private String allowView; private String allowOther; private String options; Logger logger = Logger.getLogger( "com.berzerkersoft.bisweb.db.ejb.SysUserBean"); public EntityContext context; /** * @ejb.create-method * * @param username * @param fullname * @param allowinsert * @param allowedit * @param allowdelete * @param allowview * @param allowother * @return * @throws javax.ejb.CreateException */ public String ejbCreate(String username, String fullname, String allowinsert, String allowedit, String allowdelete, String allowview, String allowother) throws javax.ejb.CreateException { } /** * @param groupName * @return * @throws FinderException */ public String ejbFindByPrimaryKey(String groupName) throws FinderException { } /** * @param username * @return * @throws FinderException */ public Collection ejbFindByUser(String username) throws FinderException { } public void ejbPostCreate(String groupName, String fullname, String allowinsert, String allowedit, String allowdelete, String allowview, String allowother) throws javax.ejb.CreateException { } public void ejbLoad() { } public void ejbStore() { } public void ejbActivate() { } public void ejbPassivate() { logger.info("ejbPassivate()"); } public void setEntityContext(javax.ejb.EntityContext ctx) { logger.info("setContext()"); this.context = ctx; } public void unsetEntityContext() { logger.info("unsetEntityContext()"); this.context = null; } public void ejbRemove() throws javax.ejb.RemoveException { } /** * @ejb.value-object match="value" * @ejb.interface-method view-type = "both" * @return */ public String getAllowDelete() { return allowDelete; } /** * @ejb.value-object match="value" * @ejb.interface-method view-type = "both" * @return */ public String getAllowEdit() { return allowEdit; } /** * @ejb.value-object match="value" * @ejb.interface-method view-type = "both" * @return */ public String getAllowInsert() { return allowInsert; } /** * @ejb.value-object match="value" * @ejb.interface-method view-type = "both" * @return */ public String getAllowOther() { return allowOther; } /** * @ejb.value-object match="value" * @ejb.interface-method view-type = "both" * @return */ public String getAllowView() { return allowView; } /** * @ejb.value-object match="value" * @ejb.interface-method view-type = "both" * @return */ public String getFullname() { return fullname; } /** * @ejb.value-object match="value" * @ejb.interface-method view-type = "both" * @return */ public String getOptions() { return options; } /** * @ejb.value-object match="value" * @ejb.interface-method view-type = "both" * @return */ public String getPassword() { return password; } /** * @ejb.value-object match="value" * @ejb.pk-field * @ejb.interface-method view-type = "both" * @return */ public String getGroupName() { return groupName; } /** * @ejb.value-object match="value" * @ejb.interface-method view-type = "both" * @return */ public String getUserType() { return userType; } /** * @ejb.interface-method view-type = "both" * @param string */ public void setAllowDelete(String string) { allowDelete = string; } /** * @ejb.interface-method view-type = "both" * @param string */ public void setAllowEdit(String string) { allowEdit = string; } /** * @ejb.interface-method view-type = "both" * @param string */ public void setAllowInsert(String string) { allowInsert = string; } /** * @ejb.interface-method view-type = "both" * @param string */ public void setAllowOther(String string) { allowOther = string; } /** * @ejb.interface-method view-type = "both" * @param string */ public void setAllowView(String string) { allowView = string; } /** * @ejb.interface-method view-type = "both" * @param string */ public void setFullname(String string) { fullname = string; } /** * @ejb.interface-method view-type = "both" * @param string */ public void setOptions(String string) { options = string; } /** * @ejb.interface-method view-type = "both" * @param string */ public void setPassword(String string) { password = string; } /** * @ejb.interface-method view-type = "both" * @param string */ public void setGroupName(String string) { groupName = string; } /** * @ejb.interface-method view-type = "both" * @param string */ public void setUserType(String string) { userType = string; } } ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01 /01 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
