Hi,
I want to use xdoclet to create entity bean with Bean managed persistence.
The first problem is with the findermethods. How to declare ?
Where I must put this tag ?
@ejb:finder signature="StudentPK findByPrimaryKey(StudentPK pk)"
How I must implement this method ?
Another problem is the use of the primary key class. I need it to be the
used on the find method and it is the return type on ejbCreate.
But when I run xdoclet on the class I got a message the PK class is not
found. But it is being created.
I have it this, please comment what is wrong :
package com.sigea.adm.ejb;
import com.sigea.adm.interfaces.CursoPK;
/**
* @ejb:bean
* name="Curso"
* type="BMP"
* view-type="both"
* primekey-field="CodigoCurso"
*/
public abstract class CursoEjb implements EntityBean {
public EntityContext ctx;
/**
* @ejb:pk-field
* @ejb:persistent-field
*/
abstract public String getCodigoCurso ();
/**
* @ejb:persistent-field
*/
abstract public void setCodigoCurso (String arg1);
/**
* @ejb:persistent-field
*/
abstract public void setNomeCurso (String arg1);
/**
* @ejb:persistent-field
*/
abstract public String getNomeCurso();
public CursoEjb() {}
public void ejbActivate() throws EJBException {}
public void ejbPassivate() throws EJBException{}
/**
* @ejb:finder signature="CursoPK findByPrimaryKey(CursoPK pk)"
*/
public CursoPK ejbFindByPrimaryKey(CursoPK pk) throws
RemoteException, FinderException {
// .. the method is implemented on the standard way. Removed to keep the
message short.
}
public void ejbLoad() {
// .. the method is implemented on the standard way. Removed to keep the
message short.
}
public void ejbStore() {
// .. the method is implemented on the standard way. Removed to keep the
message short.
}
public void ejbRemove() throws RemoveException {
// .. the method is implemented on the standard way. Removed to keep the
message short.
}
public void setEntityContext( EntityContext actx) {
ctx = actx;
}
public void unsetEntityContext() {
ctx = null;
}
/**
* @ejb:create-method
*/
public CursoPK ejbCreate(String codigoCurso, String nomeCurso)
throws EJBException, CreateException {
// .. the method is implemented on the standard way. Removed to keep the
message short.
}
public void ejbPostCreate(String codigoCurso, String nomeCurso)
throws EJBException, CreateException {}
}
----
Danilo Luiz Rheinheimer
Florianopolis/SC Brasil
Sony Cli� 615C
mailto:[EMAIL PROTECTED]
----
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user