svnno****@sourc*****
svnno****@sourc*****
2009年 4月 7日 (火) 19:01:16 JST
Revision: 3158 http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=3158 Author: j5ik2o Date: 2009-04-07 19:01:16 +0900 (Tue, 07 Apr 2009) Log Message: ----------- リファクタリング Modified Paths: -------------- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/ColumnDuplicatedException.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/PropertyDuplicatedException.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/PropertyMeta.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/BothMappedByAndJoinColumnException.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/FieldDuplicatedException.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/IdGeneratorNotFoundException.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/JoinColumnNameAndReferencedColumnNameMandatoryException.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/LazyFetchSpecifiedException.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/MappedByMandatoryException.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/OneToManyNotGenericsException.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/OneToManyNotListException.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/RelationshipNotEntityException.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/TemporalTypeNotSpecifiedException.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/UnsupportedInheritanceException.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/UnsupportedPropertyTypesException.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/UnsupportedRelationshipException.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/VersionPropertyNotNumberException.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/impl/PropertyMetaFactoryImpl.java Added Paths: ----------- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractIdGeneratorMeta.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractPreAllocateIdGeneratorMeta.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdGeneratorMeta.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdentityIdGeneratorMeta.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/SequenceIdGeneratorMeta.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/TableIdGeneratorMeta.java Removed Paths: ------------- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractIdGenerator.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractPreAllocateIdGenerator.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdGenerator.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdentityIdGenerator.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/SequenceIdGenerator.java charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/TableIdGenerator.java -------------- next part -------------- Modified: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/ColumnDuplicatedException.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/ColumnDuplicatedException.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/ColumnDuplicatedException.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -19,7 +19,7 @@ package org.jiemamy.composer.importer.meta; /** - * カラムがだぶって生成された場合の例外クラス。 + * カラムが重複した場合の例外クラス。 * * @author j5ik2o */ @@ -35,7 +35,9 @@ * @param columnName カラム名 */ public ColumnDuplicatedException(String entityName, String propertyName, String propertyName2, String columnName) { - super(String.format("duplicated column %s %s %s %s", entityName, propertyName, propertyName2, columnName)); + super(String.format("Duplicated column." + + "(entityName = %s, originalPropertyName = %s, targetPropertyName = %s, columnName = %s)", entityName, + propertyName, propertyName2, columnName)); } } Modified: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/PropertyDuplicatedException.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/PropertyDuplicatedException.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/PropertyDuplicatedException.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -29,11 +29,12 @@ /** * インスタンスを生成する。 * - * @param name オリジナルのプロパティ名 - * @param name2 対象のプロパティ名 + * @param propertyName オリジナルのプロパティ名 + * @param targetPropertyName 対象のプロパティ名 */ - public PropertyDuplicatedException(String name, String name2) { - super(String.format("duplicated properties %s : %s", name, name2)); + public PropertyDuplicatedException(String propertyName, String targetPropertyName) { + super(String.format("Duplicated property.(propertyName = %s,targetPropertyName = %s)", propertyName, + targetPropertyName)); } } Modified: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/PropertyMeta.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/PropertyMeta.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/PropertyMeta.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -29,9 +29,9 @@ import org.apache.commons.lang.builder.ToStringBuilder; -import org.jiemamy.composer.importer.meta.generator.IdentityIdGenerator; -import org.jiemamy.composer.importer.meta.generator.SequenceIdGenerator; -import org.jiemamy.composer.importer.meta.generator.TableIdGenerator; +import org.jiemamy.composer.importer.meta.generator.IdentityIdGeneratorMeta; +import org.jiemamy.composer.importer.meta.generator.SequenceIdGeneratorMeta; +import org.jiemamy.composer.importer.meta.generator.TableIdGeneratorMeta; /** * JPA用のプロパティメタデータクラス。 @@ -88,14 +88,14 @@ /** 関連クラス */ private Class<?> relationshipClass; - /** {@link SequenceIdGenerator} */ - private SequenceIdGenerator sequenceIdGenerator; + /** {@link SequenceIdGeneratorMeta} */ + private SequenceIdGeneratorMeta sequenceIdGenerator; - /** {@link IdentityIdGenerator} */ - private IdentityIdGenerator identityIdGenerator; + /** {@link IdentityIdGeneratorMeta} */ + private IdentityIdGeneratorMeta identityIdGenerator; - /** {@link TableIdGenerator} */ - private TableIdGenerator tableIdGenerator; + /** {@link TableIdGeneratorMeta} */ + private TableIdGeneratorMeta tableIdGenerator; /** @@ -153,11 +153,11 @@ } /** - * {@link IdentityIdGenerator}を取得する。 + * {@link IdentityIdGeneratorMeta}を取得する。 * - * @return {@link IdentityIdGenerator} + * @return {@link IdentityIdGeneratorMeta} */ - public IdentityIdGenerator getIdentityIdGenerator() { + public IdentityIdGeneratorMeta getIdentityIdGenerator() { return identityIdGenerator; } @@ -216,20 +216,20 @@ } /** - * {@link SequenceIdGenerator}を取得する。 + * {@link SequenceIdGeneratorMeta}を取得する。 * - * @return {@link SequenceIdGenerator} + * @return {@link SequenceIdGeneratorMeta} */ - public SequenceIdGenerator getSequenceIdGenerator() { + public SequenceIdGeneratorMeta getSequenceIdGenerator() { return sequenceIdGenerator; } /** - * {@link TableIdGenerator}を取得する。 + * {@link TableIdGeneratorMeta}を取得する。 * - * @return {@link TableIdGenerator} + * @return {@link TableIdGeneratorMeta} */ - public TableIdGenerator getTableIdGenerator() { + public TableIdGeneratorMeta getTableIdGenerator() { return tableIdGenerator; } @@ -333,11 +333,11 @@ } /** - * {@link IdentityIdGenerator}を設定する。 + * {@link IdentityIdGeneratorMeta}を設定する。 * - * @param identityIdGenerator {@link IdentityIdGenerator} + * @param identityIdGenerator {@link IdentityIdGeneratorMeta} */ - public void setIdentityIdGenerator(IdentityIdGenerator identityIdGenerator) { + public void setIdentityIdGenerator(IdentityIdGeneratorMeta identityIdGenerator) { this.identityIdGenerator = identityIdGenerator; } @@ -405,20 +405,20 @@ } /** - * {@link SequenceIdGenerator}を設定する。 + * {@link SequenceIdGeneratorMeta}を設定する。 * - * @param sequenceIdGenerator {@link SequenceIdGenerator} + * @param sequenceIdGenerator {@link SequenceIdGeneratorMeta} */ - public void setSequenceIdGenerator(SequenceIdGenerator sequenceIdGenerator) { + public void setSequenceIdGenerator(SequenceIdGeneratorMeta sequenceIdGenerator) { this.sequenceIdGenerator = sequenceIdGenerator; } /** - * {@link TableIdGenerator}を設定する。 + * {@link TableIdGeneratorMeta}を設定する。 * - * @param tableIdGenerator {@link TableIdGenerator} + * @param tableIdGenerator {@link TableIdGeneratorMeta} */ - public void setTableIdGenerator(TableIdGenerator tableIdGenerator) { + public void setTableIdGenerator(TableIdGeneratorMeta tableIdGenerator) { this.tableIdGenerator = tableIdGenerator; } Modified: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/BothMappedByAndJoinColumnException.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/BothMappedByAndJoinColumnException.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/BothMappedByAndJoinColumnException.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -19,20 +19,22 @@ package org.jiemamy.composer.importer.meta.exception; /** - * TODO for junichi + * mappedByとJoinColumnが両方指定されていた場合の例外クラス。 * - * @author junichi + * @author j5ik2o */ + @ SuppressWarnings("serial") public class BothMappedByAndJoinColumnException extends Exception { /** * インスタンスを生成する。 * - * @param name - * @param name2 + * @param entityName エンティティ名 + * @param propertyName プロパティ名 */ - public BothMappedByAndJoinColumnException(String name, String name2) { - // TODO Auto-generated constructor stub + public BothMappedByAndJoinColumnException(String entityName, String propertyName) { + super(String.format("Both MappedBy and JoinColumn.(entityName = %s, propertyName = %s)", entityName, + propertyName)); } } Modified: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/FieldDuplicatedException.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/FieldDuplicatedException.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/FieldDuplicatedException.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -21,7 +21,7 @@ import java.lang.reflect.Field; /** - * フィールドがだぶって生成された場合の例外クラス。 + * フィールドが重複した場合の例外クラス。 * * @author j5ik2o */ @@ -34,7 +34,7 @@ * @param field 対象のフィールド */ public FieldDuplicatedException(Field field) { - super(String.format("duplicated field %s", field.getName())); + super(String.format("Duplicated field (fieldName = %s)", field.getName())); } } Modified: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/IdGeneratorNotFoundException.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/IdGeneratorNotFoundException.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/IdGeneratorNotFoundException.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -18,22 +18,25 @@ */ package org.jiemamy.composer.importer.meta.exception; +import org.jiemamy.composer.importer.meta.generator.IdGeneratorMeta; + /** - * TODO for junichi + * {@link IdGeneratorMeta}が見つからなかった場合の例外クラス。 * - * @author junichi + * @author j5ik2o */ + @ SuppressWarnings("serial") public class IdGeneratorNotFoundException extends Exception { /** * インスタンスを生成する。 * - * @param name - * @param name2 - * @param generator + * @param entityName エンティティ名 + * @param propertyName プロパティ名 + * @param generatorName ジェネレータ名 */ - public IdGeneratorNotFoundException(String name, String name2, String generator) { - // TODO Auto-generated constructor stub + public IdGeneratorNotFoundException(String entityName, String propertyName, String generatorName) { + super(String.format("IdGenerator is not found.(entityName = %s, propertyName = %s, generatorName = %s)", + entityName, propertyName, generatorName)); } - } Modified: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/JoinColumnNameAndReferencedColumnNameMandatoryException.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/JoinColumnNameAndReferencedColumnNameMandatoryException.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/JoinColumnNameAndReferencedColumnNameMandatoryException.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -19,21 +19,23 @@ package org.jiemamy.composer.importer.meta.exception; /** - * TODO for junichi + * JoinColumnNameとReferencedColumnNameが指定されていない場合の例外クラス。 * - * @author junichi + * @author j5ik2o */ + @ SuppressWarnings("serial") public class JoinColumnNameAndReferencedColumnNameMandatoryException extends Exception { /** * インスタンスを生成する。 * - * @param name - * @param name2 - * @param i + * @param entityName エンティティ名 + * @param propertyName プロパティ名 + * @param index アノテーションのインデックス */ - public JoinColumnNameAndReferencedColumnNameMandatoryException(String name, String name2, int i) { - // TODO Auto-generated constructor stub + public JoinColumnNameAndReferencedColumnNameMandatoryException(String entityName, String propertyName, int index) { + super(String.format("JoinColumnName and ReferencedColumnName is mandatory." + + "(entityName = %s, propertyName = %s, index = %d)", entityName, propertyName, index)); } } Modified: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/LazyFetchSpecifiedException.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/LazyFetchSpecifiedException.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/LazyFetchSpecifiedException.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -18,21 +18,25 @@ */ package org.jiemamy.composer.importer.meta.exception; +import javax.persistence.FetchType; + /** - * TODO for junichi + * フェッチタイプに{@link FetchType#LAZY}が指定された場合の例外クラス。 * - * @author junichi + * @author j5ik2o */ + @ SuppressWarnings("serial") public class LazyFetchSpecifiedException extends Exception { /** * インスタンスを生成する。 * - * @param name - * @param name2 + * @param entityName エンティティ名 + * @param propertyName プロパティ名 */ - public LazyFetchSpecifiedException(String name, String name2) { - // TODO Auto-generated constructor stub + public LazyFetchSpecifiedException(String entityName, String propertyName) { + super(String.format("Not allow lazy fetch specified.(entityName = %s, propertyName = %s)", entityName, + propertyName)); } } Modified: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/MappedByMandatoryException.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/MappedByMandatoryException.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/MappedByMandatoryException.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -19,20 +19,21 @@ package org.jiemamy.composer.importer.meta.exception; /** - * TODO for junichi + * 一対多関連でmappedByが指定されていない場合の例外クラス。 * - * @author junichi + * @author j5ik2o */ + @ SuppressWarnings("serial") public class MappedByMandatoryException extends Exception { /** * インスタンスを生成する。 * - * @param name - * @param name2 + * @param entityName エンティティ名 + * @param propertyName プロパティ名 */ - public MappedByMandatoryException(String name, String name2) { - // TODO Auto-generated constructor stub + public MappedByMandatoryException(String entityName, String propertyName) { + super(String.format("MappedBy is mandatory.(entityName = %s, propertyName = %s)", entityName, propertyName)); } } Modified: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/OneToManyNotGenericsException.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/OneToManyNotGenericsException.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/OneToManyNotGenericsException.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -19,20 +19,22 @@ package org.jiemamy.composer.importer.meta.exception; /** - * TODO for junichi + * 一対多の関連がジェネリクスのリストではない場合の例外クラス。 * - * @author junichi + * @author j5ik2o */ + @ SuppressWarnings("serial") public class OneToManyNotGenericsException extends Exception { /** * インスタンスを生成する。 * - * @param name - * @param name2 + * @param entityName エンティティ名 + * @param propertyName プロパティ名 */ - public OneToManyNotGenericsException(String name, String name2) { - // TODO Auto-generated constructor stub + public OneToManyNotGenericsException(String entityName, String propertyName) { + super(String.format("oneToMany is not gerenerics.(entityName = %s, propertyName = %s)", entityName, + propertyName)); } } Modified: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/OneToManyNotListException.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/OneToManyNotListException.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/OneToManyNotListException.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -19,20 +19,21 @@ package org.jiemamy.composer.importer.meta.exception; /** - * TODO for junichi + * 一対多の関連がリストではない場合の例外クラス。 * - * @author junichi + * @author j5ik2o */ + @ SuppressWarnings("serial") public class OneToManyNotListException extends Exception { /** * インスタンスを生成する。 * - * @param name - * @param name2 + * @param entityName エンティティ名 + * @param propertyName プロパティ名 */ - public OneToManyNotListException(String name, String name2) { - // TODO Auto-generated constructor stub + public OneToManyNotListException(String entityName, String propertyName) { + super(String.format("oneToMay is not List.(entityName = %s, propertyName = %s)", entityName, propertyName)); } } Modified: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/RelationshipNotEntityException.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/RelationshipNotEntityException.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/RelationshipNotEntityException.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -19,21 +19,23 @@ package org.jiemamy.composer.importer.meta.exception; /** - * TODO for junichi + * 関連がエンティティではない場合の例外クラス。 * - * @author junichi + * @author j5ik2o */ + @ SuppressWarnings("serial") public class RelationshipNotEntityException extends Exception { /** * インスタンスを生成する。 * - * @param name - * @param name2 - * @param relationshipClass + * @param entityName エンティティ名 + * @param propertyName プロパティ名 + * @param relationshipClass 関連クラス */ - public RelationshipNotEntityException(String name, String name2, Class<?> relationshipClass) { - // TODO Auto-generated constructor stub + public RelationshipNotEntityException(String entityName, String propertyName, Class<?> relationshipClass) { + super(String.format("Relation ship is not entity.(entityName = %s, propertyName = %s)", entityName, + propertyName, relationshipClass)); } } Modified: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/TemporalTypeNotSpecifiedException.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/TemporalTypeNotSpecifiedException.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/TemporalTypeNotSpecifiedException.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -18,21 +18,29 @@ */ package org.jiemamy.composer.importer.meta.exception; +import java.sql.Date; +import java.util.Calendar; + +import javax.persistence.TemporalType; + /** - * TODO for junichi + * {@link Date} や {@link Calendar} 型のプロパティに {@link TemporalType} + * が設定されていない場合にスローされる例外クラス。 * - * @author junichi + * @author j5ik2o */ + @ SuppressWarnings("serial") public class TemporalTypeNotSpecifiedException extends Exception { /** * インスタンスを生成する。 * - * @param name - * @param name2 + * @param entityName エンティティ名 + * @param propertyName プロパティ名 */ - public TemporalTypeNotSpecifiedException(String name, String name2) { - // TODO Auto-generated constructor stub + public TemporalTypeNotSpecifiedException(String entityName, String propertyName) { + super(String.format("TemporalType is not specified.(entityName = %s, propertyName = %s)", entityName, + propertyName)); } } Modified: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/UnsupportedInheritanceException.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/UnsupportedInheritanceException.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/UnsupportedInheritanceException.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -19,9 +19,9 @@ package org.jiemamy.composer.importer.meta.exception; /** - * TODO for junichi + * サポートしていない継承の場合の例外クラス。 * - * @author junichi + * @author j5ik2o */ @SuppressWarnings("serial") public class UnsupportedInheritanceException extends Exception { @@ -29,10 +29,10 @@ /** * インスタンスを生成する。 * - * @param entityClass + * @param entityClass エンティティクラス */ public UnsupportedInheritanceException(Class<?> entityClass) { - // TODO Auto-generated constructor stub + super(String.format("Unsupported inheritance.(entityClassName = %s)", entityClass.getName())); } } Modified: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/UnsupportedPropertyTypesException.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/UnsupportedPropertyTypesException.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/UnsupportedPropertyTypesException.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -19,21 +19,23 @@ package org.jiemamy.composer.importer.meta.exception; /** - * TODO for junichi + * サポートしていないプロパティの型の例外クラス。 * - * @author junichi + * @author j5i2ko */ + @ SuppressWarnings("serial") public class UnsupportedPropertyTypesException extends Exception { /** * インスタンスを生成する。 * - * @param name - * @param name2 - * @param propertyClass + * @param entityName エンティティ名 + * @param propertyName プロパティ名 + * @param propertyClass プロパティクラス */ - public UnsupportedPropertyTypesException(String name, String name2, Class<?> propertyClass) { - // TODO Auto-generated constructor stub + public UnsupportedPropertyTypesException(String entityName, String propertyName, Class<?> propertyClass) { + super(String.format("Unsupported property types.(entityName = %s, propertyName = %s, propertyClassName = %s)", + entityName, propertyName, propertyClass.getName())); } } Modified: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/UnsupportedRelationshipException.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/UnsupportedRelationshipException.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/UnsupportedRelationshipException.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -19,20 +19,21 @@ package org.jiemamy.composer.importer.meta.exception; /** - * TODO for junichi + * サポートしていない関連の場合の例外クラス。 * - * @author junichi + * @author j5ik2o */ + @ SuppressWarnings("serial") public class UnsupportedRelationshipException extends Exception { /** * インスタンスを生成する。 * - * @param name - * @param name2 + * @param entityName エンティティ名 + * @param propertyName プロパティ名 */ - public UnsupportedRelationshipException(String name, String name2) { - // TODO Auto-generated constructor stub + public UnsupportedRelationshipException(String entityName, String propertyName) { + super(String.format("Unsupported relation ship.(entityName = %s, propertyName = %s)", entityName, propertyName)); } } Modified: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/VersionPropertyNotNumberException.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/VersionPropertyNotNumberException.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/exception/VersionPropertyNotNumberException.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -19,20 +19,22 @@ package org.jiemamy.composer.importer.meta.exception; /** - * TODO for junichi + * バージョンプロパティが数値型でない場合の例外クラス。 * - * @author junichi + * @author j5ik2o */ + @ SuppressWarnings("serial") public class VersionPropertyNotNumberException extends Exception { /** * インスタンスを生成する。 * - * @param name - * @param name2 + * @param entityName エンティティ名 + * @param propertyName プロパティ名 */ - public VersionPropertyNotNumberException(String name, String name2) { - // TODO Auto-generated constructor stub + public VersionPropertyNotNumberException(String entityName, String propertyName) { + super(String.format("Version property is not number.(entityName = %s, propertyName = %s)", entityName, + propertyName)); } } Deleted: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractIdGenerator.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractIdGenerator.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractIdGenerator.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -1,65 +0,0 @@ -/* - * Copyright 2004-2009 the Seasar Foundation and the Others. - * - * 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.composer.importer.meta.generator; - -import org.jiemamy.composer.importer.meta.EntityMeta; -import org.jiemamy.composer.importer.meta.PropertyMeta; - -/** - * 識別子を自動生成するIDジェネレータの抽象クラス。 - * - * @author j5ik2o - */ -public abstract class AbstractIdGenerator implements IdGenerator { - - /** エンティティメタデータ */ - private EntityMeta entityMeta; - - /** プロパティメタデータ */ - private PropertyMeta propertyMeta; - - - /** - * インスタンスを構築します。 - * - * @param entityMeta エンティティメタデータ - * @param propertyMeta プロパティメタデータ - */ - public AbstractIdGenerator(final EntityMeta entityMeta, final PropertyMeta propertyMeta) { - super(); - this.entityMeta = entityMeta; - this.propertyMeta = propertyMeta; - } - - /** - * {@link EntityMeta}を取得する。 - * - * @return {@link EntityMeta} - */ - public EntityMeta getEntityMeta() { - return entityMeta; - } - - /** - * {@link PropertyMeta}を取得する。 - * - * @return {@link PropertyMeta} - */ - public PropertyMeta getPropertyMeta() { - return propertyMeta; - } - -} Copied: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractIdGeneratorMeta.java (from rev 3156, charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractIdGenerator.java) =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractIdGeneratorMeta.java (rev 0) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractIdGeneratorMeta.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -0,0 +1,65 @@ +/* + * Copyright 2004-2009 the Seasar Foundation and the Others. + * + * 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.composer.importer.meta.generator; + +import org.jiemamy.composer.importer.meta.EntityMeta; +import org.jiemamy.composer.importer.meta.PropertyMeta; + +/** + * 識別子を自動生成するIDジェネレータメタの抽象クラス。 + * + * @author j5ik2o + */ +public abstract class AbstractIdGeneratorMeta implements IdGeneratorMeta { + + /** エンティティメタデータ */ + private EntityMeta entityMeta; + + /** プロパティメタデータ */ + private PropertyMeta propertyMeta; + + + /** + * インスタンスを構築します。 + * + * @param entityMeta エンティティメタデータ + * @param propertyMeta プロパティメタデータ + */ + public AbstractIdGeneratorMeta(final EntityMeta entityMeta, final PropertyMeta propertyMeta) { + super(); + this.entityMeta = entityMeta; + this.propertyMeta = propertyMeta; + } + + /** + * {@link EntityMeta}を取得する。 + * + * @return {@link EntityMeta} + */ + public EntityMeta getEntityMeta() { + return entityMeta; + } + + /** + * {@link PropertyMeta}を取得する。 + * + * @return {@link PropertyMeta} + */ + public PropertyMeta getPropertyMeta() { + return propertyMeta; + } + +} Property changes on: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractIdGeneratorMeta.java ___________________________________________________________________ Added: svn:mime-type + text/plain Deleted: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractPreAllocateIdGenerator.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractPreAllocateIdGenerator.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractPreAllocateIdGenerator.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -1,82 +0,0 @@ -/* - * Copyright 2004-2009 the Seasar Foundation and the Others. - * - * 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.composer.importer.meta.generator; - -import org.jiemamy.composer.importer.meta.EntityMeta; -import org.jiemamy.composer.importer.meta.PropertyMeta; - -/** - * INSERT前に識別子を自動生成するIDジェネレータの抽象クラスです。 - * - * @author j5ik2o - */ -public abstract class AbstractPreAllocateIdGenerator extends AbstractIdGenerator { - - /** 割り当てサイズ */ - private long allocationSize; - - /** 名前 */ - private String name; - - /** 初期値 */ - private long initialValue; - - - /** - * インスタンスを構築します。 - * - * @param entityMeta エンティティメタデータ - * @param propertyMeta プロパティメタデータ - * @param name ジェネレータ名 - * @param initialValue 初期値 - * @param allocationSize 割り当てサイズ - */ - public AbstractPreAllocateIdGenerator(final EntityMeta entityMeta, final PropertyMeta propertyMeta, String name, - long initialValue, long allocationSize) { - super(entityMeta, propertyMeta); - this.name = name; - this.initialValue = initialValue; - this.allocationSize = allocationSize; - } - - /** - * 割り当てサイズを取得する。 - * - * @return 割り当てサイズ - */ - public long getAllocationSize() { - return allocationSize; - } - - /** - * シーケンスの初期値を取得する。 - * - * @return シーケンスの初期値 - */ - public long getInitialValue() { - return initialValue; - } - - /** - * ジェネレータ名を取得する。 - * - * @return ジェネレータ名 - */ - public String getName() { - return name; - } - -} Copied: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractPreAllocateIdGeneratorMeta.java (from rev 3156, charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractPreAllocateIdGenerator.java) =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractPreAllocateIdGeneratorMeta.java (rev 0) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractPreAllocateIdGeneratorMeta.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -0,0 +1,82 @@ +/* + * Copyright 2004-2009 the Seasar Foundation and the Others. + * + * 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.composer.importer.meta.generator; + +import org.jiemamy.composer.importer.meta.EntityMeta; +import org.jiemamy.composer.importer.meta.PropertyMeta; + +/** + * INSERT前に識別子を自動生成するIDジェネレータメタの抽象クラスです。 + * + * @author j5ik2o + */ +public abstract class AbstractPreAllocateIdGeneratorMeta extends AbstractIdGeneratorMeta { + + /** 割り当てサイズ */ + private long allocationSize; + + /** 名前 */ + private String name; + + /** 初期値 */ + private long initialValue; + + + /** + * インスタンスを構築します。 + * + * @param entityMeta エンティティメタデータ + * @param propertyMeta プロパティメタデータ + * @param name ジェネレータ名 + * @param initialValue 初期値 + * @param allocationSize 割り当てサイズ + */ + public AbstractPreAllocateIdGeneratorMeta(final EntityMeta entityMeta, final PropertyMeta propertyMeta, + String name, long initialValue, long allocationSize) { + super(entityMeta, propertyMeta); + this.name = name; + this.initialValue = initialValue; + this.allocationSize = allocationSize; + } + + /** + * 割り当てサイズを取得する。 + * + * @return 割り当てサイズ + */ + public long getAllocationSize() { + return allocationSize; + } + + /** + * シーケンスの初期値を取得する。 + * + * @return シーケンスの初期値 + */ + public long getInitialValue() { + return initialValue; + } + + /** + * ジェネレータ名を取得する。 + * + * @return ジェネレータ名 + */ + public String getName() { + return name; + } + +} Property changes on: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/AbstractPreAllocateIdGeneratorMeta.java ___________________________________________________________________ Added: svn:mime-type + text/plain Deleted: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdGenerator.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdGenerator.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdGenerator.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -1,25 +0,0 @@ -/* - * Copyright 2004-2009 the Seasar Foundation and the Others. - * - * 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.composer.importer.meta.generator; - -/** - * 識別子を自動生成するIDジェネレータのインターフェースです。 - * - * @author koichik - */ -public interface IdGenerator { - -} Copied: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdGeneratorMeta.java (from rev 3156, charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdGenerator.java) =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdGeneratorMeta.java (rev 0) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdGeneratorMeta.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -0,0 +1,25 @@ +/* + * Copyright 2004-2009 the Seasar Foundation and the Others. + * + * 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.composer.importer.meta.generator; + +/** + * 識別子を自動生成するIDジェネレータメタのインターフェースです。 + * + * @author j5ik2o + */ +public interface IdGeneratorMeta { + +} Property changes on: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdGeneratorMeta.java ___________________________________________________________________ Added: svn:mime-type + text/plain Deleted: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdentityIdGenerator.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdentityIdGenerator.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdentityIdGenerator.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -1,41 +0,0 @@ -/* - * Copyright 2007-2009 Jiemamy Project and the Others. - * Created on Apr 6, 2009 - * - * 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.composer.importer.meta.generator; - -import org.jiemamy.composer.importer.meta.EntityMeta; -import org.jiemamy.composer.importer.meta.PropertyMeta; - -/** - * {@link IdentityGenerator}のメタ情報を保持するクラス。 - * - * @author j5ik2o - */ -public class IdentityIdGenerator extends AbstractIdGenerator { - - /** - * インスタンスを生成する。 - * - * @param entityMeta {@link EntityMeta} - * @param propertyMeta {@link PropertyMeta} - */ - public IdentityIdGenerator(EntityMeta entityMeta, PropertyMeta propertyMeta) { - super(entityMeta, propertyMeta); - } - -} Copied: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdentityIdGeneratorMeta.java (from rev 3156, charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdentityIdGenerator.java) =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdentityIdGeneratorMeta.java (rev 0) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdentityIdGeneratorMeta.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -0,0 +1,43 @@ +/* + * Copyright 2007-2009 Jiemamy Project and the Others. + * Created on Apr 6, 2009 + * + * 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.composer.importer.meta.generator; + +import javax.persistence.GenerationType; + +import org.jiemamy.composer.importer.meta.EntityMeta; +import org.jiemamy.composer.importer.meta.PropertyMeta; + +/** + * {@link GenerationType#IDENTITY}方式で識別子の値を自動生成するIDジェネレータメタ。 + * + * @author j5ik2o + */ +public class IdentityIdGeneratorMeta extends AbstractIdGeneratorMeta { + + /** + * インスタンスを生成する。 + * + * @param entityMeta {@link EntityMeta} + * @param propertyMeta {@link PropertyMeta} + */ + public IdentityIdGeneratorMeta(EntityMeta entityMeta, PropertyMeta propertyMeta) { + super(entityMeta, propertyMeta); + } + +} Property changes on: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/IdentityIdGeneratorMeta.java ___________________________________________________________________ Added: svn:mime-type + text/plain Deleted: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/SequenceIdGenerator.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/SequenceIdGenerator.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/SequenceIdGenerator.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -1,56 +0,0 @@ -/* - * Copyright 2007-2009 Jiemamy Project and the Others. - * Created on Apr 6, 2009 - * - * 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.composer.importer.meta.generator; - -import javax.persistence.SequenceGenerator; - -import org.jiemamy.composer.importer.meta.EntityMeta; -import org.jiemamy.composer.importer.meta.PropertyMeta; - -/** - * TODO for junichi - * - * @author junichi - */ -public class SequenceIdGenerator extends AbstractPreAllocateIdGenerator { - - private String sequenceName; - - - /** - * インスタンスを生成する。 - * - * @param entityMeta {@link EntityMeta} - * @param propertyMeta {@link PropertyMeta} - * @param sequenceGenerator {@link SequenceGenerator} - */ - public SequenceIdGenerator(EntityMeta entityMeta, PropertyMeta propertyMeta, SequenceGenerator sequenceGenerator) { - super(entityMeta, propertyMeta, sequenceGenerator.name(), sequenceGenerator.initialValue(), sequenceGenerator - .allocationSize()); - } - - /** - * シーケンス名を取得する。 - * - * @return シーケンス名 - */ - public String getSequenceName() { - return sequenceName; - } -} Copied: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/SequenceIdGeneratorMeta.java (from rev 3156, charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/SequenceIdGenerator.java) =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/SequenceIdGeneratorMeta.java (rev 0) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/SequenceIdGeneratorMeta.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -0,0 +1,56 @@ +/* + * Copyright 2007-2009 Jiemamy Project and the Others. + * Created on Apr 6, 2009 + * + * 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.composer.importer.meta.generator; + +import javax.persistence.SequenceGenerator; + +import org.jiemamy.composer.importer.meta.EntityMeta; +import org.jiemamy.composer.importer.meta.PropertyMeta; + +/** + * {@link SequenceGenerator}のメタデータを保持するクラス。 + * + * @author j5ik2o + */ +public class SequenceIdGeneratorMeta extends AbstractPreAllocateIdGeneratorMeta { + + private String sequenceName; + + + /** + * インスタンスを生成する。 + * + * @param entityMeta {@link EntityMeta} + * @param propertyMeta {@link PropertyMeta} + * @param sequenceGenerator {@link SequenceGenerator} + */ + public SequenceIdGeneratorMeta(EntityMeta entityMeta, PropertyMeta propertyMeta, SequenceGenerator sequenceGenerator) { + super(entityMeta, propertyMeta, sequenceGenerator.name(), sequenceGenerator.initialValue(), sequenceGenerator + .allocationSize()); + } + + /** + * シーケンス名を取得する。 + * + * @return シーケンス名 + */ + public String getSequenceName() { + return sequenceName; + } +} Property changes on: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/SequenceIdGeneratorMeta.java ___________________________________________________________________ Added: svn:mime-type + text/plain Deleted: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/TableIdGenerator.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/TableIdGenerator.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/TableIdGenerator.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -1,117 +0,0 @@ -/* - * Copyright 2007-2009 Jiemamy Project and the Others. - * Created on Apr 6, 2009 - * - * 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.composer.importer.meta.generator; - -import javax.persistence.TableGenerator; - -import org.jiemamy.composer.importer.meta.EntityMeta; -import org.jiemamy.composer.importer.meta.PropertyMeta; - -/** - * {@link TableGenerator}のメタデータを保持するクラス。 - * - * @author j5ik2o - */ -public class TableIdGenerator extends AbstractPreAllocateIdGenerator { - - private String catalogName; - - private String pkColumnName; - - private String pkColumnValue; - - private String valueColumnName; - - private String schemaName; - - private String tableName; - - - /** - * インスタンスを生成する。 - * - * @param entityMeta {@link EntityMeta} - * @param propertyMeta {@link PropertyMeta} - * @param tableGenerator {@link TableGenerator} - */ - public TableIdGenerator(EntityMeta entityMeta, PropertyMeta propertyMeta, TableGenerator tableGenerator) { - super(entityMeta, propertyMeta, tableGenerator.name(), tableGenerator.initialValue(), tableGenerator - .allocationSize()); - catalogName = tableGenerator.catalog(); - pkColumnName = tableGenerator.pkColumnName(); - pkColumnValue = tableGenerator.pkColumnValue(); - schemaName = tableGenerator.schema(); - tableName = tableGenerator.table(); - } - - /** - * 採番テーブルのカタログ名を取得する。 - * - * @return 採番テーブルのカタログ名 - */ - public String getCatalogName() { - return catalogName; - } - - /** - * 採番テーブルのカラム名を取得する。 - * - * @return 採番テーブルのカラム名 - */ - public String getPkColumnName() { - return pkColumnName; - } - - /** - * 採番テーブルの識別子の値を取得する。 - * - * @return 採番テーブルの識別子の値 - */ - public String getPkColumnValue() { - return pkColumnValue; - } - - /** - * 採番テーブルの識別子の値を取得する。 - * - * @return 採番テーブルの識別子の値 - */ - public String getSchemaName() { - return schemaName; - } - - /** - * 採番テーブル名を取得する。 - * - * @return 採番テーブル名 - */ - public String getTableName() { - return tableName; - } - - /** - * 採番テーブルの値のカラム名を取得する。 - * - * @return 採番テーブルの値のカラム名 - */ - public String getValueColumnName() { - return valueColumnName; - } - -} Copied: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/TableIdGeneratorMeta.java (from rev 3156, charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/TableIdGenerator.java) =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/TableIdGeneratorMeta.java (rev 0) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/TableIdGeneratorMeta.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -0,0 +1,117 @@ +/* + * Copyright 2007-2009 Jiemamy Project and the Others. + * Created on Apr 6, 2009 + * + * 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.composer.importer.meta.generator; + +import javax.persistence.TableGenerator; + +import org.jiemamy.composer.importer.meta.EntityMeta; +import org.jiemamy.composer.importer.meta.PropertyMeta; + +/** + * {@link TableGenerator}のメタデータを保持するクラス。 + * + * @author j5ik2o + */ +public class TableIdGeneratorMeta extends AbstractPreAllocateIdGeneratorMeta { + + private String catalogName; + + private String pkColumnName; + + private String pkColumnValue; + + private String valueColumnName; + + private String schemaName; + + private String tableName; + + + /** + * インスタンスを生成する。 + * + * @param entityMeta {@link EntityMeta} + * @param propertyMeta {@link PropertyMeta} + * @param tableGenerator {@link TableGenerator} + */ + public TableIdGeneratorMeta(EntityMeta entityMeta, PropertyMeta propertyMeta, TableGenerator tableGenerator) { + super(entityMeta, propertyMeta, tableGenerator.name(), tableGenerator.initialValue(), tableGenerator + .allocationSize()); + catalogName = tableGenerator.catalog(); + pkColumnName = tableGenerator.pkColumnName(); + pkColumnValue = tableGenerator.pkColumnValue(); + schemaName = tableGenerator.schema(); + tableName = tableGenerator.table(); + } + + /** + * 採番テーブルのカタログ名を取得する。 + * + * @return 採番テーブルのカタログ名 + */ + public String getCatalogName() { + return catalogName; + } + + /** + * 採番テーブルのカラム名を取得する。 + * + * @return 採番テーブルのカラム名 + */ + public String getPkColumnName() { + return pkColumnName; + } + + /** + * 採番テーブルの識別子の値を取得する。 + * + * @return 採番テーブルの識別子の値 + */ + public String getPkColumnValue() { + return pkColumnValue; + } + + /** + * 採番テーブルの識別子の値を取得する。 + * + * @return 採番テーブルの識別子の値 + */ + public String getSchemaName() { + return schemaName; + } + + /** + * 採番テーブル名を取得する。 + * + * @return 採番テーブル名 + */ + public String getTableName() { + return tableName; + } + + /** + * 採番テーブルの値のカラム名を取得する。 + * + * @return 採番テーブルの値のカラム名 + */ + public String getValueColumnName() { + return valueColumnName; + } + +} Property changes on: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/generator/TableIdGeneratorMeta.java ___________________________________________________________________ Added: svn:mime-type + text/plain Modified: charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/impl/PropertyMetaFactoryImpl.java =================================================================== --- charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/impl/PropertyMetaFactoryImpl.java 2009-04-07 09:58:53 UTC (rev 3157) +++ charon/jiemamy-jpa-importer/trunk/src/main/java/org/jiemamy/composer/importer/meta/impl/PropertyMetaFactoryImpl.java 2009-04-07 10:01:16 UTC (rev 3158) @@ -63,9 +63,9 @@ import org.jiemamy.composer.importer.meta.exception.TemporalTypeNotSpecifiedException; import org.jiemamy.composer.importer.meta.exception.UnsupportedRelationshipException; import org.jiemamy.composer.importer.meta.exception.VersionPropertyNotNumberException; -import org.jiemamy.composer.importer.meta.generator.IdentityIdGenerator; -import org.jiemamy.composer.importer.meta.generator.SequenceIdGenerator; -import org.jiemamy.composer.importer.meta.generator.TableIdGenerator; +import org.jiemamy.composer.importer.meta.generator.IdentityIdGeneratorMeta; +import org.jiemamy.composer.importer.meta.generator.SequenceIdGeneratorMeta; +import org.jiemamy.composer.importer.meta.generator.TableIdGeneratorMeta; import org.jiemamy.utils.ClassUtil; import org.jiemamy.utils.ModifierUtil; import org.jiemamy.utils.ReflectionUtil; @@ -222,7 +222,7 @@ private void doIdentityIdGenerator(PropertyMeta propertyMeta, EntityMeta entityMeta) { Validate.notNull(propertyMeta); Validate.notNull(entityMeta); - propertyMeta.setIdentityIdGenerator(new IdentityIdGenerator(entityMeta, propertyMeta)); + propertyMeta.setIdentityIdGenerator(new IdentityIdGeneratorMeta(entityMeta, propertyMeta)); } private void doJoinColumn(PropertyMeta propertyMeta, Field field, EntityMeta entityMeta) @@ -287,7 +287,7 @@ Validate.notNull(entityMeta); Validate.notNull(oneToMany); propertyMeta.setRelationshipType(RelationshipType.ONE_TO_MANY); - if (!List.class.isAssignableFrom(field.getType())) { + if (List.class.isAssignableFrom(field.getType()) == false) { throw new OneToManyNotListException(entityMeta.getName(), propertyMeta.getName()); } Class<?> relationshipClass = ReflectionUtil.getElementTypeOfList(field.getGenericType()); @@ -369,7 +369,7 @@ } } } - propertyMeta.setSequenceIdGenerator(new SequenceIdGenerator(entityMeta, propertyMeta, sequenceGenerator)); + propertyMeta.setSequenceIdGenerator(new SequenceIdGeneratorMeta(entityMeta, propertyMeta, sequenceGenerator)); return true; } @@ -390,7 +390,7 @@ } } } - propertyMeta.setTableIdGenerator(new TableIdGenerator(entityMeta, propertyMeta, tableGenerator)); + propertyMeta.setTableIdGenerator(new TableIdGeneratorMeta(entityMeta, propertyMeta, tableGenerator)); return true; }