timeentrybean.java

来自「考勤管理系统源码」· Java 代码 · 共 67 行

JAVA
67
字号
package com.wiley.compBooks.EJwithUML.TimeCardDomain;

import com.wiley.compBooks.EJwithUML.Base.EjbUtil.*;
import java.util.*;
import javax.ejb.*;
import javax.naming.*;

/**
 * The TimeEntry bean holds time entries for a date range.
 * TimeEntryBean is the actual entity bean implementation.
 */

public abstract class TimeEntryBean extends BasicEntityBean  implements TimeEntryInt
{

  /** CMP fields */
  public abstract String getId();
  public abstract void setId(String id);
  public abstract long getDay();
  public abstract void setDay(long day);
  public abstract int getHours();
  public abstract void setHours(int hours);

  /** CMR fileds */
  public abstract TimecardLocal getTimecard();
  public abstract void setTimecard(TimecardLocal card);
  public abstract ChargeCodeLocal getChargeCode();
  public abstract void setChargeCode(ChargeCodeLocal code);

  /**
   * Create an TimeEntryBean with the specified parameters. This is never
   * called directly.
   */
  public TimeEntryPK ejbCreate(String timeEntryId, Date day, int hours,
           ChargeCodeLocal code, TimecardLocal tcard) throws CreateException
  {
    System.out.println("in ejbCreate() of TimeEntryBean!");
    // sets the CMP fields
    setId(timeEntryId);
    setDay(day.getTime());
    setHours(hours);
    return null;
  }

  /** Actions performed after creation. This is never called directly. */
  public void ejbPostCreate(String timeEntryId, Date day, int hours,
                        ChargeCodeLocal code, TimecardLocal tcard)
  {
    System.out.println("in ejbPostCreate() of TimeEntryBean!");
    //sets CMR fields
    setChargeCode(code);
    setTimecard(tcard);
  }

  /** Answers the day the time is entered for. */
  public Date getDate()
  {
    return new Date(getDay());
  }

  /** sets the day the time is entered for. */
  public void setDate(Date date)
  {
    setDay(date.getTime());
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?