package de.tutorials.ejb.domain;
import java.rmi.RemoteException;
import javax.ejb.CreateException;
import javax.ejb.EJBException;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.RemoveException;
/**
* @author Darimont
* @ejb.bean name="Person" display-name="Person" primkey-field = "id"
* description="Description for Person" type="CMP" cmp-version="2.x"
* view-type="local"
* @ejb.value-object generatePKConstructor = "true" name = "Person"
* @ejb.finder signature = "Person findPersonByName(java.lang.String name)"
* description = "Find Person by Name" query = "SELECT OBJECT(p) FROM Person AS p WHERE p.name=?1"
* @ejb.finder signature = "Collection findPersonsByNamePattern(java.lang.String name)"
* description = "Find Persons by Namepattern" query = "SELECT OBJECT(p) FROM Person AS p WHERE p.name like ?1"
* @jboss.persistence create-table = "true" datasource = "java:/MySqlDS"
* datasource-mapping = "mySQL" table-name = "person"
* @jboss.entity-command name = "mysql-get-generated-keys"
*/
public abstract class PersonBean implements EntityBean {
public abstract void setId(Integer id);
/**
* @ejb.interface-method
* @ejb.pk-field
* @jboss.persistence auto-increment = "true"
* @ejb.persistence column-name = "id"
* @ejb.value-object
* @return
*/
public abstract Integer getId();
/**
* @ejb.interface-method
* @ejb.persistence column-name = "name"
* @ejb.value-object
* @return
*/
public abstract String getName();
/**
* @ejb.interface-method
* @ejb.value-object
* @return
*/
public abstract void setName(String name);
/**
* @ejb.create-method view-type = "local"
* @param id
* @return
* @throws CreateException
*/
/*
* EJB Lifecycle Methods (Begin)
*/
public Integer ejbCreate(Integer id) throws CreateException { setId(id); return null; }
public void ejbPostCreate(Integer id) {}
/**
* @ejb.create-method view-type = "local"
* @param id
* @return
* @throws CreateException
*/
public Integer ejbCreate() throws CreateException { return null; }
public void ejbPostCreate() { }
public PersonBean() {}
public void setEntityContext(EntityContext ctx) throws EJBException, RemoteException {}
public void unsetEntityContext() throws EJBException, RemoteException {}
public void ejbRemove() throws RemoveException, EJBException,RemoteException {}
public void ejbActivate() throws EJBException, RemoteException {}
public void ejbPassivate() throws EJBException, RemoteException {}
public void ejbLoad() throws EJBException, RemoteException {}
public void ejbStore() throws EJBException, RemoteException {}
/*
* EJB Lifecycle Methods (End)
*/
}