summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/info
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2006-12-07 08:12:31 +0000
committerBrian S. O'Neill <bronee@gmail.com>2006-12-07 08:12:31 +0000
commitcee2677c3d2d2d31a5a921b625050fbb4ea45d59 (patch)
tree3efc7c8929ac96eb0b89ef0a5789455bc9052793 /src/main/java/com/amazon/carbonado/info
parentcdc247a2677611af81567cfc9b570601cdc4c06d (diff)
Added @Authoritative annotation.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/info')
-rw-r--r--src/main/java/com/amazon/carbonado/info/StorableInfo.java5
-rw-r--r--src/main/java/com/amazon/carbonado/info/StorableIntrospector.java13
2 files changed, 16 insertions, 2 deletions
diff --git a/src/main/java/com/amazon/carbonado/info/StorableInfo.java b/src/main/java/com/amazon/carbonado/info/StorableInfo.java
index 1d6ed3e..796efb4 100644
--- a/src/main/java/com/amazon/carbonado/info/StorableInfo.java
+++ b/src/main/java/com/amazon/carbonado/info/StorableInfo.java
@@ -126,4 +126,9 @@ public interface StorableInfo<S extends Storable> {
* @see com.amazon.carbonado.Independent
*/
boolean isIndependent();
+
+ /**
+ * @see com.amazon.carbonado.Authoritative
+ */
+ boolean isAuthoritative();
}
diff --git a/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java b/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java
index 8da9c3e..29158f1 100644
--- a/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java
+++ b/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java
@@ -48,6 +48,7 @@ import org.cojen.util.WeakIdentityMap;
import com.amazon.carbonado.Alias;
import com.amazon.carbonado.AlternateKeys;
+import com.amazon.carbonado.Authoritative;
import com.amazon.carbonado.FetchException;
import com.amazon.carbonado.Index;
import com.amazon.carbonado.Indexes;
@@ -220,7 +221,8 @@ public class StorableIntrospector {
info = new Info<S>(type, aliases, indexes, properties,
primaryKey, alternateKeys,
- type.getAnnotation(Independent.class) != null);
+ type.getAnnotation(Independent.class) != null,
+ type.getAnnotation(Authoritative.class) != null);
cCache.put(type, new SoftReference<StorableInfo<?>>(info));
// Finish resolving join properties, after properties have been
@@ -1121,6 +1123,7 @@ public class StorableIntrospector {
private final StorableKey<S> mPrimaryKey;
private final StorableKey<S>[] mAltKeys;
private final boolean mIndependent;
+ private final boolean mAuthoritative;
private transient String mName;
private transient Map<String, StorableProperty<S>> mPrimaryKeyProperties;
@@ -1131,7 +1134,8 @@ public class StorableIntrospector {
Map<String, StorableProperty<S>> properties,
StorableKey<S> primaryKey,
StorableKey<S>[] altKeys,
- boolean independent)
+ boolean independent,
+ boolean authoritative)
{
mType = type;
mAliases = aliases;
@@ -1140,6 +1144,7 @@ public class StorableIntrospector {
mPrimaryKey = primaryKey;
mAltKeys = altKeys;
mIndependent = independent;
+ mAuthoritative = authoritative;
}
public String getName() {
@@ -1282,6 +1287,10 @@ public class StorableIntrospector {
public final boolean isIndependent() {
return mIndependent;
}
+
+ public final boolean isAuthoritative() {
+ return mAuthoritative;
+ }
}
private static class SKey<S extends Storable> implements StorableKey<S> {