1 package org.bsf.smartValueObject; 2 3 import org.bsf.smartValueObject.container.SmartCollection; 4 5 import java.util.Collection ; 6 import java.util.ArrayList ; 7 8 13 public class TestVO implements Versionable { 14 private Versionable v = new Version(); 15 16 public int id; 18 public String name; 19 public TestVO otherTestVO; 20 public Collection tests = new SmartCollection(new ArrayList (), new Version()); 21 22 public void setId(int id) { 23 touch("id"); 24 this.id = id; 25 } 26 27 public int getId() { 28 return this.id; 29 } 30 31 public void setName(String s) { 32 touch("name"); 33 this.name = s; 34 } 35 36 public String getName() { 37 return this.name; 38 } 39 40 public void setOtherTestVO(TestVO test) { 41 touch("otherTestVO"); 42 otherTestVO = test; 43 } 44 45 public boolean addTestVO(TestVO test) { 46 return tests.add(test); 47 } 48 49 public boolean removeTestVO(TestVO test) { 50 return tests.remove(test); 51 } 52 53 public void touch() { 54 v.touch(); 55 } 56 57 public void touch(String field) { 58 v.touch(field); 59 } 60 61 public void delete() { 62 v.delete(); 63 } 64 65 public void create() { 66 v.create(); 67 } 68 69 public boolean isCreated() { 70 return v.isCreated(); 71 } 72 73 public boolean isDeleted() { 74 return v.isDeleted(); 75 } 76 77 public boolean isDirty() { 78 return v.isDirty(); 79 } 80 81 public void markClean() { 82 v.markClean(); 83 } 84 85 88 public long getVersionId() { 89 return v.getVersionId(); 90 } 91 92 public void setVersionId(long id) { 93 v.setVersionId(id); 94 } 95 96 public String toString() { 97 return "TestVO: id=" + id; 98 } 99 } | Popular Tags |