[Jiemamy-notify:1350] commit [2608] gtreeのロジックアダプタによる循環参照対策。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 2月 3日 (火) 01:33:40 JST


Revision: 2608
          http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=2608
Author:   daisuke_m
Date:     2009-02-03 01:33:40 +0900 (Tue, 03 Feb 2009)

Log Message:
-----------
gtreeのロジックアダプタによる循環参照対策。

Modified Paths:
--------------
    artemis/trunk/jiemamy-artemis-test/src/test/java/org/jiemamy/serializer/SerializationTest.java
    artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/model/EqualsUtil.java
    artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/ViewFactoryExtensionEnhancer.java
    artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/model/connection/ConnectionAdapterImpl.java
    artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/model/node/NodeModelImplTest.java

Added Paths:
-----------
    artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/model/node/NodeAdapterImpl.java
    zeus/trunk/jiemamy-spec-core/src/main/java/org/jiemamy/model/LogicAdapter.java

Removed Paths:
-------------
    artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/model/node/NodeModelImpl.java


-------------- next part --------------
Modified: artemis/trunk/jiemamy-artemis-test/src/test/java/org/jiemamy/serializer/SerializationTest.java
===================================================================
--- artemis/trunk/jiemamy-artemis-test/src/test/java/org/jiemamy/serializer/SerializationTest.java	2009-02-02 16:09:49 UTC (rev 2607)
+++ artemis/trunk/jiemamy-artemis-test/src/test/java/org/jiemamy/serializer/SerializationTest.java	2009-02-02 16:33:40 UTC (rev 2608)
@@ -51,6 +51,7 @@
 import org.jiemamy.model.entity.TableModel;
 import org.jiemamy.model.entity.ViewModel;
 import org.jiemamy.test.AllValidator;
+import org.jiemamy.test.TestModelBuilder;
 import org.jiemamy.test.ViewTestModelBuilder;
 import org.jiemamy.utils.model.EqualsUtil;
 import org.jiemamy.utils.model.RootModelUtil;
@@ -66,14 +67,6 @@
 	
 	private static Logger logger = LoggerFactory.getLogger(SerializationTest.class);
 	
-	/** {@link JiemamySerializer} */
-	private JiemamySerializer serializer;
-	
-	/** {@link JiemamyFactory} */
-	private JiemamyFactory factory;
-	
-	private ViewTestModelBuilder mb;
-	
 
 	/**
 	 * setup
@@ -81,11 +74,6 @@
 	 */
 	@Before
 	public void setUp() throws Exception {
-		Jiemamy jiemamy = Jiemamy.newInstance(new Artemis(new ArtemisView()));
-		mb = new ViewTestModelBuilder(jiemamy);
-		mb.build();
-		factory = jiemamy.getFactory();
-		serializer = jiemamy.getSerializer();
 	}
 	
 	/**
@@ -94,8 +82,6 @@
 	 */
 	@After
 	public void tearDown() throws Exception {
-		serializer = null;
-		factory = null;
 	}
 	
 	/**
@@ -104,6 +90,12 @@
 	 */
 	@Test
 	public void test01_とりあえずXMLに書き込んでみる() throws Exception {
+		Jiemamy jiemamy = Jiemamy.newInstance(new Artemis(new ArtemisView()));
+		TestModelBuilder mb = new ViewTestModelBuilder(jiemamy);
+		mb.build();
+		JiemamyFactory factory = jiemamy.getFactory();
+		JiemamySerializer serializer = jiemamy.getSerializer();
+		
 		ByteArrayOutputStream out = null;
 		RootModel rootModel = factory.getRootModel();
 		
@@ -121,6 +113,11 @@
 	 */
 	@Test
 	public void test02_とりあえずXMLから読み込んでみる() throws Exception {
+		Jiemamy jiemamy = Jiemamy.newInstance(new Artemis(new ArtemisView()));
+		TestModelBuilder mb = new ViewTestModelBuilder(jiemamy);
+		mb.build();
+		JiemamySerializer serializer = jiemamy.getSerializer();
+		
 		InputStream in = null;
 		RootModel rootModel;
 		try {
@@ -192,13 +189,21 @@
 		String xml2 = convertRootModelToXml(serializer2, rootModel2);
 		
 		// 参考のため、targetディレクトリに出力XMLを記録
-		FileUtils.writeStringToFile(new File("./target/" + ClassUtils.getShortClassName(this, "null") + "_1_xml1.xml"),
-				xml1, CharEncoding.UTF_8);
+		FileUtils.writeStringToFile(new File("./target/" + ClassUtils.getShortClassName(this, "null")
+				+ "_test1_xml1.xml"), xml1, CharEncoding.UTF_8);
 		
-		FileUtils.writeStringToFile(new File("./target/" + ClassUtils.getShortClassName(this, "null") + "_1_xml2.xml"),
-				xml2, CharEncoding.UTF_8);
+		FileUtils.writeStringToFile(new File("./target/" + ClassUtils.getShortClassName(this, "null")
+				+ "_test1_xml2.xml"), xml2, CharEncoding.UTF_8);
 		
-		assertThat(EqualsUtil.equals(rootModel2, rootModel1), is(true));
+		boolean equals = EqualsUtil.equals(rootModel2, rootModel1);
+		
+		FileUtils.writeStringToFile(new File("./target/" + ClassUtils.getShortClassName(this, "null")
+				+ "_test1_gtree1.xml"), EqualsUtil.rightGTree, CharEncoding.UTF_8);
+		
+		FileUtils.writeStringToFile(new File("./target/" + ClassUtils.getShortClassName(this, "null")
+				+ "_test1_gtree2.xml"), EqualsUtil.leftGTree, CharEncoding.UTF_8);
+		
+		assertThat(equals, is(true));
 		assertThat(xml2, is(xml1));
 	}
 	
@@ -226,13 +231,21 @@
 		assertThat(problems2.size(), is(0)); // 一応バリデーションを行っておく
 		
 		// 参考のため、targetディレクトリに出力XMLを記録
-		FileUtils.writeStringToFile(new File("./target/" + ClassUtils.getShortClassName(this, "null") + "_2_xml1.xml"),
-				xml1, CharEncoding.UTF_8);
+		FileUtils.writeStringToFile(new File("./target/" + ClassUtils.getShortClassName(this, "null")
+				+ "_test2_xml1.xml"), xml1, CharEncoding.UTF_8);
 		
-		FileUtils.writeStringToFile(new File("./target/" + ClassUtils.getShortClassName(this, "null") + "_2_xml2.xml"),
-				xml2, CharEncoding.UTF_8);
+		FileUtils.writeStringToFile(new File("./target/" + ClassUtils.getShortClassName(this, "null")
+				+ "_test2_xml2.xml"), xml2, CharEncoding.UTF_8);
 		
-		assertThat(EqualsUtil.equals(rootModel2, rootModel1), is(true));
+		boolean equals = EqualsUtil.equals(rootModel2, rootModel1);
+		
+		FileUtils.writeStringToFile(new File("./target/" + ClassUtils.getShortClassName(this, "null")
+				+ "_test2_gtree1.xml"), EqualsUtil.rightGTree, CharEncoding.UTF_8);
+		
+		FileUtils.writeStringToFile(new File("./target/" + ClassUtils.getShortClassName(this, "null")
+				+ "_test2_gtree2.xml"), EqualsUtil.leftGTree, CharEncoding.UTF_8);
+		
+		assertThat(equals, is(true));
 		assertThat(xml2, is(xml1));
 	}
 	

Modified: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/model/EqualsUtil.java
===================================================================
--- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/model/EqualsUtil.java	2009-02-02 16:09:49 UTC (rev 2607)
+++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/model/EqualsUtil.java	2009-02-02 16:33:40 UTC (rev 2608)
@@ -28,8 +28,12 @@
 
 import org.jiemamy.Jiemamy;
 import org.jiemamy.model.ElementReference;
+import org.jiemamy.model.LogicAdapter;
+import org.jiemamy.model.attribute.ColumnRef;
+import org.jiemamy.model.datatype.DomainRef;
+import org.jiemamy.model.entity.TableRef;
+import org.jiemamy.utils.gtree.converter.CachedObjectConverter;
 import org.jiemamy.utils.gtree.converter.ConverterDriver;
-import org.jiemamy.utils.gtree.converter.DefaultObjectConverter;
 import org.jiemamy.utils.gtree.converter.InterfaceBeanConverter;
 import org.jiemamy.utils.gtree.converter.ObjectConverter;
 import org.jiemamy.utils.gtree.model.Terminal;
@@ -43,6 +47,12 @@
  */
 public final class EqualsUtil {
 	
+	/** for debug */
+	public static String leftGTree;
+	
+	/** for debug */
+	public static String rightGTree;
+	
 	private static Logger logger = LoggerFactory.getLogger(EqualsUtil.class);
 	
 
@@ -59,8 +69,8 @@
 		
 		// コンバータを作る
 		ObjectConverter converter =
-				DefaultObjectConverter.newInstance(Arrays.asList(new JiemamyPropertyConverter(),
-						new ReferenceConverter(), new InterfaceBeanConverter()));
+				CachedObjectConverter.newInstance(Arrays.asList(new JiemamyPropertyConverter(),
+						new LogicAdapterConverter(), new ReferenceConverter(), new InterfaceBeanConverter()));
 		
 		// コンバータでモデルをGeneric Treeに変換
 		Value leftGenericTree = converter.convert(left);
@@ -75,13 +85,12 @@
 		Emitter.emit(rightGenericTree, rightWriter);
 		leftWriter.close();
 		rightWriter.close();
-		String leftStringValue = leftOut.toString();
-		String rightStringValue = rightOut.toString();
+		leftGTree = leftOut.toString();
+		rightGTree = rightOut.toString();
+		logger.info("L = " + leftGTree.replaceAll("[\r\n]", ""));
+		logger.info("R = " + rightGTree.replaceAll("[\r\n]", ""));
 		
-		logger.info("L = " + leftStringValue.replaceAll("[\r\n]", ""));
-		logger.info("R = " + rightStringValue.replaceAll("[\r\n]", ""));
-		
-		return leftStringValue.equals(rightStringValue);
+		return leftGTree.equals(rightGTree);
 	}
 	
 	private EqualsUtil() {
@@ -102,6 +111,20 @@
 		
 	}
 	
+	private static class LogicAdapterConverter implements ConverterDriver {
+		
+		/**
+		 * {@inheritDoc}
+		 */
+		public Value convert(Object object, ObjectConverter converter) {
+			if (object.getClass().getAnnotation(LogicAdapter.class) != null) {
+				return Terminal.of("<LogicAdapter>");
+			}
+			return null;
+		}
+		
+	}
+	
 	private static class ReferenceConverter implements ConverterDriver {
 		
 		/**
@@ -110,7 +133,17 @@
 		public Value convert(Object object, ObjectConverter converter) {
 			if (object instanceof ElementReference) {
 				ElementReference<?> ref = (ElementReference<?>) object;
-				return Terminal.of("Ref(" + ref.getReferenceId().toString() + ")");
+				
+				String key = "Ref";
+				if (ref instanceof TableRef) {
+					key = "TableRef";
+				} else if (ref instanceof ColumnRef) {
+					key = "ColumnRef";
+				} else if (ref instanceof DomainRef) {
+					key = "DomainRef";
+				}
+				
+				return Terminal.of(key + "(" + ref.getReferenceId().toString() + ")");
 			}
 			return null;
 		}

Modified: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/ViewFactoryExtensionEnhancer.java
===================================================================
--- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/ViewFactoryExtensionEnhancer.java	2009-02-02 16:09:49 UTC (rev 2607)
+++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/ViewFactoryExtensionEnhancer.java	2009-02-02 16:33:40 UTC (rev 2608)
@@ -34,7 +34,7 @@
 import org.jiemamy.model.geometory.JmPoint;
 import org.jiemamy.model.geometory.JmRectangle;
 import org.jiemamy.model.node.NodeAdapter;
-import org.jiemamy.model.node.NodeModelImpl;
+import org.jiemamy.model.node.NodeAdapterImpl;
 import org.jiemamy.model.node.StickyModel;
 import org.jiemamy.model.node.StickyModelImpl;
 import org.jiemamy.utils.enhancer.Invocation;
@@ -69,7 +69,7 @@
 				((RootModel) product).registerAdapter(diagramPresentations);
 			} else if (EntityModel.class.isAssignableFrom(clazz)) {
 				assert product != null;
-				NodeModelImpl node = new NodeModelImpl((EntityModel) product);
+				NodeAdapterImpl node = new NodeAdapterImpl((EntityModel) product);
 				((EntityModel) product).registerAdapter(node);
 			} else if (ForeignKeyModel.class.isAssignableFrom(clazz)) {
 				assert product != null;

Modified: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/model/connection/ConnectionAdapterImpl.java
===================================================================
--- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/model/connection/ConnectionAdapterImpl.java	2009-02-02 16:09:49 UTC (rev 2607)
+++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/model/connection/ConnectionAdapterImpl.java	2009-02-02 16:33:40 UTC (rev 2608)
@@ -24,6 +24,7 @@
 import org.apache.commons.lang.builder.ToStringStyle;
 
 import org.jiemamy.internal.processor.IsCyclicProcessor;
+import org.jiemamy.model.LogicAdapter;
 import org.jiemamy.model.attribute.ColumnModel;
 import org.jiemamy.model.attribute.ColumnRef;
 import org.jiemamy.model.attribute.constraint.ForeignKeyModel;
@@ -36,6 +37,7 @@
  * 
  * @author daisuke
  */
+ @ LogicAdapter
 public class ConnectionAdapterImpl implements ConnectionAdapter {
 	
 	private final ForeignKeyModel wrapped;

Copied: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/model/node/NodeAdapterImpl.java (from rev 2605, artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/model/node/NodeModelImpl.java)
===================================================================
--- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/model/node/NodeAdapterImpl.java	                        (rev 0)
+++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/model/node/NodeAdapterImpl.java	2009-02-02 16:33:40 UTC (rev 2608)
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2007-2009 Jiemamy Project and the Others.
+ * Created on 2008/06/09
+ *
+ * This file is part of Jiemamy-core.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.jiemamy.model.node;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.commons.lang.NotImplementedException;
+import org.apache.commons.lang.Validate;
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
+
+import org.jiemamy.exception.IllegalImplementationException;
+import org.jiemamy.model.LogicAdapter;
+import org.jiemamy.model.attribute.constraint.ForeignKeyModel;
+import org.jiemamy.model.connection.ConnectionAdapter;
+import org.jiemamy.model.entity.EntityModel;
+import org.jiemamy.model.entity.TableModel;
+import org.jiemamy.model.entity.ViewModel;
+import org.jiemamy.utils.CollectionsUtil;
+import org.jiemamy.utils.model.EntityUtil;
+import org.jiemamy.utils.model.ForeignKeyUtil;
+import org.jiemamy.utils.model.TableUtil;
+
+/**
+ * ノード(Table, View等)のAbstractモデル。
+ * 
+ * @author daisuke
+ */
+ @ SuppressWarnings("serial")
+ @ LogicAdapter
+public class NodeAdapterImpl implements NodeAdapter {
+	
+	private final EntityModel wrapped;
+	
+
+	/**
+	 * インスタンスを生成する。
+	 * 
+	 * @param wrapped
+	 * @throws IllegalArgumentException 引数に{@code null}を与えた場合
+	 */
+	public NodeAdapterImpl(EntityModel wrapped) {
+		Validate.notNull(wrapped);
+		this.wrapped = wrapped;
+	}
+	
+	/**
+	 * {@inheritDoc}
+	 */
+	public int compareTo(NodeAdapter o) {
+		if (o == null) {
+			return -1;
+		}
+		if (getClass() != o.getClass()) {
+			return this.getClass().getName().compareTo(o.getClass().getName());
+		}
+		return wrapped.getId().compareTo(((NodeAdapterImpl) o).wrapped.getId());
+	}
+	
+	/**
+	 * {@inheritDoc}
+	 */
+	public List<ConnectionAdapter> getSourceConnections() {
+		if (wrapped == null) {
+			throw new IllegalImplementationException("Custom node must be overriden getSourceConnections method");
+		}
+		List<ConnectionAdapter> result = CollectionsUtil.newArrayList();
+		if (wrapped instanceof TableModel) {
+			TableModel tableModel = (TableModel) wrapped;
+			List<ForeignKeyModel> foreignKeys = TableUtil.getForeignKeys(tableModel);
+			for (ForeignKeyModel foreignKeyModel : foreignKeys) {
+				result.add(foreignKeyModel.getAdapter(ConnectionAdapter.class));
+			}
+		} else if (wrapped instanceof ViewModel) {
+			// TODO ビューが依存するエンティティ
+		}
+		return result;
+	}
+	
+	/**
+	 * {@inheritDoc}
+	 */
+	public List<ConnectionAdapter> getTargetConnections() {
+		if (wrapped == null) {
+			throw new IllegalImplementationException("Custom node must be overriden getSourceConnections method");
+		}
+		List<ConnectionAdapter> result = CollectionsUtil.newArrayList();
+		if (wrapped instanceof TableModel) {
+			TableModel targetTable = (TableModel) wrapped;
+			Collection<EntityModel> sourceEntities = EntityUtil.getDependentEntities(targetTable, false);
+			for (EntityModel sourceEntity : sourceEntities) {
+				if (sourceEntity instanceof TableModel) {
+					TableModel sourceTable = (TableModel) sourceEntity;
+					List<ForeignKeyModel> foreignKeys = TableUtil.getForeignKeys(sourceTable);
+					for (ForeignKeyModel foreignKeyModel : foreignKeys) {
+						if (ForeignKeyUtil.getReferenceEntity(foreignKeyModel) == targetTable) {
+							result.add(foreignKeyModel.getAdapter(ConnectionAdapter.class));
+						}
+					}
+					
+				} else {
+					// TODO
+					throw new NotImplementedException();
+				}
+			}
+		}
+		return result;
+	}
+	
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
+	}
+	
+	/**
+	 * {@inheritDoc}
+	 */
+	public EntityModel unwrap() {
+//		if (wrapped == null) {
+//			throw new UnsupportedOperationException();
+//		}
+		return wrapped;
+	}
+}

Deleted: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/model/node/NodeModelImpl.java
===================================================================
--- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/model/node/NodeModelImpl.java	2009-02-02 16:09:49 UTC (rev 2607)
+++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/model/node/NodeModelImpl.java	2009-02-02 16:33:40 UTC (rev 2608)
@@ -1,142 +0,0 @@
-/*
- * Copyright 2007-2009 Jiemamy Project and the Others.
- * Created on 2008/06/09
- *
- * This file is part of Jiemamy-core.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-package org.jiemamy.model.node;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.commons.lang.NotImplementedException;
-import org.apache.commons.lang.Validate;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
-
-import org.jiemamy.exception.IllegalImplementationException;
-import org.jiemamy.model.attribute.constraint.ForeignKeyModel;
-import org.jiemamy.model.connection.ConnectionAdapter;
-import org.jiemamy.model.entity.EntityModel;
-import org.jiemamy.model.entity.TableModel;
-import org.jiemamy.model.entity.ViewModel;
-import org.jiemamy.utils.CollectionsUtil;
-import org.jiemamy.utils.model.EntityUtil;
-import org.jiemamy.utils.model.ForeignKeyUtil;
-import org.jiemamy.utils.model.TableUtil;
-
-/**
- * ノード(Table, View等)のAbstractモデル。
- * 
- * @author daisuke
- */
- @ SuppressWarnings("serial")
-public class NodeModelImpl implements NodeAdapter {
-	
-	private final EntityModel wrapped;
-	
-
-	/**
-	 * インスタンスを生成する。
-	 * 
-	 * @param wrapped
-	 * @throws IllegalArgumentException 引数に{@code null}を与えた場合
-	 */
-	public NodeModelImpl(EntityModel wrapped) {
-		Validate.notNull(wrapped);
-		this.wrapped = wrapped;
-	}
-	
-	/**
-	 * {@inheritDoc}
-	 */
-	public int compareTo(NodeAdapter o) {
-		if (o == null) {
-			return -1;
-		}
-		if (getClass() != o.getClass()) {
-			return this.getClass().getName().compareTo(o.getClass().getName());
-		}
-		return wrapped.getId().compareTo(((NodeModelImpl) o).wrapped.getId());
-	}
-	
-	/**
-	 * {@inheritDoc}
-	 */
-	public List<ConnectionAdapter> getSourceConnections() {
-		if (wrapped == null) {
-			throw new IllegalImplementationException("Custom node must be overriden getSourceConnections method");
-		}
-		List<ConnectionAdapter> result = CollectionsUtil.newArrayList();
-		if (wrapped instanceof TableModel) {
-			TableModel tableModel = (TableModel) wrapped;
-			List<ForeignKeyModel> foreignKeys = TableUtil.getForeignKeys(tableModel);
-			for (ForeignKeyModel foreignKeyModel : foreignKeys) {
-				result.add(foreignKeyModel.getAdapter(ConnectionAdapter.class));
-			}
-		} else if (wrapped instanceof ViewModel) {
-			// TODO ビューが依存するエンティティ
-		}
-		return result;
-	}
-	
-	/**
-	 * {@inheritDoc}
-	 */
-	public List<ConnectionAdapter> getTargetConnections() {
-		if (wrapped == null) {
-			throw new IllegalImplementationException("Custom node must be overriden getSourceConnections method");
-		}
-		List<ConnectionAdapter> result = CollectionsUtil.newArrayList();
-		if (wrapped instanceof TableModel) {
-			TableModel targetTable = (TableModel) wrapped;
-			Collection<EntityModel> sourceEntities = EntityUtil.getDependentEntities(targetTable, false);
-			for (EntityModel sourceEntity : sourceEntities) {
-				if (sourceEntity instanceof TableModel) {
-					TableModel sourceTable = (TableModel) sourceEntity;
-					List<ForeignKeyModel> foreignKeys = TableUtil.getForeignKeys(sourceTable);
-					for (ForeignKeyModel foreignKeyModel : foreignKeys) {
-						if (ForeignKeyUtil.getReferenceEntity(foreignKeyModel) == targetTable) {
-							result.add(foreignKeyModel.getAdapter(ConnectionAdapter.class));
-						}
-					}
-					
-				} else {
-					// TODO
-					throw new NotImplementedException();
-				}
-			}
-		}
-		return result;
-	}
-	
-	/**
-	 * {@inheritDoc}
-	 */
-	@Override
-	public String toString() {
-		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
-	}
-	
-	/**
-	 * {@inheritDoc}
-	 */
-	public EntityModel unwrap() {
-//		if (wrapped == null) {
-//			throw new UnsupportedOperationException();
-//		}
-		return wrapped;
-	}
-}

Modified: artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/model/node/NodeModelImplTest.java
===================================================================
--- artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/model/node/NodeModelImplTest.java	2009-02-02 16:09:49 UTC (rev 2607)
+++ artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/model/node/NodeModelImplTest.java	2009-02-02 16:33:40 UTC (rev 2608)
@@ -38,7 +38,7 @@
 import org.jiemamy.test.TestModelBuilder2;
 
 /**
- * {@link NodeModelImpl}のテストクラス。
+ * {@link NodeAdapterImpl}のテストクラス。
  * 
  * @author daisuke
  */

Added: zeus/trunk/jiemamy-spec-core/src/main/java/org/jiemamy/model/LogicAdapter.java
===================================================================
--- zeus/trunk/jiemamy-spec-core/src/main/java/org/jiemamy/model/LogicAdapter.java	                        (rev 0)
+++ zeus/trunk/jiemamy-spec-core/src/main/java/org/jiemamy/model/LogicAdapter.java	2009-02-02 16:33:40 UTC (rev 2608)
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2007-2009 Jiemamy Project and the Others.
+ * Created on 2009/01/26
+ *
+ * This file is part of Jiemamy.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.jiemamy.model;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * XMLに出力すべきではないロジック責務を持つアダプタである事を示すアノテーション。
+ * 
+ * <p>シリアライザにおいて、このアノテーションがついているアダプタは、ロジックアダプタとみなされ、シリアライズの対象にならない。</p>
+ * 
+ * @author daisuke
+ */
+ @ Retention(RetentionPolicy.RUNTIME)
+ @ Target(ElementType.TYPE)
+public @interface LogicAdapter {
+	
+}


Property changes on: zeus/trunk/jiemamy-spec-core/src/main/java/org/jiemamy/model/LogicAdapter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain



Jiemamy-notify メーリングリストの案内
Back to archive index