Record.java
01 package trail.entity.beans;
02 
03 import javax.persistence.*;
04 import java.io.Serializable;
05 
06 @Entity
07 @Table(name = "record")
08 @DiscriminatorColumn(name="record_type")
09 @DiscriminatorValue(value="B")
10 public class Record implements Serializable {
11   protected int id;
12   protected Fund fund;
13   protected Investor investor;
14   protected double saving;
15   protected double result;
16 
17   public Record () { }
18 
19   public Record (Fund fund, Investor investor, double saving, double result) {
20     this.fund = fund;
21     this.investor = investor;
22     this.saving = saving;
23     this.result = result;
24   }
25 
26   @Id
27   @GeneratedValue
28   public int getId () {
29     return id;
30   }
31 
32   public void setId (int id) {
33     this.id = id;
34   }
35 
36   @ManyToOne(optional=false)
37   @JoinColumn(name="my_fundid")
38   public Fund getFund () {
39     return fund;
40   }
41 
42   public void setFund (Fund fund) {
43     this.fund = fund;
44   }
45 
46   @ManyToOne(optional=false)
47   // Use the system-specified join column
48   public Investor getInvestor () {
49     return investor;
50   }
51 
52   public void setInvestor (Investor investor) {
53     this.investor = investor;
54   }
55 
56   public double getSaving () {
57     return saving;
58   }
59 
60   public void setSaving (double saving) {
61     this.saving = saving;
62   }
63 
64   public double getResult () {
65     return result;
66   }
67 
68   public void setResult (double result) {
69     this.result = result;
70   }
71 
72 }