svnno****@sourc*****
svnno****@sourc*****
2009年 4月 14日 (火) 20:36:20 JST
Revision: 3273 http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=3273 Author: daisuke_m Date: 2009-04-14 20:36:20 +0900 (Tue, 14 Apr 2009) Log Message: ----------- refactor Modified Paths: -------------- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/AssociationType.java leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/EntitySetDescFactoryImpl.java leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/IdentityNotSupportedException.java leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/dialect/UnsupportedSqlTypeException.java -------------- next part -------------- Modified: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/AssociationType.java =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/AssociationType.java 2009-04-14 11:27:05 UTC (rev 3272) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/AssociationType.java 2009-04-14 11:36:20 UTC (rev 3273) @@ -34,38 +34,31 @@ /** * 多対一です。 */ - MANY_TO_ONE { - - @Override - public Class<? extends Annotation> getAnnotation() { - return ManyToOne.class; - } - }, + MANY_TO_ONE(ManyToOne.class), + /** * 一対多です。 */ - ONE_TO_MANY { - - @Override - public Class<? extends Annotation> getAnnotation() { - return OneToMany.class; - } - }, + ONE_TO_MANY(OneToMany.class), + /** * 一対一です。 */ - ONE_TO_ONE { - - @Override - public Class<? extends Annotation> getAnnotation() { - return OneToOne.class; - } - }; + ONE_TO_ONE(OneToOne.class); + private final Class<? extends Annotation> annotation; + + + AssociationType(Class<? extends Annotation> annotation) { + this.annotation = annotation; + } + /** * アノテーションを取得する。 * * @return アノテーション */ - public abstract Class<? extends Annotation> getAnnotation(); + public Class<? extends Annotation> getAnnotation() { + return annotation; + } } Modified: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/EntitySetDescFactoryImpl.java =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/EntitySetDescFactoryImpl.java 2009-04-14 11:27:05 UTC (rev 3272) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/EntitySetDescFactoryImpl.java 2009-04-14 11:36:20 UTC (rev 3273) @@ -78,6 +78,7 @@ * インスタンスを構築する。 * * @param dbTableMetaReader テーブルメタデータのリーダ + * @param dialect * @param versionColumnNamePattern バージョンカラム名のパターン * @param pluralFormFile 単語を複数系に変換するための辞書ファイル、使用しない場合は{@code null} * @param generationType エンティティの識別子の生成方法を示す列挙型 、生成しない場合は{@code null} @@ -101,47 +102,6 @@ entityDescFactory = createEntityDescFactory(); } - /** - * 関連のリゾルバを作成する。 - * - * @param entitySetDesc エンティティ集合記述 - * @param pluralFormDictinary 単語を複数形に変換するための辞書 - * @return 関連のリゾルバ - */ - protected AssociationResolver createAssociationResolver(EntitySetDesc entitySetDesc, - PluralFormDictinary pluralFormDictinary) { - return new AssociationResolver(entitySetDesc, pluralFormDictinary); - } - - /** - * {@link EntityDescFactory}の実装を作成する。 - * - * @return {@link EntityDescFactory}の実装 - * @throws IdentityNotSupportedException - */ - protected EntityDescFactory createEntityDescFactory() throws IdentityNotSupportedException { - AttributeDescFactory attributeDescFactory = - new AttributeDescFactoryImpl(dialect, versionColumnNamePattern, generationType, initialValue, - allocationSize); - CompositeUniqueConstraintDescFactory compositeUniqueConstraintDescFactory = - new CompositeUniqueConstraintDescFactoryImpl(); - return new EntityDescFactoryImpl(attributeDescFactory, compositeUniqueConstraintDescFactory); - } - - /** - * 単語を複数形に変換するための辞書を作成する。 - * - * @return 単語を複数形に変換するための辞書 - * @throws IOException 入出力が失敗した場合 - */ - protected PluralFormDictinary createPluralFormDictinary() throws IOException { - if (pluralFormFile != null) { - LinkedHashMap<String, String> map = loadPluralFormFile(); - return new PluralFormDictinary(map); - } - return new PluralFormDictinary(); - } - public EntitySetDesc getEntitySetDesc() throws IOException { EntitySetDesc entitySetDesc = new EntitySetDesc(); List<DbTableMeta> dbTableMetaList = dbTableMetaReader.read(); @@ -196,4 +156,45 @@ return map; } + /** + * 関連のリゾルバを作成する。 + * + * @param entitySetDesc エンティティ集合記述 + * @param pluralFormDictinary 単語を複数形に変換するための辞書 + * @return 関連のリゾルバ + */ + protected AssociationResolver createAssociationResolver(EntitySetDesc entitySetDesc, + PluralFormDictinary pluralFormDictinary) { + return new AssociationResolver(entitySetDesc, pluralFormDictinary); + } + + /** + * {@link EntityDescFactory}の実装を作成する。 + * + * @return {@link EntityDescFactory}の実装 + * @throws IdentityNotSupportedException + */ + protected EntityDescFactory createEntityDescFactory() throws IdentityNotSupportedException { + AttributeDescFactory attributeDescFactory = + new AttributeDescFactoryImpl(dialect, versionColumnNamePattern, generationType, initialValue, + allocationSize); + CompositeUniqueConstraintDescFactory compositeUniqueConstraintDescFactory = + new CompositeUniqueConstraintDescFactoryImpl(); + return new EntityDescFactoryImpl(attributeDescFactory, compositeUniqueConstraintDescFactory); + } + + /** + * 単語を複数形に変換するための辞書を作成する。 + * + * @return 単語を複数形に変換するための辞書 + * @throws IOException 入出力が失敗した場合 + */ + protected PluralFormDictinary createPluralFormDictinary() throws IOException { + if (pluralFormFile != null) { + LinkedHashMap<String, String> map = loadPluralFormFile(); + return new PluralFormDictinary(map); + } + return new PluralFormDictinary(); + } + } Modified: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/IdentityNotSupportedException.java =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/IdentityNotSupportedException.java 2009-04-14 11:27:05 UTC (rev 3272) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/IdentityNotSupportedException.java 2009-04-14 11:36:20 UTC (rev 3273) @@ -18,12 +18,12 @@ */ package org.jiemamy.entity.io.gen.desc.impl; - /** * TODO for kato * * @author kato */ + @ SuppressWarnings("serial") public class IdentityNotSupportedException extends Exception { /** @@ -47,21 +47,21 @@ /** * インスタンスを生成する。 * + * @param message * @param cause */ - public IdentityNotSupportedException(Throwable cause) { - super(cause); + public IdentityNotSupportedException(String message, Throwable cause) { + super(message, cause); // TODO Auto-generated constructor stub } /** * インスタンスを生成する。 * - * @param message * @param cause */ - public IdentityNotSupportedException(String message, Throwable cause) { - super(message, cause); + public IdentityNotSupportedException(Throwable cause) { + super(cause); // TODO Auto-generated constructor stub } Modified: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/dialect/UnsupportedSqlTypeException.java =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/dialect/UnsupportedSqlTypeException.java 2009-04-14 11:27:05 UTC (rev 3272) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/dialect/UnsupportedSqlTypeException.java 2009-04-14 11:36:20 UTC (rev 3273) @@ -23,6 +23,7 @@ * * @author kato */ + @ SuppressWarnings("serial") public class UnsupportedSqlTypeException extends Exception { /**