From 97af4be638e371a2f693bde2798fc233a143f3f9 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Sun, 29 Apr 2007 17:47:50 +0000 Subject: Merged in support for derived properties. --- .../synthetic/SyntheticStorableReferenceBuilder.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/synthetic') 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 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()); -- cgit v1.2.3