From 7977fcd381e17c4e3bdfebfbf7ca4c0d90cdba1f Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Sun, 10 Jun 2007 04:22:34 +0000 Subject: Added methods to access Storable properties by name. --- .../com/amazon/carbonado/repo/indexed/DependentStorableFetcher.java | 6 +----- .../java/com/amazon/carbonado/repo/indexed/IndexEntryAccessor.java | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/repo') diff --git a/src/main/java/com/amazon/carbonado/repo/indexed/DependentStorableFetcher.java b/src/main/java/com/amazon/carbonado/repo/indexed/DependentStorableFetcher.java index ce37f5f..98454f1 100644 --- a/src/main/java/com/amazon/carbonado/repo/indexed/DependentStorableFetcher.java +++ b/src/main/java/com/amazon/carbonado/repo/indexed/DependentStorableFetcher.java @@ -22,8 +22,6 @@ import java.util.Arrays; import java.util.ArrayList; import java.util.List; -import org.cojen.util.BeanPropertyAccessor; - import com.amazon.carbonado.Cursor; import com.amazon.carbonado.FetchException; import com.amazon.carbonado.Query; @@ -49,7 +47,6 @@ class DependentStorableFetcher { private final IndexEntryAccessor[] mIndexEntryAccessors; private final Query mQuery; private final String[] mJoinProperties; - private final BeanPropertyAccessor mPropertyAccessor; /** * @param derivedTo special chained property from StorableProperty.getDerivedToProperties @@ -116,7 +113,6 @@ class DependentStorableFetcher { mIndexEntryAccessors = accessorList.toArray(new IndexEntryAccessor[accessorList.size()]); mQuery = repository.storageFor(dType).query(dFilter); mJoinProperties = joinProperties; - mPropertyAccessor = BeanPropertyAccessor.forClass(sType); } public Transaction enterTransaction() { @@ -126,7 +122,7 @@ class DependentStorableFetcher { public Cursor fetchDependenentStorables(S storable) throws FetchException { Query query = mQuery; for (String property : mJoinProperties) { - query = query.with(mPropertyAccessor.getPropertyValue(storable, property)); + query = query.with(storable.getPropertyValue(property)); } return query.fetch(); } diff --git a/src/main/java/com/amazon/carbonado/repo/indexed/IndexEntryAccessor.java b/src/main/java/com/amazon/carbonado/repo/indexed/IndexEntryAccessor.java index 5f27aa8..42ce214 100644 --- a/src/main/java/com/amazon/carbonado/repo/indexed/IndexEntryAccessor.java +++ b/src/main/java/com/amazon/carbonado/repo/indexed/IndexEntryAccessor.java @@ -33,8 +33,7 @@ import com.amazon.carbonado.capability.IndexInfo; */ public interface IndexEntryAccessor extends IndexInfo { /** - * Returns the index entry storage. Index entry properties can only be - * accessed via reflection. + * Returns the index entry storage. */ Storage getIndexEntryStorage(); -- cgit v1.2.3