From 30cc7f1c3943be87573849864f1f0637fd5cc3c6 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Tue, 17 Oct 2006 23:32:59 +0000 Subject: Prevent accidental replication of internal storables. --- src/main/java/com/amazon/carbonado/layout/Layout.java | 4 +++- src/main/java/com/amazon/carbonado/layout/StoredLayout.java | 9 ++++----- .../java/com/amazon/carbonado/layout/StoredLayoutProperty.java | 8 ++++---- 3 files changed, 11 insertions(+), 10 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/layout') diff --git a/src/main/java/com/amazon/carbonado/layout/Layout.java b/src/main/java/com/amazon/carbonado/layout/Layout.java index b751fb1..8b8fc0b 100644 --- a/src/main/java/com/amazon/carbonado/layout/Layout.java +++ b/src/main/java/com/amazon/carbonado/layout/Layout.java @@ -220,7 +220,9 @@ public class Layout { */ public List getAllProperties() throws FetchException { if (mAllProperties == null) { - Cursor cursor = mStoredLayout.getProperties() + Cursor cursor = mLayoutFactory.mPropertyStorage + .query("layoutID = ?") + .with(mStoredLayout.getLayoutID()) .orderBy("ordinal") .fetch(); diff --git a/src/main/java/com/amazon/carbonado/layout/StoredLayout.java b/src/main/java/com/amazon/carbonado/layout/StoredLayout.java index b7065d9..f7e250a 100644 --- a/src/main/java/com/amazon/carbonado/layout/StoredLayout.java +++ b/src/main/java/com/amazon/carbonado/layout/StoredLayout.java @@ -18,13 +18,13 @@ package com.amazon.carbonado.layout; +import com.amazon.carbonado.Alias; import com.amazon.carbonado.AlternateKeys; +import com.amazon.carbonado.Independent; import com.amazon.carbonado.FetchException; -import com.amazon.carbonado.Join; import com.amazon.carbonado.Key; import com.amazon.carbonado.Nullable; import com.amazon.carbonado.PrimaryKey; -import com.amazon.carbonado.Query; import com.amazon.carbonado.Storable; import com.amazon.carbonado.Version; @@ -39,6 +39,8 @@ import com.amazon.carbonado.Version; @Key({"storableTypeName", "generation"}) }) @PrimaryKey("layoutID") +@Independent +@Alias("CARBONADO_LAYOUT") public interface StoredLayout extends Storable, Unevolvable { long getLayoutID(); @@ -82,9 +84,6 @@ public interface StoredLayout extends Storable, Unevolvable { void setCreationHost(String host); - @Join - Query getProperties() throws FetchException; - /** * Record version number for this StoredTypeLayout instance. Some encoding * strategies require a version number. diff --git a/src/main/java/com/amazon/carbonado/layout/StoredLayoutProperty.java b/src/main/java/com/amazon/carbonado/layout/StoredLayoutProperty.java index 96a990a..a6d25db 100644 --- a/src/main/java/com/amazon/carbonado/layout/StoredLayoutProperty.java +++ b/src/main/java/com/amazon/carbonado/layout/StoredLayoutProperty.java @@ -18,9 +18,10 @@ package com.amazon.carbonado.layout; +import com.amazon.carbonado.Alias; import com.amazon.carbonado.AlternateKeys; import com.amazon.carbonado.FetchException; -import com.amazon.carbonado.Join; +import com.amazon.carbonado.Independent; import com.amazon.carbonado.Key; import com.amazon.carbonado.Nullable; import com.amazon.carbonado.PrimaryKey; @@ -38,6 +39,8 @@ import com.amazon.carbonado.Version; @Key({"layoutID", "propertyName"}) }) @PrimaryKey({"layoutID", "ordinal"}) +@Independent +@Alias("CARBONADO_LAYOUT_PROPERTY") public interface StoredLayoutProperty extends Storable, Unevolvable { long getLayoutID(); @@ -101,9 +104,6 @@ public interface StoredLayoutProperty extends Storable, Un void setAdapterParams(String params); - @Join - StoredLayout getEnclosingLayout() throws FetchException; - /** * Record version number for this StoredPropertyLayout instance. Some * encoding strategies require a version number. -- cgit v1.2.3