package org.mockejb.test.entity;
import java.util.Collection;
import java.util.Iterator;
import javax.ejb.*;
public abstract class PersonBean implements EntityBean {
private EntityContext context = null;
public Object ejbCreate( String firstName, String lastName ){
setFirstName( firstName );
setLastName( lastName );
return null;
}
public void ejbPostCreate( String firstName, String lastName ){
}
public abstract String getFirstName();
public abstract void setFirstName(String firstName);
public abstract String getLastName();
public abstract void setLastName(String lastName);
public abstract Collection getAddresses();
public abstract void setAddresses( Collection addresses);
public abstract long getId();
public abstract void setId( long id );
public abstract Collection ejbSelectAll( ) throws FinderException;
public void ejbHomeUpdateNames() throws FinderException {
Collection people = ejbSelectAll();
Iterator i = people.iterator();
while(i.hasNext() ){
Person person = (Person) i.next();
if( person.getLastName().equals("Smit")){
person.setLastName( "Smith");
}
}
}
public void setEntityContext(EntityContext c) {
context = c;
}
public void unsetEntityContext() {
context = null;
}
public void ejbRemove() throws RemoveException { }
public void ejbActivate() { }
public void ejbPassivate() { }
public void ejbStore() { }
public void ejbLoad() { }
}