
package board;
import java.io.Serializable;
import java.util.Enumeration;
import java.util.Vector;
import java.sql.*;

import javax.ejb.CreateException;
import javax.ejb.DuplicateKeyException;
import javax.ejb.EJBException;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.FinderException;
import javax.ejb.NoSuchEntityException;
import javax.ejb.ObjectNotFoundException;
import javax.ejb.RemoveException;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public class BoardBean implements EntityBean {

    final static boolean VERBOSE = true;

    public EntityContext ctx;
    public transient boolean isDirty;
    public Date  bdate;
    public Integer  bnum;
    public String  btitle;
    public String  bname;
    public String  bemail;
    public String  bpassword;
    public String  bcontent;

      public void setEntityContext(EntityContext ctx) {
        log("setEntityContext called (" + id() + ")");
        this.ctx = ctx;
      }
    
      public void unsetEntityContext() {
        log("BoardBean.unsetEntityContext (" + id() + ")");
        this.ctx = null;
      }
    
      public boolean isModified() {
        log("isModified(): isDirty = " + (isDirty ? "true" : "false"));
        isDirty = true;
        return isDirty;
      }
    
      public void setModified(boolean flag) {
        flag = true;
        isDirty = flag;
        log("setModified(): " + id() + (String) (flag ? ": requires saving" 
                             : ": saving not required"));
      }
    
      private String id() {
        return "" + System.identityHashCode(this) + ", PK = " + 
          (String) ((ctx == null) ? "nullctx" 
                     : ((ctx.getPrimaryKey() == null ?
                       "null" : ctx.getPrimaryKey().toString()))) +
                       "; isDirty = " + isDirty;
      }
    
      public void ejbActivate() {
          log("BoardBean.ejbActivate (" + id() + ")");
      }
    
      public void ejbPassivate() {
        log("BoardBean.ejbPassivate (" + id() + ")");
      }
    
      public void ejbLoad() {
        log("BoardBean.ejbLoad (" + id() +  ")");
      }
    
      public void ejbStore() {
        log("BoardBean.ejbStore (" + id() + ")");
    
        setModified(true);
      }
    
      public void ejbRemove()
        throws RemoveException
      {
        log("BoardBean.ejbRemove (" + id() + ")");
      }
    
      private void log(String s) {
        System.out.println(s);
      } 
    
    
    //////////////////////////////////////////////////
    //
    // generated ejbCreate()
    //
    //////////////////////////////////////////////////
    
    
    public java.lang.Integer ejbCreate(BoardData bData) throws CreateException{
    
        this.bdate = (java.sql.Date)  bData.bdate;
        this.bnum = new Integer( bData.bnum);
        this.btitle =  bData.btitle;
        this.bname =  bData.bname;
        this.bemail =  bData.bemail;
        this.bpassword =  bData.bpassword;
        this.bcontent =  bData.bcontent;
        return null;
    }
    
    
    //////////////////////////////////////////////////
    //
    // generated ejbPostCreate()
    //
    //////////////////////////////////////////////////
    
    
    public void ejbPostCreate(BoardData bData )
    {}
    
    //////////////////////////////////////////////////
    //
    // generated getter and setter
    //
    //////////////////////////////////////////////////
    
    
    public Date getBdate(){
        return bdate;
    }
    public void setBdate(Date bdate){
        this.bdate = bdate;
    }
    public int getBnum(){
        return bnum.intValue();
    }
    public void setBnum(int bnum){
        this.bnum = new Integer(bnum);
    }
    public String getBtitle(){
        return btitle;
    }
    public void setBtitle(String btitle){
        this.btitle = btitle;
    }
    public String getBname(){
        return bname;
    }
    public void setBname(String bname){
        this.bname = bname;
    }
    public String getBemail(){
        return bemail;
    }
    public void setBemail(String bemail){
        this.bemail = bemail;
    }
    public String getBpassword(){
        return bpassword;
    }
    public void setBpassword(String bpassword){
        this.bpassword = bpassword;
    }
    public String getBcontent(){
        return bcontent;
    }
    public void setBcontent(String bcontent){
        this.bcontent = bcontent;
    }

}
