View Javadoc
1   package ejava.examples.orm.core.mapped;
2   
3   /**
4    * This class provides a pure POJO class that is mapped by BIKE-orm.xml
5    * into the database. See the annotated Bike example for how this can be done 
6    * through class annotations.
7    */
8   public class Bike {
9       private long id; //orm.xml file will map this field to Identity
10      private String make;
11      private String model;
12      private int size;
13      
14      public Bike() {}
15      public Bike(long id) { this.id = id; }
16  
17      public long getId() {
18          return id;
19      }
20  
21      public String getMake() { return make; }
22      public void setMake(String make) {
23          this.make = make;
24      }
25      
26      public String getModel() { return model; }
27      public void setModel(String model) {
28          this.model = model;
29      }
30      
31      public int getSize() { return size;}
32      public void setSize(int size) {
33          this.size = size;
34      }
35      
36      public String toString() {
37          return super.toString() + " id=" + id + 
38              ", make=" + make + 
39              ", model=" + model + 
40              ", " + size + "in";
41      }
42  }