diff options
Diffstat (limited to 'src/main/java/com/amazon/carbonado/info')
3 files changed, 20 insertions, 8 deletions
diff --git a/src/main/java/com/amazon/carbonado/info/ChainedProperty.java b/src/main/java/com/amazon/carbonado/info/ChainedProperty.java index 65151e8..24a30cf 100644 --- a/src/main/java/com/amazon/carbonado/info/ChainedProperty.java +++ b/src/main/java/com/amazon/carbonado/info/ChainedProperty.java @@ -562,11 +562,8 @@ public class ChainedProperty<S extends Storable> implements Serializable, Append appendPropTo(app, mPrime.getName(), isOuterJoin(0));
StorableProperty<?>[] chain = mChain;
if (chain != null) {
- app.append('.');
for (int i=0; i<chain.length; i++) {
- if (i > 0) {
- app.append('.');
- }
+ app.append('.');
appendPropTo(app, chain[i].getName(), isOuterJoin(i + 1));
}
}
diff --git a/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java b/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java index fdfb51f..94b391e 100644 --- a/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java +++ b/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java @@ -624,7 +624,7 @@ public class StorableIntrospector { String sig = createSig(readMethod);
if (storableProp.isDerived() || methods.containsKey(sig)) {
methods.remove(sig);
- properties.put(property.getName(), storableProp);
+ properties.put(storableProp.getName(), storableProp);
} else {
continue;
}
@@ -634,7 +634,7 @@ public class StorableIntrospector { String sig = createSig(writeMethod);
if (storableProp.isDerived() || methods.containsKey(sig)) {
methods.remove(sig);
- properties.put(property.getName(), storableProp);
+ properties.put(storableProp.getName(), storableProp);
} else {
continue;
}
@@ -1594,6 +1594,7 @@ public class StorableIntrospector { private final boolean mAutomatic;
private final boolean mIsDerived;
private final String mName;
+ private final String mBeanName;
// Temporary reference until derived from is resolved.
private Derived mDerived;
@@ -1635,13 +1636,18 @@ public class StorableIntrospector { mAutomatic = automatic;
mIsDerived = derived != null;
mDerived = derived;
- mName = name == null ? mBeanProperty.getName() : name;
+ mBeanName = mBeanProperty.getName();
+ mName = name == null ? mBeanName : name;
}
public final String getName() {
return mName;
}
+ public final String getBeanName() {
+ return mBeanName;
+ }
+
public final Class<?> getType() {
return mBeanProperty.getType();
}
diff --git a/src/main/java/com/amazon/carbonado/info/StorableProperty.java b/src/main/java/com/amazon/carbonado/info/StorableProperty.java index 0d77481..38418ec 100644 --- a/src/main/java/com/amazon/carbonado/info/StorableProperty.java +++ b/src/main/java/com/amazon/carbonado/info/StorableProperty.java @@ -31,11 +31,20 @@ import com.amazon.carbonado.util.Appender; */
public interface StorableProperty<S extends Storable> extends Serializable, Appender {
/**
- * Returns the name of this property.
+ * Returns the name of this property, which is the same as the bean name
+ * unless it has been {@link com.amazon.carbonado.Name renamed}.
*/
String getName();
/**
+ * Returns the bean name of this property, which is derived from the read
+ * and write method names.
+ *
+ * @since 1.2
+ */
+ String getBeanName();
+
+ /**
* Returns the type of this property.
*/
Class<?> getType();
|