From 0baa46d5ee4f62adb58f436af4978d9468454870 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Fri, 22 Jun 2012 10:11:17 +0200 Subject: Modules and entitycreation support Aggregations, collection properties and class identifiers --- src/main/java/com/c2kernel/collection/Aggregation.java | 8 +++++--- src/main/java/com/c2kernel/collection/AggregationDescription.java | 3 ++- src/main/java/com/c2kernel/collection/CollectionDescription.java | 4 +++- src/main/java/com/c2kernel/collection/DependencyDescription.java | 3 ++- src/main/java/com/c2kernel/collection/RelationshipUtils.java | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) (limited to 'src/main/java/com/c2kernel/collection') diff --git a/src/main/java/com/c2kernel/collection/Aggregation.java b/src/main/java/com/c2kernel/collection/Aggregation.java index e869621..f840d41 100644 --- a/src/main/java/com/c2kernel/collection/Aggregation.java +++ b/src/main/java/com/c2kernel/collection/Aggregation.java @@ -73,8 +73,10 @@ abstract public class Aggregation extends Parent2ChildCollection -1) { + aggMem.assignEntity(entityKey); + aggMem.setIsComposite( RelationshipUtils.getIsComposite(entityKey) ); + } // create vertex com.c2kernel.graph.model.Vertex vertex = new com.c2kernel.graph.model.Vertex(); vertex.setHeight(h); vertex.setWidth(w); @@ -82,7 +84,7 @@ abstract public class Aggregation extends Parent2ChildCollection extends Collection { - public Collection newInstance(); + public Collection newInstance() throws ObjectNotFoundException; } diff --git a/src/main/java/com/c2kernel/collection/DependencyDescription.java b/src/main/java/com/c2kernel/collection/DependencyDescription.java index 547a286..681e98b 100644 --- a/src/main/java/com/c2kernel/collection/DependencyDescription.java +++ b/src/main/java/com/c2kernel/collection/DependencyDescription.java @@ -1,5 +1,6 @@ package com.c2kernel.collection; +import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.property.PropertyDescriptionList; import com.c2kernel.property.PropertyUtility; import com.c2kernel.utils.CastorHashMap; @@ -17,7 +18,7 @@ public class DependencyDescription extends Dependency implements CollectionDescr } @Override - public Collection newInstance() { + public Collection newInstance() throws ObjectNotFoundException{ String depName = getName().replaceFirst("\'$", ""); // HACK: Knock the special 'prime' off the end for the case of descriptions of descriptions Dependency newDep = new Dependency(depName); if (mMembers.list.size() == 1) { // constrain the members based on the property description diff --git a/src/main/java/com/c2kernel/collection/RelationshipUtils.java b/src/main/java/com/c2kernel/collection/RelationshipUtils.java index 6e35ac8..0151b7e 100644 --- a/src/main/java/com/c2kernel/collection/RelationshipUtils.java +++ b/src/main/java/com/c2kernel/collection/RelationshipUtils.java @@ -19,7 +19,7 @@ public class RelationshipUtils if (entityKey == -1) return false; try { - if ( ((Aggregation) Gateway.getProxyManager().getProxy(new EntityPath(entityKey)).getObject(ClusterStorage.COLLECTION+"/Composition" )).size() > 0 ) + if ( Gateway.getProxyManager().getProxy(new EntityPath(entityKey)).getContents(ClusterStorage.COLLECTION).length > 0 ) return true; } catch (Exception ex) -- cgit v1.2.3