summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/amazon/carbonado')
-rw-r--r--src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java8
-rw-r--r--src/main/java/com/amazon/carbonado/raw/GenericPropertyInfo.java2
-rw-r--r--src/main/java/com/amazon/carbonado/raw/StorablePropertyInfo.java4
3 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java b/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java
index c5417c4..d89aca5 100644
--- a/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java
+++ b/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java
@@ -1331,6 +1331,10 @@ public class GenericEncodingStrategy<S extends Storable> {
Class<?> adapterInstanceClass,
LocalVariable partialStartVar)
{
+ if (info.isDerived()) {
+ useReadMethod = true;
+ }
+
final TypeDesc type = info.getPropertyType();
final TypeDesc storageType = info.getStorageType();
@@ -2351,6 +2355,10 @@ public class GenericEncodingStrategy<S extends Storable> {
boolean useWriteMethod,
LocalVariable instanceVar,
Class<?> adapterInstanceClass) {
+ if (info.isDerived()) {
+ useWriteMethod = true;
+ }
+
TypeDesc type = info.getPropertyType();
TypeDesc storageType = info.getStorageType();
diff --git a/src/main/java/com/amazon/carbonado/raw/GenericPropertyInfo.java b/src/main/java/com/amazon/carbonado/raw/GenericPropertyInfo.java
index 9e246f2..fc082a5 100644
--- a/src/main/java/com/amazon/carbonado/raw/GenericPropertyInfo.java
+++ b/src/main/java/com/amazon/carbonado/raw/GenericPropertyInfo.java
@@ -46,6 +46,8 @@ public interface GenericPropertyInfo {
boolean isLob();
+ boolean isDerived();
+
/**
* Returns the optional method used to adapt the property from the
* storage supported type to the user visible type.
diff --git a/src/main/java/com/amazon/carbonado/raw/StorablePropertyInfo.java b/src/main/java/com/amazon/carbonado/raw/StorablePropertyInfo.java
index 18db76b..913bc7e 100644
--- a/src/main/java/com/amazon/carbonado/raw/StorablePropertyInfo.java
+++ b/src/main/java/com/amazon/carbonado/raw/StorablePropertyInfo.java
@@ -76,6 +76,10 @@ public class StorablePropertyInfo implements GenericPropertyInfo {
return clazz != null && Lob.class.isAssignableFrom(clazz);
}
+ public boolean isDerived() {
+ return mProp.isDerived();
+ }
+
public Method getFromStorageAdapter() {
return mFromStorage;
}