1 19 20 package org.apache.cayenne.reflect; 21 22 28 public abstract class BaseToOneProperty extends BaseArcProperty implements ToOneProperty { 29 30 public BaseToOneProperty(ClassDescriptor owner, ClassDescriptor targetDescriptor, 31 Accessor accessor, String reverseName) { 32 super(owner, targetDescriptor, accessor, reverseName); 33 } 34 35 public void setTarget(Object source, Object target, boolean setReverse) { 36 Object oldTarget = readProperty(source); 37 if (oldTarget == target) { 38 return; 39 } 40 41 44 if (setReverse) { 45 setReverse(source, oldTarget, target); 46 } 47 48 writeProperty(source, oldTarget, target); 49 } 50 51 public boolean visit(PropertyVisitor visitor) { 52 return visitor.visitToOne(this); 53 } 54 } 55 | Popular Tags |