?? jobbean.java
字號(hào):
package data;
import java.rmi.*;
import java.sql.*;
import java.util.*;
import javax.ejb.*;
import javax.naming.*;
import javax.sql.*;
public abstract class JobBean implements EntityBean
{
// CMP fields
public abstract String getRef ();
public abstract void setRef (String ref);
public abstract String getCustomer ();
public abstract void setCustomer (String customer);
public abstract String getDescription ();
public abstract void setDescription(String description);
// CMR fields
public abstract LocationLocal getLocation ();
public abstract void setLocation(LocationLocal location);
public abstract Collection getSkills();
public abstract void setSkills(Collection skills);
// EJB methods start here
public void ejbPostCreate (String ref, String customer) {}
public JobPK ejbCreate (String ref, String customer) throws CreateException {
JobPK key = new JobPK(ref,customer);
try {
((JobLocalHome)ctx.getEJBLocalHome()).findByPrimaryKey(key);
throw new CreateException("Duplicate job name: "+key);
}
catch (FinderException ex) {}
setRef(ref);
setCustomer(customer);
setDescription("");
return null;
}
public void ejbHomeDeleteByCustomer(String customer) throws FinderException, RemoveException {
Collection jobs = ((JobLocalHome)ctx.getEJBLocalHome()).findByCustomer(customer);
for (Iterator iter = jobs.iterator(); iter.hasNext(); ) {
JobLocal job = (JobLocal)iter.next();
iter.remove();
job.remove();
}
}
public void ejbLoad() {}
public void ejbStore() {}
public void ejbPassivate() {}
public void ejbActivate() {}
public void ejbRemove() {}
private EntityContext ctx;
public void setEntityContext(EntityContext ctx) {
this.ctx = ctx;
}
public void unsetEntityContext() {
this.ctx = null;
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -