View Javadoc
1   package ejava.examples.orm.core.mapped;
2   
3   /**
4    * This class provides an example of embedding a primary key class within
5    * the containing class.
6    */
7   public class Napsack {
8       private NapsackPK pk;
9       private int size;
10      
11      public Napsack() {}
12      public Napsack(String make, String model) {
13          this.pk = new NapsackPK(make, model);
14      }
15      
16      public NapsackPK getPk() { return pk; }
17      
18      public int getSize() { return size; }
19      public void setSize(int size) {
20          this.size = size;
21      }
22      
23      public String toString() {
24          return super.toString() +
25             "pk=" + pk +
26             ", size=" + size;
27      }
28  }