StudentBean.java
资源名称:某公司的java培训教材 [点击查看]
上传用户:dinglihq
上传日期:2013-02-04
资源大小:99958k
文件大小:3k
源码类别:
Java编程
开发平台:
Java
- package cmpsample;
- import javax.ejb.*;
- import java.util.*;
- abstract public class StudentBean implements EntityBean {
- EntityContext entityContext;
- public java.lang.String ejbCreate(java.lang.String studentID) throws CreateException {
- setStudentID(studentID);
- return null;
- }
- public java.lang.String ejbCreate(String id, String firstName, String lastName) throws CreateException {
- System.out.println(" -- StudentEJB - ejbCreate...");
- setStudentID(id);
- setFirstname(firstName);
- setLastname(lastName);
- return id;
- }
- public void ejbPostCreate(java.lang.String studentID) throws CreateException {
- /**@todo Complete this method*/
- }
- public void ejbPostCreate(String id, String firstName, String lastName) throws CreateException {
- /**@todo Complete this method*/
- }
- public void ejbRemove() throws RemoveException {
- /**@todo Complete this method*/
- }
- public ArrayList getAddressList() {
- ArrayList list = new ArrayList();
- Iterator c = getAddress().iterator();
- while (c.hasNext()) {
- list.add((Address)c.next());
- }
- return list;
- }
- public void addAddress (Address address) {
- getAddress().add(address);
- }
- public void addRoster(Roster roster){
- this.getRoster().add(roster);
- }
- public ArrayList getRosterList(){
- ArrayList list=new ArrayList();
- Iterator c=this.getRoster().iterator();
- while(c.hasNext()){
- list.add((Roster)c.next());
- }
- return list;
- }
- public abstract void setStudentID(java.lang.String studentID);
- public abstract void setFirstname(java.lang.String firstname);
- public abstract void setLastname(java.lang.String lastname);
- public abstract void setAddress(java.util.Collection address);
- public abstract void setRoster(java.util.Collection roster);
- public abstract java.lang.String getStudentID();
- public abstract java.lang.String getFirstname();
- public abstract java.lang.String getLastname();
- public abstract java.util.Collection getAddress();
- public abstract java.util.Collection getRoster();
- public void ejbLoad() {
- /**@todo Complete this method*/
- }
- public void ejbStore() {
- /**@todo Complete this method*/
- }
- public void ejbActivate() {
- /**@todo Complete this method*/
- }
- public void ejbPassivate() {
- /**@todo Complete this method*/
- }
- public void unsetEntityContext() {
- this.entityContext = null;
- }
- public void setEntityContext(EntityContext entityContext) {
- this.entityContext = entityContext;
- }
- }