1 8 9 package collections.ship.factory; 10 11 import java.io.Serializable ; 12 13 import com.sleepycat.bind.tuple.MarshalledTupleKeyEntity; 14 import com.sleepycat.bind.tuple.TupleInput; 15 import com.sleepycat.bind.tuple.TupleOutput; 16 17 33 public class Part implements Serializable , MarshalledTupleKeyEntity { 34 35 private transient String number; 36 private String name; 37 private String color; 38 private Weight weight; 39 private String city; 40 41 public Part(String number, String name, String color, Weight weight, 42 String city) { 43 44 this.number = number; 45 this.name = name; 46 this.color = color; 47 this.weight = weight; 48 this.city = city; 49 } 50 51 public final String getNumber() { 52 53 return number; 54 } 55 56 public final String getName() { 57 58 return name; 59 } 60 61 public final String getColor() { 62 63 return color; 64 } 65 66 public final Weight getWeight() { 67 68 return weight; 69 } 70 71 public final String getCity() { 72 73 return city; 74 } 75 76 public String toString() { 77 78 return "[Part: number=" + number + 79 " name=" + name + 80 " color=" + color + 81 " weight=" + weight + 82 " city=" + city + ']'; 83 } 84 85 87 public void marshalPrimaryKey(TupleOutput keyOutput) { 88 89 keyOutput.writeString(this.number); 90 } 91 92 public void unmarshalPrimaryKey(TupleInput keyInput) { 93 94 this.number = keyInput.readString(); 95 } 96 97 public boolean marshalSecondaryKey(String keyName, TupleOutput keyOutput) { 98 99 throw new UnsupportedOperationException (keyName); 100 } 101 102 public boolean nullifyForeignKey(String keyName) { 103 104 throw new UnsupportedOperationException (keyName); 105 } 106 } 107 | Popular Tags |