View Javadoc
1   package ejava.examples.orm.core.mapped;
2   
3   import java.math.BigDecimal;
4   
5   /**
6    * This class provides an example of providing more explicit mappings between
7    * the entity class and the database using orm.xml.
8    */
9   
10  public class Car  {    
11      private long id;
12      private String make;
13      private String model;
14      private int year;
15      private BigDecimal cost;
16      
17      public Car() {}
18      public Car(long id) { this.id = id; }
19      
20      public long getId() {
21          return id;
22      }
23  
24      public String getMake() { return make; }
25      public void setMake(String make) { this.make = make; }
26      
27      public String getModel() { return model; }
28      public void setModel(String model) {
29          this.model = model;
30      }
31      
32      public int getYear() { return year; }
33      public void setYear(int year) {
34          this.year = year;
35      }    
36      
37      public BigDecimal getCost() { return cost; }
38      public void setCost(BigDecimal cost) {
39          this.cost = cost;
40      }    
41      
42      public String toString() {
43          return super.toString()
44              + ", id=" + id
45              + ", make=" + make
46              + ", model=" + model
47              + ", year=" + year
48              + "$" + cost;        
49      }
50  }