📄 addressbean.java
字号:
package com.j2eeapp.ch21.cmp;
import javax.ejb.EntityContext;
import javax.ejb.CreateException;
import java.util.Collection;
import javax.ejb.FinderException;
public abstract class AddressBean implements javax.ejb.EntityBean
{
private static final int SID=(int)System.currentTimeMillis();
private static int sid=SID;
public Integer ejbCreate(String street,String city,String state,String zip)throws CreateException
{
setId(new Integer(sid++));
setStreet(street);
setCity(city);
setState(state);
setZip(zip);
return null;
}
public void ejbPostCreate(String street,String city,String state,String zip)
{
}
public abstract Collection ejbSelectAll()
throws FinderException;
public abstract Customer ejbSelectCustomer(Address addr)
throws FinderException;
// customer home methods. These are wrappers of ejbSelect methods
public Collection ejbHomeQueryAll() throws FinderException
{
return ejbSelectAll();
}
public Customer ejbHomeQueryCustomer(Address addr) throws FinderException
{
return ejbSelectCustomer(addr);
}
public abstract Integer getId();
public abstract void setId(Integer id);
public abstract String getStreet();
public abstract void setStreet(String street);
public abstract String getCity();
public abstract void setCity(String city);
public abstract String getState();
public abstract void setState(String state);
public abstract String getZip();
public abstract void setZip(String zip);
public void setEntityContext(EntityContext ec){}
public void unsetEntityContext(){}
public void ejbLoad(){}
public void ejbStore(){}
public void ejbActivate(){}
public void ejbPassivate(){}
public void ejbRemove(){}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -