View Javadoc

1   // Created on 14.11.2003
2   package com.pnpconsult.zeiterfassung.model;
3   
4   import com.pnpconsult.zeiterfassung.util.Description;
5   
6   
7   /***
8    * This entry is a user defined entry, that is not created from the 
9    * user entries, but manually inserted by the manager. This entry contains
10   * a manually defined description, that is not created by 
11   * 
12   * @author <a href="mailto:powerpete@users.sf.net">M. Petersen</a>
13   * @version $Id: BillEntry.java,v 1.4 2004/06/09 19:26:40 powerpete Exp $
14   * 
15   * @hibernate.class table="billentry"
16   */
17  public class BillEntry extends AbstractBaseEntry
18  {
19      private String description;
20      private float hours;
21      private float rate;
22      private Bill bill;
23  
24      /***
25       * @return Returns the description.
26       * 
27       * @hibernate.property
28       */
29      public String getDescription()
30      {
31          return description;
32      }
33  
34      /***
35       * @param description The description to set.
36       */
37      public void setDescription(String description)
38      {
39          this.description = description;
40      }
41  
42      /***
43       * @return Returns the hours.
44       * 
45       * @hibernate.property
46       */
47      public float getHours()
48      {
49          return hours;
50      }
51  
52      /***
53       * @param hours The hours to set.
54       */
55      public void setHours(float hours)
56      {
57          this.hours = hours;
58      }
59  
60      /***
61       * @return Returns the rate.
62       * 
63       * @hibernate.property
64       */
65      public float getRate()
66      {
67          return rate;
68      }
69  
70      /***
71       * @param rate The rate to set.
72       */
73      public void setRate(float rate)
74      {
75          this.rate = rate;
76      }
77      
78      /***
79       * @return Returns the bill.
80       * 
81       * @hibernate.many-to-one column="billId"
82       */
83      public Bill getBill()
84      {
85          return bill;
86      }
87  
88      /***
89       * @param bill The bill to set.
90       */
91      public void setBill(Bill bill)
92      {
93          this.bill = bill;
94      }
95  
96      protected Description buildDescription()
97      {
98          return new Description().append(description == null ? "" : description);
99      }
100 
101     public String getUserDescription()
102     {
103         throw new UnsupportedOperationException("BillEntry should not be used in user mode.");
104     }
105 
106     public String getBillDescription()
107     {
108         return toString();
109     }
110 }