On Thu, 2003-09-04 at 15:19, [EMAIL PROTECTED] wrote: > I try to write BMP Beans with xDoclet and generate > ValueObjects. The VO is generated with 2 similar Methods : > > public class AttachmentValue > extends > java.lang.Object > implements java.io.Serializable > { > > private java.lang.Integer pk; > > public AttachmentValue() > { > } > > public AttachmentValue( ) > { > pk = this.getId(); > } > . > ..... > > My BMP Bean looks like this : > > /** xDoclet Tags > * @ejb.bean > * name="Attachment" > * jndi-name="ePostfach/entity/Attachment" > * local-jndi-name="ePostfach/entity/Attachment" > * type="BMP" > * primkey-field="id" > * > * @ejb.value-object > * match="*" > * > * @jboss-resource-ref > * res-ref-name="bmp/ds" > * jndi-name="mySQL_Test" > * @jboss.container-configuration > * name="Standard BMP EntityBean" > * > * @ejb.dao > * impl-jndi="AttachmentDAO" > * @ejb.env-entry > * name="AttachmentDAO" > * type="java.lang.String" > * value="de.fag.epostfach.dao.AttachmentDAO" > * > */ > public abstract class AttachmentBean implements EntityBean { > > > public abstract Integer getId(); > /** > * @ejb.pk-field > */ > public abstract void setId(Integer id); > > /** > * @ejb.create-method > */ > public Object ejbCreate() throws CreateException { > throw new IllegalStateException("Creation of Attachment is not > possible"); > } > /** > * @ejb.create-method > */ > public Object ejbCreate(Integer id) { > throw new IllegalStateException("Creation of Attachment is not > possible"); > } > public void ejbPostCreate() { > } > public void ejbPostCreate(Integer id) { > } > > }
The problem is probably due to having no persistent fields in the bean. The second constructor's arguments would be the list of persistent fields that fit the VO's 'match' parameter (match="*" in your case). > Also, do I have to use DAO with BMP or is this just > an option ? Just an option. If you don't include a class-level @ejb.dao tag, it won't generate a DAO for the bean nor insert the calls to it. Andrew. ------------------------------------------------------- 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