EJB ENtity Bean
package hrm.ejb.data;
import java.util.*;
import java.rmi.*;
import java.sql.*;
import java.io.*;
import hrm.common.dto.*;
import frw.common.lib.*;
/**
<pre>
Program Name : Hrm_cp_houseBean
Description : Hrm_cp_house Table을 관리하는 Entity Bean 이다.
Create Date : 2011.10.11
History : 2011.10.11 Initial created by
</pre>
@version 1.0.0.1
@author
*/
public class Hrm_cp_houseBean extends CallableCommand implements Serializable{
private String dong; //동
private String ho; //호
private String room; //룸
private String note; //비고
private String mod_emp_id; //변경사번
private java.sql.Timestamp mod_date; //변경일시
private static final String insertStatement =
" insert into hrm_cp_house ( "
+" dong, ho, room, note, mod_emp_id"
+" , mod_date"
+" ) "
+" values( ?, ?, ?, ?, ?, sysdate) ";
private static final String updateStatement =
" update hrm_cp_house "
+" set note = ? "
+" , mod_emp_id = ? "
+" , mod_date = sysdate "
+" where dong = ? "
+" and ho = ? "
+" and room = ? " ;
private static final String deleteStatement =
" delete from hrm_cp_house where dong = ? "
+" and ho = ? "
+" and room = ? " ;
private static final String findByPKStatement =
" select * from hrm_cp_house where dong = ? "
+" and ho = ? "
+" and room = ? " ;
public Hrm_cp_houseBean() throws Exception{
super();
}
public Hrm_cp_houseBean(String sql) throws SQLException{
super(sql);
}
public static Hrm_cp_houseBean ejbCreate() throws SQLException {
return new Hrm_cp_houseBean(insertStatement);
}
public void setCreate(String dong // 동
,String ho // 호
,String room // 룸
,String note // 비고
,String mod_emp_id // 변경사번
) throws SQLException {
((PreparedStatement)getStatement()).setString(1, dong);
((PreparedStatement)getStatement()).setString(2, ho);
((PreparedStatement)getStatement()).setString(3, room);
((PreparedStatement)getStatement()).setString(4, note);
((PreparedStatement)getStatement()).setString(5, mod_emp_id);
}
public static Hrm_cp_houseBean ejbLoad() throws SQLException {
return new Hrm_cp_houseBean(findByPKStatement);
}
public void setLoad( String dong, String ho, String room) throws SQLException {
((PreparedStatement)getStatement()).setString(1, dong);
((PreparedStatement)getStatement()).setString(2, ho);
((PreparedStatement)getStatement()).setString(3, room);
ResultSet rset = null;
try {
rset = execute();
if (rset.next()) {
this.dong = rset.getString(1); // 동
this.ho = rset.getString(2); // 호
this.room = rset.getString(3); // 룸
this.note = rset.getString(4); // 비고
this.mod_emp_id = rset.getString(5); // 변경사번
this.mod_date = rset.getTimestamp(6); // 변경일시
}
}catch(Exception e) {
throw new SQLException();
} finally {
cleanUp();
rset.close();
}
}
public void ejbStore() throws SQLException {
setSQLString(updateStatement);
stmt = getConnection().prepareCall(sqlString);
}
public void setStore( String dong, String ho, String room ) throws SQLException {
((PreparedStatement)getStatement()).setString(1, note);
((PreparedStatement)getStatement()).setString(2, mod_emp_id);
((PreparedStatement)getStatement()).setString(3, dong);
((PreparedStatement)getStatement()).setString(4, ho);
((PreparedStatement)getStatement()).setString(5, room);
}
public static Hrm_cp_houseBean ejbRemove() throws SQLException {
return new Hrm_cp_houseBean(deleteStatement);
}
public void setRemove( String dong, String ho, String room) throws SQLException {
((PreparedStatement)getStatement()).setString(1, dong);
((PreparedStatement)getStatement()).setString(2, ho);
((PreparedStatement)getStatement()).setString(3, room);
}
public String getDong() { // 동
return dong;
}
public String getHo() { // 호
return ho;
}
public String getRoom() { // 룸
return room;
}
public String getNote() { // 비고
return note;
}
public String getMod_emp_id() { // 변경사번
return mod_emp_id;
}
public java.sql.Timestamp getMod_date() { // 변경일시
return mod_date;
}
public void setDong(String dong) { // 동
this.dong = dong;
}
public void setHo(String ho) { // 호
this.ho = ho;
}
public void setRoom(String room) { // 룸
this.room = room;
}
public void setNote(String note) { // 비고
this.note = note;
}
public void setHrm_cp_house(Hrm_cp_houseDTO dto) {
try {
if (dto.getFlag().equals("U")) {
if (dto.getMod_emp_id() != null) setMod_emp_id(dto.getMod_emp_id()); // 변경사번
}
if (dto.getNote() != null) setNote(dto.getNote()); // 비고
if (dto.getMod_date() != null) setMod_date(dto.getMod_date()); // 변경일시
} catch (Exception e) {
e.printStackTrace();
}
}
}
import java.util.*;
import java.rmi.*;
import java.sql.*;
import java.io.*;
import hrm.common.dto.*;
import frw.common.lib.*;
/**
<pre>
Program Name : Hrm_cp_houseBean
Description : Hrm_cp_house Table을 관리하는 Entity Bean 이다.
Create Date : 2011.10.11
History : 2011.10.11 Initial created by
</pre>
@version 1.0.0.1
@author
*/
public class Hrm_cp_houseBean extends CallableCommand implements Serializable{
private String dong; //동
private String ho; //호
private String room; //룸
private String note; //비고
private String mod_emp_id; //변경사번
private java.sql.Timestamp mod_date; //변경일시
private static final String insertStatement =
" insert into hrm_cp_house ( "
+" dong, ho, room, note, mod_emp_id"
+" , mod_date"
+" ) "
+" values( ?, ?, ?, ?, ?, sysdate) ";
private static final String updateStatement =
" update hrm_cp_house "
+" set note = ? "
+" , mod_emp_id = ? "
+" , mod_date = sysdate "
+" where dong = ? "
+" and ho = ? "
+" and room = ? " ;
private static final String deleteStatement =
" delete from hrm_cp_house where dong = ? "
+" and ho = ? "
+" and room = ? " ;
private static final String findByPKStatement =
" select * from hrm_cp_house where dong = ? "
+" and ho = ? "
+" and room = ? " ;
public Hrm_cp_houseBean() throws Exception{
super();
}
public Hrm_cp_houseBean(String sql) throws SQLException{
super(sql);
}
public static Hrm_cp_houseBean ejbCreate() throws SQLException {
return new Hrm_cp_houseBean(insertStatement);
}
public void setCreate(String dong // 동
,String ho // 호
,String room // 룸
,String note // 비고
,String mod_emp_id // 변경사번
) throws SQLException {
((PreparedStatement)getStatement()).setString(1, dong);
((PreparedStatement)getStatement()).setString(2, ho);
((PreparedStatement)getStatement()).setString(3, room);
((PreparedStatement)getStatement()).setString(4, note);
((PreparedStatement)getStatement()).setString(5, mod_emp_id);
}
public static Hrm_cp_houseBean ejbLoad() throws SQLException {
return new Hrm_cp_houseBean(findByPKStatement);
}
public void setLoad( String dong, String ho, String room) throws SQLException {
((PreparedStatement)getStatement()).setString(1, dong);
((PreparedStatement)getStatement()).setString(2, ho);
((PreparedStatement)getStatement()).setString(3, room);
ResultSet rset = null;
try {
rset = execute();
if (rset.next()) {
this.dong = rset.getString(1); // 동
this.ho = rset.getString(2); // 호
this.room = rset.getString(3); // 룸
this.note = rset.getString(4); // 비고
this.mod_emp_id = rset.getString(5); // 변경사번
this.mod_date = rset.getTimestamp(6); // 변경일시
}
}catch(Exception e) {
throw new SQLException();
} finally {
cleanUp();
rset.close();
}
}
public void ejbStore() throws SQLException {
setSQLString(updateStatement);
stmt = getConnection().prepareCall(sqlString);
}
public void setStore( String dong, String ho, String room ) throws SQLException {
((PreparedStatement)getStatement()).setString(1, note);
((PreparedStatement)getStatement()).setString(2, mod_emp_id);
((PreparedStatement)getStatement()).setString(3, dong);
((PreparedStatement)getStatement()).setString(4, ho);
((PreparedStatement)getStatement()).setString(5, room);
}
public static Hrm_cp_houseBean ejbRemove() throws SQLException {
return new Hrm_cp_houseBean(deleteStatement);
}
public void setRemove( String dong, String ho, String room) throws SQLException {
((PreparedStatement)getStatement()).setString(1, dong);
((PreparedStatement)getStatement()).setString(2, ho);
((PreparedStatement)getStatement()).setString(3, room);
}
public String getDong() { // 동
return dong;
}
public String getHo() { // 호
return ho;
}
public String getRoom() { // 룸
return room;
}
public String getNote() { // 비고
return note;
}
public String getMod_emp_id() { // 변경사번
return mod_emp_id;
}
public java.sql.Timestamp getMod_date() { // 변경일시
return mod_date;
}
public void setDong(String dong) { // 동
this.dong = dong;
}
public void setHo(String ho) { // 호
this.ho = ho;
}
public void setRoom(String room) { // 룸
this.room = room;
}
public void setNote(String note) { // 비고
this.note = note;
}
public void setHrm_cp_house(Hrm_cp_houseDTO dto) {
try {
if (dto.getFlag().equals("U")) {
if (dto.getMod_emp_id() != null) setMod_emp_id(dto.getMod_emp_id()); // 변경사번
}
if (dto.getNote() != null) setNote(dto.getNote()); // 비고
if (dto.getMod_date() != null) setMod_date(dto.getMod_date()); // 변경일시
} catch (Exception e) {
e.printStackTrace();
}
}
}
댓글
댓글 쓰기
질문이나 의견은 요기에 남겨주세요 ^^,,