Yes, it would be a problem having to put common
ejbCreate statements in all the classes that extend
the base class.  There are a lot of classes that
extend it and it would present maintenance problems if
I did that.

Yes, the local reference has to be passed to establish
the CMR relationship within ejbPostCreate.

Any more suggestions?

Thanks.

--- Marco Mistroni <[EMAIL PROTECTED]> wrote:

> Hello,
>  thanks for clarification... :)
>  will it be a big problem for you if you put the
> ejb-create method inside
> MYDataBean (the original class that extends
> EntityBean)?
>  i guess all methods 'setSessionContext', ejbStore,
> ejbCreate should go into
> your MyDataBean, and all business
> methods in
>   any particular reason of why you can't?
>  under all, you want to take advantage of business
> method in your POJO
> class, correct?
>  so your POJO shouldn't have any ejb-create....
>  HTH
>  marco
>  PS why are you passing a local interface in your
> EJB create? is it part of
> your promary key?
> 
>  On 10/5/05, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> wrote:
> >
> > What you have provided is an entity bean. There
> are
> > no problems when declaring @ejb.create-method
> directly
> > within an entity bean.
> >
> > The problem occurs when declaring the
> > @ejb.create-method tag within a plain old Java
> > abstract base class that the entity beans extend
> to
> > take advantage of the plain Java abtract base
> class'
> > fields and methods.
> >
> > Take a look at my original post and you will
> notice
> > that my base class is just a plain old Java
> abstract
> > class that does not implement
> javax.ejb.EntityBean.
> > This type of setup works well with
> > @ejb.interface-method and @ejb.persistence tags
> > declared within the plain old Java abstract base
> class
> > that is extended by entity beans and will put
> those
> > methods in the XDoclet generated *BeanCMP classes,
> the
> > remote and local interfaces, and the generated
> > deployment descriptor. The only quirk is that
> XDoclet
> > has problems generating the create methods within
> the
> > local/remote home interfaces when
> @ejb.create-method
> > is declared in the plain old Java abstract base
> class
> > that the entity beans extend, but XDoclet will
> > generate the correct deployment descriptor
> > (ejb-jar.xml) information under
> >
> <assembly-descriptor><container-transaction><method>
> > ...blah, blah, blah, ...
> >
>
</method></container-transaction></assembly-descriptor>
> > if you include the @ejb.transaction tag along with
> the
> > @ejb.create-method tag. I have included a sample
> of
> > the code again below.
> >
> > Thanks.
> >
> > *********Sample Base & Entity Classes*********
> >
> > public abstract class MyDataBaseBean {
> >
> > /**
> > * Creates a new instance of MyDataBaseBean
> > */
> > public MyDataBaseBean() {
> > }
> >
> > /**
> > * @ejb.create-method
> > * view-type="local"
> > * @ejb.transaction
> > * type="Required"
> > */
> > public test.primkeys.MyDataBeanPK
> > ejbCreate( test.MyData myData,
> > test.localinterfaces.MyDataLocal myDataLocal)
> throws
> > javax.ejb.CreateException {
> > setMyData1(myData.getData1());
> > setMyData2(myData.getData2());
> >
> > return null;
> > }
> >
> > public void ejbPostCreate(test.MyData myData,
> > test.localinterfaces.MyDataLocal myDataLocal)
> throws
> > javax.ejb.CreateException {
> > setMyData(myDataLocal);
> > }
> >
> > /**
> > * @ejb.interface-method
> > * view-type="local"
> > * @ejb.persistence
> > * column-name="high"
> > */
> > public abstract java.math.BigDecimal getHigh();
> > public abstract void setHigh(java.math.BigDecimal
> > high);
> >
> > .........
> >
> > }
> >
> > /**
> > * @ejb.bean
> > * name="MyDataABean"
> > * type="CMP"
> > * @ejb.pk <http://ejb.pk/>
> > * class="test.primkeys.MyDataBeanPK "
> > *
> > * @jboss.audit-updated-time
> > * field-name="updated"
> > * column-name="updated"
> > * @jboss.persistence
> > * table-name="MyDataA"
> > */
> > public abstract class MyDataABean extends
> > MyDataBaseBean implements javax.ejb.EntityBean {
> > private javax.ejb.EntityContext context;
> >
> > .........
> >
> > }
> >
> >
> >
> >
> > --- Marco Mistroni <[EMAIL PROTECTED] > wrote:
> >
> > > Hello,
> > > ok could you do something for me?
> > > i write below the ejb that i m using, would you
> > > mind running xdoclet
> > > against it and tell me
> > > what's get generated, so i see if the problem is
> the
> > > xdoclet tags or the
> > > environment?
> > > here it is
> > > -----------------------------------------------
> > >
> > > package com.myapp.ejb;
> > >
> > > import javax.ejb.*;
> > >
> > > /**
> > > * @ejb.bean
> > > * name="ExpenseType"
> > > * type="CMP"
> > > * cmp-version="2.x"
> > > * jndi-name="budget/ExpenseTypeHome"
> > > * primkey-field="id"
> > > *
> > > * @ejb.finder
> > > * signature="java.util.Collection findAll()"
> > > *
> > > * @ejb.persistence table-name="types"
> > > *
> > > * @openejb
> > > *
> > > * @ejb.transaction type="Required"
> > > *
> > > * @jboss.unknown-pk class="java.lang.Integer"
> > > * auto-increment="true"
> > > *
> > > * @jboss.persistence
> datasource="worldcorp/MySqlDS"
> > > * createTable="false"
> > > * removeTable="false"
> > > *
> > > */
> > > public abstract class ExpenseTypeBean implements
> > > EntityBean
> > > {
> > >
> > > /** @ejb.create-method */
> > > public Integer ejbCreate(Integer type, String
> > > description) throws
> > > CreateException {
> 
=== message truncated ===



                
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
xdoclet-user mailing list
xdoclet-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to