From 5403ce66194832e9887cc0d0222ff449464e041f Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Fri, 18 Apr 2008 20:23:47 +0000 Subject: Support renamed properties in indexes and keys. --- .../com/amazon/carbonado/synthetic/SyntheticStorableBuilder.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/main/java/com/amazon/carbonado/synthetic') diff --git a/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableBuilder.java b/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableBuilder.java index 98b7dad..2a58f93 100644 --- a/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableBuilder.java +++ b/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableBuilder.java @@ -34,6 +34,7 @@ import com.amazon.carbonado.AlternateKeys; import com.amazon.carbonado.Index; import com.amazon.carbonado.Indexes; import com.amazon.carbonado.Key; +import com.amazon.carbonado.Name; import com.amazon.carbonado.Nullable; import com.amazon.carbonado.PrimaryKey; import com.amazon.carbonado.Storable; @@ -455,6 +456,13 @@ public class SyntheticStorableBuilder property.getReadMethodName(), propertyType, null); + + if (property.getName() != null) { + // Define @Name + Annotation ann = mi.addRuntimeVisibleAnnotation(TypeDesc.forClass(Name.class)); + ann.putMemberValue("value", property.getName()); + } + if (property.isNullable()) { mi.addRuntimeVisibleAnnotation(TypeDesc.forClass(Nullable.class)); } -- cgit v1.2.3