diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2007-04-29 17:47:50 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2007-04-29 17:47:50 +0000 |
commit | 97af4be638e371a2f693bde2798fc233a143f3f9 (patch) | |
tree | 533f5d02f91eaf1db500ed4480be23b1712d214d /src/main/java/com/amazon/carbonado/synthetic | |
parent | 1f04eea48231dbc29ed39c100a9d4a7c7f8a8b37 (diff) |
Merged in support for derived properties.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/synthetic')
-rw-r--r-- | src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceBuilder.java | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceBuilder.java b/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceBuilder.java index 2c9c0dc..0832aa9 100644 --- a/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceBuilder.java +++ b/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceBuilder.java @@ -493,23 +493,22 @@ public class SyntheticStorableReferenceBuilder<S extends Storable> continue;
}
- if (prop.getReadMethod() == null) {
- throw new SupportException
- ("Property does not have a public accessor method: " + prop);
- }
- if (prop.getWriteMethod() == null) {
- throw new SupportException
- ("Property does not have a public mutator method: " + prop);
- }
-
TypeDesc propType = TypeDesc.forClass(prop.getType());
if (toMasterPk) {
+ if (prop.getWriteMethod() == null) {
+ throw new SupportException
+ ("Property does not have a public mutator method: " + prop);
+ }
b.loadLocal(b.getParameter(0));
b.loadThis();
b.invokeVirtual(prop.getReadMethodName(), propType, null);
b.invoke(prop.getWriteMethod());
} else if (methodName.equals(mCopyFromMasterMethodName)) {
+ if (prop.getReadMethod() == null) {
+ throw new SupportException
+ ("Property does not have a public accessor method: " + prop);
+ }
b.loadThis();
b.loadLocal(b.getParameter(0));
b.invoke(prop.getReadMethod());
|