1 56 package org.objectstyle.cayenne; 57 58 import org.objectstyle.cayenne.access.DataContext; 59 import org.objectstyle.cayenne.validation.ValidationResult; 60 61 66 public interface DataObject extends Persistent { 67 public static final long DEFAULT_VERSION = Long.MIN_VALUE; 68 69 ObjectId getObjectId(); 70 71 void setObjectId(ObjectId id); 72 73 77 public DataContext getDataContext(); 78 79 82 public void setDataContext(DataContext ctxt); 83 84 89 public void writePropertyDirectly(String propertyName, Object val); 90 91 96 public Object readPropertyDirectly(String propertyName); 97 98 136 public Object readNestedProperty(String path); 137 138 143 public Object readProperty(String propName); 144 145 150 public void writeProperty(String propName, Object val); 151 152 public void addToManyTarget(String relName, DataObject val, boolean setReverse); 153 154 public void removeToManyTarget(String relName, DataObject val, boolean setReverse); 155 156 public void setToOneTarget(String relName, DataObject val, boolean setReverse); 157 158 162 public void fetchFinished(); 163 164 170 public long getSnapshotVersion(); 171 172 175 public void setSnapshotVersion(long snapshotVersion); 176 177 183 public void resolveFault(); 184 185 192 public void validateForInsert(ValidationResult validationResult); 193 194 201 public void validateForUpdate(ValidationResult validationResult); 202 203 210 public void validateForDelete(ValidationResult validationResult); 211 } 212 | Popular Tags |