?? regbean.java
字號:
/*
* Created on 2008-6-8
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package cn.edu.zucc.research.ejb.bmp.reg;
import java.util.Collection;
import java.util.Date;
import javax.ejb.EJBException;
import javax.ejb.EntityContext;
import javax.ejb.FinderException;
import javax.ejb.ObjectNotFoundException;
import javax.ejb.RemoveException;
/**
*
* <!-- begin-user-doc --> You can insert your documentation for '
* <em><b>RegBean</b></em>'. <!-- end-user-doc --> * <!--
* begin-lomboz-definition --> <?xml version="1.0" encoding="UTF-8"?>
* <lomboz:EJB xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
* xmlns:lomboz="http://lomboz.objectlearn.com/xml/lomboz"> <lomboz:entity>
* <lomboz:entityEjb><j2ee:display-name>Reg </j2ee:display-name>
* <j2ee:ejb-name>RegEjb </j2ee:ejb-name>
* <j2ee:ejb-class>cn.edu.zucc.research.ejb.bmp.reg.RegBean </j2ee:ejb-class>
* <j2ee:persistence-type>Bean </j2ee:persistence-type> <j2ee:cmp-version>2.x
* </j2ee:cmp-version> <j2ee:abstract-schema-name>mySchema
* </j2ee:abstract-schema-name> </lomboz:entityEjb> <lomboz:tableName>
* </lomboz:tableName> <lomboz:dataSourceName></lomboz:dataSourceName>
* </lomboz:entity> </lomboz:EJB> <!-- end-lomboz-definition -->
*
* <!-- begin-xdoclet-definition -->
*
*
*
* /**
*
* @ejb.bean name="Reg" jndi-name="RegEjb" type="BMP"
*
* <!-- end-xdoclet-defintion -->
* @generated
*/
public abstract class RegBean implements javax.ejb.EntityBean {
// 用于保存容器相關(guān)信息
private EntityContext context;
//用于保存和處理實際數(shù)據(jù)
RegBeanOperator regOperator = new RegBeanOperator();
/**
*
* <!-- begin-user-doc --> The ejbCreate method. <!-- end-user-doc -->
*
* <!-- begin-xdoclet-definition -->
*
* @ejb.create-method <!-- end-xdoclet-definition -->
* @generated
*/
public Integer ejbCreate( String resNum, String resName,
String categoryId, String uploadStaff, Date checkDate,
String checkStaff, String checkRemark)
throws javax.ejb.CreateException {
// EJB 2.0 spec says return null for CMP ejbCreate methods.
// TODO: YOU MUST INITIALIZE THE FIELDS FOR THE BEAN HERE.
// setMyField("Something");
// begin-user-code
Integer resId;
try {
resId=this.regOperator.insertRow(resNum,resName,categoryId,uploadStaff,checkDate,
checkStaff,checkRemark);
} catch (Exception ex) {
throw new EJBException("ejbCreate: " + ex.getMessage());
}
this.regOperator.resId=resId;
this.regOperator.resNum=resNum;
this.regOperator.resName=resName;
this.regOperator.categoryId=categoryId;
this.regOperator.uploadStaff=uploadStaff;
this.regOperator.checkDate=checkDate;
this.regOperator.checkStaff=checkStaff;
this.regOperator.checkRemark=checkRemark;
return resId;
// end-user-code
}
/**
* <!-- begin-user-doc --> The container invokes this method immediately
* after it calls ejbCreate. <!-- end-user-doc -->
*
* @generated
*/
public void ejbPostCreate( String resNum, String resName,
String categoryId, String uploadStaff, Date checkDate,
String checkStaff, String checkRemark)
throws javax.ejb.CreateException {
// begin-user-code
// end-user-code
}
public void ejbRemove() throws RemoveException {
try {
this.regOperator.deleteRow(this.regOperator.resId);
} catch (Exception ex) {
throw new EJBException("ejbRemove: " + ex.getMessage());
}
}
public void setEntityContext(EntityContext context) {
this.context = context;
}
public void unEntityContext() {
}
public void ejbActivate() {
this.regOperator.resId =(Integer)context.getPrimaryKey();
}
public void ejbPassivate() {
this.regOperator.resId =null;
}
public void ejbLoad() {
try {
this.regOperator.loadRow();
} catch (Exception ex) {
throw new EJBException("ejbLoad: " + ex.getMessage());
}
}
public void ejbStore() {
try {
this.regOperator.storeRow();
} catch (Exception ex) {
throw new EJBException("ejbStore: " + ex.getMessage());
}
}
/**
* @ejb.interface-method view-type="remote"
*/
public Integer getResId() {
return this.regOperator.resId;
}
/**
* @ejb.interface-method view-type="remote"
*/
public void setResId(Integer resId) {
this.regOperator.resId = resId;
}
/**
* @ejb.interface-method view-type="remote"
*/
public String getResNum() {
return this.regOperator.resNum;
}
/**
* @ejb.interface-method view-type="remote"
*/
public void setResNum(String resNum) {
this.regOperator.resNum = resNum;
}
/**
* @ejb.interface-method view-type="remote"
*/
public String getResName() {
return this.regOperator.resName;
}
/**
* @ejb.interface-method view-type="remote"
*/
public void setResName(String resName) {
this.regOperator.resName = resName;
}
/**
* @ejb.interface-method view-type="remote"
*/
public String getCategoryId() {
return this.regOperator.categoryId;
}
* @ejb.interface-method view-type="remote"
*/
public void setCategoryId(String categoryId) {
this.regOperator.categoryId = categoryId;
}
/**
* @ejb.interface-method view-type="remote"
*/
public String getUploadStaff() {
return this.regOperator.uploadStaff;
}
/**
* @ejb.interface-method view-type="remote"
*/
public void setUploadStaff(String uploadStaff) {
this.regOperator.uploadStaff = uploadStaff;
}
/**
* @ejb.interface-method view-type="remote"
*/
public Date getCheckDate() {
return this.regOperator.checkDate;
}
/**
* @ejb.interface-method view-type="remote"
*/
public void setCheckDate(Date checkDate) {
this.regOperator.checkDate = checkDate;
}
/**
* @ejb.interface-method view-type="remote"
*/
public String getCheckStaff() {
return this.regOperator.checkStaff;
}
/**
* @ejb.interface-method view-type="remote"
*/
public void setCheckStaff(String checkStaff) {
this.regOperator.checkStaff = checkStaff;
}
/**
* @ejb.interface-method view-type="remote"
*/
public String getCheckRemark() {
return this.regOperator.checkRemark;
}
/**
* @ejb.interface-method view-type="remote"
*/
public void setCheckRemark(String checkRemark) {
this.regOperator.checkRemark = checkRemark;
public Collection ejbFindAll() throws FinderException {
Collection result;
try {
result = this.regOperator.selectAll();
} catch (Exception ex) {
throw new EJBException("ejbFindAll " + ex.getMessage());
}
return result;
}
public Integer ejbFindByPrimaryKey(Integer resId) throws FinderException {
boolean result;
try {
result = this.regOperator.selectByPrimaryKey(resId);
} catch (Exception ex) {
throw new EJBException("ejbFindByPrimaryKey: " + ex.getMessage());
}
if (result) {
return resId;
} else {
throw new ObjectNotFoundException("Row for id " + resId
+ " not found.");
}
}
public Collection ejbFindByResNum(String resNum) throws FinderException {
Collection result;
try {
result = this.regOperator.selectByResNum(resNum);
} catch (Exception ex) {
throw new EJBException("ejbFindByResNum " + ex.getMessage());
}
return result;
}
public Collection ejbFindFeasibility(String timeone, String timetwo)
throws FinderException {
Collection result;
try {
result = this.regOperator.selectFeasibility(timeone, timetwo);
} catch (Exception ex) {
throw new EJBException("ejbFindFeasibility " + ex.getMessage());
}
return result;
}
public Collection ejbFindNotChecked() throws FinderException {
Collection result;
try {
result = this.regOperator.selectNotChecked();
} catch (Exception ex) {
throw new EJBException("ejbFindNotChecked " + ex.getMessage());
}
return result;
}
public Collection ejbFindChecked() throws FinderException {
Collection result;
try {
result = this.regOperator.selectChecked();
} catch (Exception ex) {
throw new EJBException("ejbFindChecked " + ex.getMessage());
}
return result;
}
public Collection ejbFindBySeaName(String propertyName, Object value,
String id) throws FinderException {
Collection result;
try {
result = this.regOperator.selectBySeaName(propertyName, value, id);
} catch (Exception ex) {
throw new EJBException("ejbFindSeaName " + ex.getMessage());
}
return result;
}
public Collection ejbFindBySeaNum(String propertyName, Object value,
String id) throws FinderException {
Collection result;
try {
result = this.regOperator.selectBySeaNum(propertyName, value, id);
} catch (Exception ex) {
throw new EJBException("ejbFindSeaNum " + ex.getMessage());
}
return result;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -