svnno****@sourc*****
svnno****@sourc*****
2009年 4月 13日 (月) 19:04:14 JST
Revision: 3256 http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=3256 Author: j5ik2o Date: 2009-04-13 19:04:14 +0900 (Mon, 13 Apr 2009) Log Message: ----------- リファクタリング Modified Paths: -------------- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/AttributeDescFactory.java leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/CompositeUniqueConstraintDescFactory.java leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/EntityDescFactory.java leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/AssociationResolver.java leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/AttributeDescFactoryImpl.java leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/CompositeUniqueConstraintDescFactoryImpl.java leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/EntityDescFactoryImpl.java leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/EntitySetDescFactoryImpl.java Added Paths: ----------- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbColumnMeta.java leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbForeignKeyMeta.java leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbTableMeta.java leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbTableMetaReader.java leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbUniqueKeyMeta.java Removed Paths: ------------- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbColumnMeta.java leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbForeignKeyMeta.java leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbTableMeta.java leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbTableMetaReader.java leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbUniqueKeyMeta.java -------------- next part -------------- Modified: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/AttributeDescFactory.java =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/AttributeDescFactory.java 2009-04-13 10:03:49 UTC (rev 3255) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/AttributeDescFactory.java 2009-04-13 10:04:14 UTC (rev 3256) @@ -18,8 +18,8 @@ */ package org.jiemamy.entity.io.gen.desc; -import org.jiemamy.entity.io.meta.DbColumnMeta; -import org.jiemamy.entity.io.meta.DbTableMeta; +import org.jiemamy.entity.io.gen.meta.DbColumnMeta; +import org.jiemamy.entity.io.gen.meta.DbTableMeta; /** * {@link AttributeDesc 属性記述}のファクトリインターフェイス。 Modified: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/CompositeUniqueConstraintDescFactory.java =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/CompositeUniqueConstraintDescFactory.java 2009-04-13 10:03:49 UTC (rev 3255) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/CompositeUniqueConstraintDescFactory.java 2009-04-13 10:04:14 UTC (rev 3256) @@ -18,7 +18,7 @@ */ package org.jiemamy.entity.io.gen.desc; -import org.jiemamy.entity.io.meta.DbUniqueKeyMeta; +import org.jiemamy.entity.io.gen.meta.DbUniqueKeyMeta; /** * {@link CompositeUniqueConstraintDesc}のファクトリインターフェイス。 Modified: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/EntityDescFactory.java =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/EntityDescFactory.java 2009-04-13 10:03:49 UTC (rev 3255) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/EntityDescFactory.java 2009-04-13 10:04:14 UTC (rev 3256) @@ -18,7 +18,7 @@ */ package org.jiemamy.entity.io.gen.desc; -import org.jiemamy.entity.io.meta.DbTableMeta; +import org.jiemamy.entity.io.gen.meta.DbTableMeta; /** * {@link EntityDesc}のファクトリインターフェイス。 Modified: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/AssociationResolver.java =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/AssociationResolver.java 2009-04-13 10:03:49 UTC (rev 3255) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/AssociationResolver.java 2009-04-13 10:04:14 UTC (rev 3256) @@ -23,8 +23,8 @@ import org.jiemamy.entity.io.gen.desc.AttributeDesc; import org.jiemamy.entity.io.gen.desc.EntityDesc; import org.jiemamy.entity.io.gen.desc.EntitySetDesc; -import org.jiemamy.entity.io.meta.DbForeignKeyMeta; -import org.jiemamy.entity.io.meta.DbTableMeta; +import org.jiemamy.entity.io.gen.meta.DbForeignKeyMeta; +import org.jiemamy.entity.io.gen.meta.DbTableMeta; import org.jiemamy.utils.StringUtil; /** Modified: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/AttributeDescFactoryImpl.java =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/AttributeDescFactoryImpl.java 2009-04-13 10:03:49 UTC (rev 3255) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/AttributeDescFactoryImpl.java 2009-04-13 10:04:14 UTC (rev 3256) @@ -29,8 +29,8 @@ import org.jiemamy.entity.io.gen.desc.AttributeDesc; import org.jiemamy.entity.io.gen.desc.AttributeDescFactory; -import org.jiemamy.entity.io.meta.DbColumnMeta; -import org.jiemamy.entity.io.meta.DbTableMeta; +import org.jiemamy.entity.io.gen.meta.DbColumnMeta; +import org.jiemamy.entity.io.gen.meta.DbTableMeta; import org.jiemamy.entity.io.utils.AnnotationUtil; import org.jiemamy.utils.ClassUtil; Modified: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/CompositeUniqueConstraintDescFactoryImpl.java =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/CompositeUniqueConstraintDescFactoryImpl.java 2009-04-13 10:03:49 UTC (rev 3255) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/CompositeUniqueConstraintDescFactoryImpl.java 2009-04-13 10:04:14 UTC (rev 3256) @@ -20,7 +20,7 @@ import org.jiemamy.entity.io.gen.desc.CompositeUniqueConstraintDesc; import org.jiemamy.entity.io.gen.desc.CompositeUniqueConstraintDescFactory; -import org.jiemamy.entity.io.meta.DbUniqueKeyMeta; +import org.jiemamy.entity.io.gen.meta.DbUniqueKeyMeta; /** * {@link CompositeUniqueConstraintDescFactory}の実装クラス。 Modified: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/EntityDescFactoryImpl.java =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/EntityDescFactoryImpl.java 2009-04-13 10:03:49 UTC (rev 3255) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/EntityDescFactoryImpl.java 2009-04-13 10:04:14 UTC (rev 3256) @@ -26,9 +26,9 @@ import org.jiemamy.entity.io.gen.desc.CompositeUniqueConstraintDescFactory; import org.jiemamy.entity.io.gen.desc.EntityDesc; import org.jiemamy.entity.io.gen.desc.EntityDescFactory; -import org.jiemamy.entity.io.meta.DbColumnMeta; -import org.jiemamy.entity.io.meta.DbTableMeta; -import org.jiemamy.entity.io.meta.DbUniqueKeyMeta; +import org.jiemamy.entity.io.gen.meta.DbColumnMeta; +import org.jiemamy.entity.io.gen.meta.DbTableMeta; +import org.jiemamy.entity.io.gen.meta.DbUniqueKeyMeta; /** * {@link EntityDescFactory}の実装クラスです。 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-13 10:03:49 UTC (rev 3255) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/desc/impl/EntitySetDescFactoryImpl.java 2009-04-13 10:04:14 UTC (rev 3256) @@ -36,9 +36,9 @@ import org.jiemamy.entity.io.gen.desc.EntityDescFactory; import org.jiemamy.entity.io.gen.desc.EntitySetDesc; import org.jiemamy.entity.io.gen.desc.EntitySetDescFactory; -import org.jiemamy.entity.io.meta.DbForeignKeyMeta; -import org.jiemamy.entity.io.meta.DbTableMeta; -import org.jiemamy.entity.io.meta.DbTableMetaReader; +import org.jiemamy.entity.io.gen.meta.DbForeignKeyMeta; +import org.jiemamy.entity.io.gen.meta.DbTableMeta; +import org.jiemamy.entity.io.gen.meta.DbTableMetaReader; /** * {@link EntitySetDescFactory}の実装クラスです。 Copied: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbColumnMeta.java (from rev 3255, leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbColumnMeta.java) =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbColumnMeta.java (rev 0) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbColumnMeta.java 2009-04-13 10:04:14 UTC (rev 3256) @@ -0,0 +1,261 @@ +/* + * Copyright 2007-2009 Jiemamy Project and the Others. + * Created on Apr 7, 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.entity.io.gen.meta; + +/** + * データベースのカラムメタデータです。 + * + * @author j5ik2o + */ +public class DbColumnMeta { + + /** 名前 */ + protected String name; + + /** SQL型 */ + protected int sqlType; + + /** 型名 */ + protected String typeName; + + /** 長さ */ + protected int length; + + /** スケール */ + protected int scale; + + /** デフォルト値 */ + protected String defaultValue; + + /** NULL可能の場合{@code true} */ + protected boolean nullable; + + /** 主キーの場合{@code true} */ + protected boolean primaryKey; + + /** 値が自動的に増分される場合{@code true} */ + protected boolean autoIncrement; + + /** 一意の場合{@code true} */ + protected boolean unique; + + /** コメント */ + protected String comment; + + + /** + * コメントを返します。 + * + * @return コメント + */ + public String getComment() { + return comment; + } + + /** + * デフォルト値を返します。 + * + * @return デフォルト値 + */ + public String getDefaultValue() { + return defaultValue; + } + + /** + * 長さを返します。 + * + * @return 長さ + */ + public int getLength() { + return length; + } + + /** + * 名前を返します。 + * + * @return 名前 + */ + public String getName() { + return name; + } + + /** + * スケールを返します。 + * + * @return スケール + */ + public int getScale() { + return scale; + } + + /** + * SQL型を返します。 + * + * @return SQL型 + */ + public int getSqlType() { + return sqlType; + } + + /** + * 型名を返します。 + * + * @return 型名 + */ + public String getTypeName() { + return typeName; + } + + /** + * 値が自動的に増分される場合{@code true}を返します。 + * + * @return 値が自動的に増分される場合{@code true}、そうでない場合{@code false} + */ + public boolean isAutoIncrement() { + return autoIncrement; + } + + /** + * NULL可能の場合{@code true}を返します。 + * + * @return NULL可能の場合{@code true}、そうでない場合{@code false} + */ + public boolean isNullable() { + return nullable; + } + + /** + * 主キーの場合{@code true}を返します。 + * + * @return 主キーの場合{@code true}、そうでない場合{@code false} + */ + public boolean isPrimaryKey() { + return primaryKey; + } + + /** + * 一意の場合{@code true}、そうでない場合{@code false}を返します。 + * + * @return 一意の場合{@code true}、そうでない場合{@code false} + */ + public boolean isUnique() { + return unique; + } + + /** + * 値が自動的に増分される場合{@code true}を設定します。 + * + * @param autoIncrement 値が自動的に増分される場合{@code true}、そうでない場合{@code false} + */ + public void setAutoIncrement(boolean autoIncrement) { + this.autoIncrement = autoIncrement; + } + + /** + * コメントを設定します。 + * + * @param comment コメント + */ + public void setComment(String comment) { + this.comment = comment; + } + + /** + * デフォルト値を設定します + * + * @param defaultValue デフォルト値 + */ + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } + + /** + * 長さを設定します。 + * + * @param length 長さ + */ + public void setLength(int length) { + this.length = length; + } + + /** + * 名前を設定します。 + * + * @param name 名前 + */ + public void setName(String name) { + this.name = name; + } + + /** + * NULL可能の場合{@code true}を設定します。 + * + * @param nullable NULL可能の場合{@code true} + */ + public void setNullable(boolean nullable) { + this.nullable = nullable; + } + + /** + * 主キーの場合 {@code true}を設定します。 + * + * @param primaryKey 主キーの場合 {@code true} + * + */ + public void setPrimaryKey(boolean primaryKey) { + this.primaryKey = primaryKey; + } + + /** + * スケールを設定します。 + * + * @param scale スケール + */ + public void setScale(int scale) { + this.scale = scale; + } + + /** + * SQL型をセットします。 + * + * @param sqlType SQL型 + */ + public void setSqlType(int sqlType) { + this.sqlType = sqlType; + } + + /** + * SQL型の名前を設定します。 + * + * @param typeName SQL型の名前 + */ + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + /** + * 一意の場合{@code true}、そうでない場合{@code false}を設定します。 + * + * @param unique 一意の場合{@code true} + */ + public void setUnique(boolean unique) { + this.unique = unique; + } + +} Property changes on: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbColumnMeta.java ___________________________________________________________________ Added: svn:mime-type + text/plain Copied: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbForeignKeyMeta.java (from rev 3255, leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbForeignKeyMeta.java) =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbForeignKeyMeta.java (rev 0) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbForeignKeyMeta.java 2009-04-13 10:04:14 UTC (rev 3256) @@ -0,0 +1,204 @@ +/* + * Copyright 2007-2009 Jiemamy Project and the Others. + * Created on Apr 7, 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.entity.io.gen.meta; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * データベースの外部キーメタデータです。 + * + * @author j5ik2o + */ +public class DbForeignKeyMeta { + + /** 名前 */ + protected String name; + + /** 主キー側のカタログ名 */ + protected String primaryKeyCatalogName; + + /** 主キー側のスキーマ名 */ + protected String primaryKeySchemaName; + + /** 主キー側のテーブル名 */ + protected String primaryKeyTableName; + + /** 主キーのカラム名のリスト */ + protected List<String> primaryKeyColumnNameList = new ArrayList<String>(); + + /** 外部キーのカラム名のリスト */ + protected List<String> foreignKeyColumnNameList = new ArrayList<String>(); + + /** 一意の場合{@code true} */ + protected boolean unique; + + + /** + * 外部キーのカラム名を追加します。 + * + * @param foreignKeyColumnName 外部キーのカラム名 + */ + public void addForeignKeyColumnName(String foreignKeyColumnName) { + foreignKeyColumnNameList.add(foreignKeyColumnName); + } + + /** + * 主キーのカラム名を追加します。 + * + * @param primaryKeyColumnName 主キーのカラム名 + */ + public void addPrimaryKeyColumnName(String primaryKeyColumnName) { + primaryKeyColumnNameList.add(primaryKeyColumnName); + } + + /** + * 外部キーのカラム名のリストを返します。 + * + * @return 外部キーのカラム名のリスト + */ + public List<String> getForeignKeyColumnNameList() { + return Collections.unmodifiableList(foreignKeyColumnNameList); + } + + /** + * 名前を返します。 + * + * @return 名前 + */ + public String getName() { + return name; + } + + /** + * 主キー側のカタログ名を返します。 + * + * @return 主キー側のカタログ名 + */ + public String getPrimaryKeyCatalogName() { + return primaryKeyCatalogName; + } + + /** + * 主キーのカラム名のリストを返します。 + * + * @return 主キーのカラム名のリスト + */ + public List<String> getPrimaryKeyColumnNameList() { + return Collections.unmodifiableList(primaryKeyColumnNameList); + } + + /** + * 完全なテーブル名を返します。 + * + * @return 完全なテーブル名 + */ + public String getPrimaryKeyFullTableName() { + StringBuilder buf = new StringBuilder(); + if (primaryKeyCatalogName != null) { + buf.append(primaryKeyCatalogName).append("."); + } + if (primaryKeySchemaName != null) { + buf.append(primaryKeySchemaName).append("."); + } + return buf.append(primaryKeyTableName).toString(); + } + + /** + * 主キー側のスキーマ名を返します。 + * + * @return 主キー側のスキーマ名 + */ + public String getPrimaryKeySchemaName() { + return primaryKeySchemaName; + } + + /** + * 主キー側のテーブル名を返します。 + * + * @return 主キー側のテーブル名 + */ + public String getPrimaryKeyTableName() { + return primaryKeyTableName; + } + + /** + * 複合外部キーの場合{@code true}、そうでない場合{@code false}を返します。 + * + * @return 複合外部キーの場合{@code true}、そうでない場合{@code false} + */ + public boolean isComposite() { + return foreignKeyColumnNameList.size() > 1; + } + + /** + * 一意の場合{@code true}、そうでない場合{@code false}を返します。 + * + * @return 一意の場合{@code true}、そうでない場合{@code false} + */ + public boolean isUnique() { + return unique; + } + + /** + * 名前を設定します。 + * + * @param name 名前 + */ + public void setName(String name) { + this.name = name; + } + + /** + * 主キー側のカタログ名を設定します。 + * + * @param primaryKeyCatalogName 主キー側のカタログ名 + */ + public void setPrimaryKeyCatalogName(String primaryKeyCatalogName) { + this.primaryKeyCatalogName = primaryKeyCatalogName; + } + + /** + * 主キー側のスキーマ名を設定します。 + * + * @param primaryKeySchemaName 主キー側のスキーマ名 + */ + public void setPrimaryKeySchemaName(String primaryKeySchemaName) { + this.primaryKeySchemaName = primaryKeySchemaName; + } + + /** + * 主キー側のテーブル名を設定します。 + * + * @param primaryKeyTableName 主キー側のテーブル名 + */ + public void setPrimaryKeyTableName(String primaryKeyTableName) { + this.primaryKeyTableName = primaryKeyTableName; + } + + /** + * 一意の場合{@code true}、そうでない場合{@code false}を設定します。 + * + * @param unique 一意の場合{@code true} + */ + public void setUnique(boolean unique) { + this.unique = unique; + } +} Property changes on: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbForeignKeyMeta.java ___________________________________________________________________ Added: svn:mime-type + text/plain Copied: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbTableMeta.java (from rev 3255, leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbTableMeta.java) =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbTableMeta.java (rev 0) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbTableMeta.java 2009-04-13 10:04:14 UTC (rev 3256) @@ -0,0 +1,224 @@ +/* + * Copyright 2007-2009 Jiemamy Project and the Others. + * Created on Apr 7, 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.entity.io.gen.meta; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * データベースのテーブルメタデータ。 + * + * @author j5ik2o + */ +public class DbTableMeta { + + /** カタログ名 */ + protected String catalogName; + + /** スキーマ名 */ + protected String schemaName; + + /** 名前 */ + protected String name; + + /** 完全な名前 */ + protected String fullName; + + /** コメント */ + protected String comment; + + /** カラムメタデータのリスト */ + protected List<DbColumnMeta> columnMetaList = new ArrayList<DbColumnMeta>(); + + /** 主キーのカラムメタデータのリスト */ + protected List<DbColumnMeta> primaryKeyColumnMetaList = new ArrayList<DbColumnMeta>(); + + /** 外部キーメタデータのリスト */ + protected List<DbForeignKeyMeta> foreignKeyMetaList = new ArrayList<DbForeignKeyMeta>(); + + /** 一意キーメタデータのリスト */ + protected List<DbUniqueKeyMeta> uniqueKeyMetaList = new ArrayList<DbUniqueKeyMeta>(); + + + /** + * カラムのメタデータを追加する。 + * + * @param columnDesc カラム記述 + */ + public void addColumnMeta(DbColumnMeta columnDesc) { + columnMetaList.add(columnDesc); + if (columnDesc.isPrimaryKey()) { + primaryKeyColumnMetaList.add(columnDesc); + } + } + + /** + * 外部キーメタデータを追加する。 + * + * @param foreignKeyMeta 外部キーメタデータ + */ + public void addForeignKeyMeta(DbForeignKeyMeta foreignKeyMeta) { + foreignKeyMetaList.add(foreignKeyMeta); + } + + /** + * 一意キーメタデータを追加する。 + * + * @param uniqueKeyMeta 一意キーメタデータ + */ + public void addUniqueKeyMeta(DbUniqueKeyMeta uniqueKeyMeta) { + uniqueKeyMetaList.add(uniqueKeyMeta); + } + + /** + * カタログ名を返します。 + * + * @return カタログ名 + */ + public String getCatalogName() { + return catalogName; + } + + /** + * カラムのメタデータのリストを返します。 + * + * @return カラムのメタデータのリスト + */ + public List<DbColumnMeta> getColumnMetaList() { + return Collections.unmodifiableList(columnMetaList); + } + + /** + * コメントを取得する。 + * + * @return コメント + */ + public String getComment() { + return comment; + } + + /** + * 外部キーメタデータのリストを取得する。 + * + * @return 外部キーメタデータのリスト + */ + public List<DbForeignKeyMeta> getForeignKeyMetaList() { + return Collections.unmodifiableList(foreignKeyMetaList); + } + + /** + * 完全なテーブル名を取得する。 + * + * @return 完全なテーブル名 + */ + public String getFullName() { + return fullName; + } + + /** + * 名前を取得する。 + * + * @return 名前 + */ + public String getName() { + return name; + } + + /** + * 主キーのカラムメタデータのリストを取得する。 + * + * @return 主キーのカラムメタデータのリスト + */ + public List<DbColumnMeta> getPrimaryKeyColumnMetaList() { + return Collections.unmodifiableList(primaryKeyColumnMetaList); + } + + /** + * スキーマ名を取得する。 + * + * @return スキーマ名 + */ + public String getSchemaName() { + return schemaName; + } + + /** + * 一意キーメタデータのリストを取得する。 + * + * @return 一意キーメタデータのリスト + */ + public List<DbUniqueKeyMeta> getUniqueKeyMetaList() { + return Collections.unmodifiableList(uniqueKeyMetaList); + } + + /** + * 複合主キーを持つ場合{@code true}を取得する。 + * + * @return 複合主キーを持つ場合{@code true}、そうでない場合{@code false} + */ + public boolean hasCompositePrimaryKey() { + return primaryKeyColumnMetaList.size() > 1; + } + + /** + * カタログ名を設定する。 + * + * @param catalogName カタログ名 + */ + public void setCatalogName(String catalogName) { + this.catalogName = catalogName; + } + + /** + * コメントを設定する。 + * + * @param comment コメント + */ + public void setComment(String comment) { + this.comment = comment; + } + + /** + * 完全な名前を設定する。 + * + * @param fullName 完全な名前 + */ + public void setFullName(String fullName) { + this.fullName = fullName; + } + + /** + * 名前を設定する。 + * + * @param name 名前 + */ + public void setName(String name) { + this.name = name; + } + + /** + * スキーマ名を設定する。 + * + * @param schemaName スキーマ名 + */ + public void setSchemaName(String schemaName) { + this.schemaName = schemaName; + } +} Property changes on: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbTableMeta.java ___________________________________________________________________ Added: svn:mime-type + text/plain Copied: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbTableMetaReader.java (from rev 3255, leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbTableMetaReader.java) =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbTableMetaReader.java (rev 0) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbTableMetaReader.java 2009-04-13 10:04:14 UTC (rev 3256) @@ -0,0 +1,36 @@ +/* + * Copyright 2007-2009 Jiemamy Project and the Others. + * Created on Apr 7, 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.entity.io.gen.meta; + +import java.util.List; + +/** + * {@link DbTableMeta データベースのテーブルメタデータ}を読み取るインタフェースです。 + * + * @author j5ik2o + */ +public interface DbTableMetaReader { + + /** + * データベースのテーブルメタデータを読み取ります。 + * + * @return テーブルメタデータのリスト + */ + List<DbTableMeta> read(); +} Property changes on: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbTableMetaReader.java ___________________________________________________________________ Added: svn:mime-type + text/plain Copied: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbUniqueKeyMeta.java (from rev 3255, leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbUniqueKeyMeta.java) =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbUniqueKeyMeta.java (rev 0) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbUniqueKeyMeta.java 2009-04-13 10:04:14 UTC (rev 3256) @@ -0,0 +1,105 @@ +/* + * Copyright 2007-2009 Jiemamy Project and the Others. + * Created on Apr 7, 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.entity.io.gen.meta; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * データベースの一意キーメタデータです。 + * + * @author j5ik2o + */ +public class DbUniqueKeyMeta { + + /** 名前 */ + protected String name; + + /** 主キーの場合{@code true} */ + protected boolean primaryKey; + + /** カラム名 */ + protected List<String> columnNameList = new ArrayList<String>(); + + + /** + * カラム名を追加します。 + * + * @param columnName カラム名 + */ + public void addColumnName(String columnName) { + columnNameList.add(columnName); + } + + /** + * カラム名のリストを返します。 + * + * @return カラム名のリスト + */ + public List<String> getColumnNameList() { + return Collections.unmodifiableList(columnNameList); + } + + /** + * 名前を返します。 + * + * @return 名前 + */ + public String getName() { + return name; + } + + /** + * 複合一意キーの場合{@code true}、そうでない場合{@code false}を返します。 + * + * @return 複合一意キーの場合{@code true}、そうでない場合{@code false} + */ + public boolean isComposite() { + return columnNameList.size() > 1; + } + + /** + * 主キーの場合{@code true}、そうでない場合{@code false}を返します。 + * + * @return 主キーの場合{@code true}、そうでない場合{@code false} + */ + public boolean isPrimaryKey() { + return primaryKey; + } + + /** + * 名前を設定します。 + * + * @param name 名前 + */ + public void setName(String name) { + this.name = name; + } + + /** + * 主キーの場合{@code true}、そうでない場合{@code false}を設定します。 + * + * @param primaryKey 主キーの場合{@code true}、そうでない場合{@code false} + */ + public void setPrimaryKey(boolean primaryKey) { + this.primaryKey = primaryKey; + } + +} Property changes on: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/gen/meta/DbUniqueKeyMeta.java ___________________________________________________________________ Added: svn:mime-type + text/plain Deleted: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbColumnMeta.java =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbColumnMeta.java 2009-04-13 10:03:49 UTC (rev 3255) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbColumnMeta.java 2009-04-13 10:04:14 UTC (rev 3256) @@ -1,261 +0,0 @@ -/* - * Copyright 2007-2009 Jiemamy Project and the Others. - * Created on Apr 7, 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.entity.io.meta; - -/** - * データベースのカラムメタデータです。 - * - * @author j5ik2o - */ -public class DbColumnMeta { - - /** 名前 */ - protected String name; - - /** SQL型 */ - protected int sqlType; - - /** 型名 */ - protected String typeName; - - /** 長さ */ - protected int length; - - /** スケール */ - protected int scale; - - /** デフォルト値 */ - protected String defaultValue; - - /** NULL可能の場合{@code true} */ - protected boolean nullable; - - /** 主キーの場合{@code true} */ - protected boolean primaryKey; - - /** 値が自動的に増分される場合{@code true} */ - protected boolean autoIncrement; - - /** 一意の場合{@code true} */ - protected boolean unique; - - /** コメント */ - protected String comment; - - - /** - * コメントを返します。 - * - * @return コメント - */ - public String getComment() { - return comment; - } - - /** - * デフォルト値を返します。 - * - * @return デフォルト値 - */ - public String getDefaultValue() { - return defaultValue; - } - - /** - * 長さを返します。 - * - * @return 長さ - */ - public int getLength() { - return length; - } - - /** - * 名前を返します。 - * - * @return 名前 - */ - public String getName() { - return name; - } - - /** - * スケールを返します。 - * - * @return スケール - */ - public int getScale() { - return scale; - } - - /** - * SQL型を返します。 - * - * @return SQL型 - */ - public int getSqlType() { - return sqlType; - } - - /** - * 型名を返します。 - * - * @return 型名 - */ - public String getTypeName() { - return typeName; - } - - /** - * 値が自動的に増分される場合{@code true}を返します。 - * - * @return 値が自動的に増分される場合{@code true}、そうでない場合{@code false} - */ - public boolean isAutoIncrement() { - return autoIncrement; - } - - /** - * NULL可能の場合{@code true}を返します。 - * - * @return NULL可能の場合{@code true}、そうでない場合{@code false} - */ - public boolean isNullable() { - return nullable; - } - - /** - * 主キーの場合{@code true}を返します。 - * - * @return 主キーの場合{@code true}、そうでない場合{@code false} - */ - public boolean isPrimaryKey() { - return primaryKey; - } - - /** - * 一意の場合{@code true}、そうでない場合{@code false}を返します。 - * - * @return 一意の場合{@code true}、そうでない場合{@code false} - */ - public boolean isUnique() { - return unique; - } - - /** - * 値が自動的に増分される場合{@code true}を設定します。 - * - * @param autoIncrement 値が自動的に増分される場合{@code true}、そうでない場合{@code false} - */ - public void setAutoIncrement(boolean autoIncrement) { - this.autoIncrement = autoIncrement; - } - - /** - * コメントを設定します。 - * - * @param comment コメント - */ - public void setComment(String comment) { - this.comment = comment; - } - - /** - * デフォルト値を設定します - * - * @param defaultValue デフォルト値 - */ - public void setDefaultValue(String defaultValue) { - this.defaultValue = defaultValue; - } - - /** - * 長さを設定します。 - * - * @param length 長さ - */ - public void setLength(int length) { - this.length = length; - } - - /** - * 名前を設定します。 - * - * @param name 名前 - */ - public void setName(String name) { - this.name = name; - } - - /** - * NULL可能の場合{@code true}を設定します。 - * - * @param nullable NULL可能の場合{@code true} - */ - public void setNullable(boolean nullable) { - this.nullable = nullable; - } - - /** - * 主キーの場合 {@code true}を設定します。 - * - * @param primaryKey 主キーの場合 {@code true} - * - */ - public void setPrimaryKey(boolean primaryKey) { - this.primaryKey = primaryKey; - } - - /** - * スケールを設定します。 - * - * @param scale スケール - */ - public void setScale(int scale) { - this.scale = scale; - } - - /** - * SQL型をセットします。 - * - * @param sqlType SQL型 - */ - public void setSqlType(int sqlType) { - this.sqlType = sqlType; - } - - /** - * SQL型の名前を設定します。 - * - * @param typeName SQL型の名前 - */ - public void setTypeName(String typeName) { - this.typeName = typeName; - } - - /** - * 一意の場合{@code true}、そうでない場合{@code false}を設定します。 - * - * @param unique 一意の場合{@code true} - */ - public void setUnique(boolean unique) { - this.unique = unique; - } - -} Deleted: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbForeignKeyMeta.java =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbForeignKeyMeta.java 2009-04-13 10:03:49 UTC (rev 3255) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbForeignKeyMeta.java 2009-04-13 10:04:14 UTC (rev 3256) @@ -1,204 +0,0 @@ -/* - * Copyright 2007-2009 Jiemamy Project and the Others. - * Created on Apr 7, 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.entity.io.meta; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * データベースの外部キーメタデータです。 - * - * @author j5ik2o - */ -public class DbForeignKeyMeta { - - /** 名前 */ - protected String name; - - /** 主キー側のカタログ名 */ - protected String primaryKeyCatalogName; - - /** 主キー側のスキーマ名 */ - protected String primaryKeySchemaName; - - /** 主キー側のテーブル名 */ - protected String primaryKeyTableName; - - /** 主キーのカラム名のリスト */ - protected List<String> primaryKeyColumnNameList = new ArrayList<String>(); - - /** 外部キーのカラム名のリスト */ - protected List<String> foreignKeyColumnNameList = new ArrayList<String>(); - - /** 一意の場合{@code true} */ - protected boolean unique; - - - /** - * 外部キーのカラム名を追加します。 - * - * @param foreignKeyColumnName 外部キーのカラム名 - */ - public void addForeignKeyColumnName(String foreignKeyColumnName) { - foreignKeyColumnNameList.add(foreignKeyColumnName); - } - - /** - * 主キーのカラム名を追加します。 - * - * @param primaryKeyColumnName 主キーのカラム名 - */ - public void addPrimaryKeyColumnName(String primaryKeyColumnName) { - primaryKeyColumnNameList.add(primaryKeyColumnName); - } - - /** - * 外部キーのカラム名のリストを返します。 - * - * @return 外部キーのカラム名のリスト - */ - public List<String> getForeignKeyColumnNameList() { - return Collections.unmodifiableList(foreignKeyColumnNameList); - } - - /** - * 名前を返します。 - * - * @return 名前 - */ - public String getName() { - return name; - } - - /** - * 主キー側のカタログ名を返します。 - * - * @return 主キー側のカタログ名 - */ - public String getPrimaryKeyCatalogName() { - return primaryKeyCatalogName; - } - - /** - * 主キーのカラム名のリストを返します。 - * - * @return 主キーのカラム名のリスト - */ - public List<String> getPrimaryKeyColumnNameList() { - return Collections.unmodifiableList(primaryKeyColumnNameList); - } - - /** - * 完全なテーブル名を返します。 - * - * @return 完全なテーブル名 - */ - public String getPrimaryKeyFullTableName() { - StringBuilder buf = new StringBuilder(); - if (primaryKeyCatalogName != null) { - buf.append(primaryKeyCatalogName).append("."); - } - if (primaryKeySchemaName != null) { - buf.append(primaryKeySchemaName).append("."); - } - return buf.append(primaryKeyTableName).toString(); - } - - /** - * 主キー側のスキーマ名を返します。 - * - * @return 主キー側のスキーマ名 - */ - public String getPrimaryKeySchemaName() { - return primaryKeySchemaName; - } - - /** - * 主キー側のテーブル名を返します。 - * - * @return 主キー側のテーブル名 - */ - public String getPrimaryKeyTableName() { - return primaryKeyTableName; - } - - /** - * 複合外部キーの場合{@code true}、そうでない場合{@code false}を返します。 - * - * @return 複合外部キーの場合{@code true}、そうでない場合{@code false} - */ - public boolean isComposite() { - return foreignKeyColumnNameList.size() > 1; - } - - /** - * 一意の場合{@code true}、そうでない場合{@code false}を返します。 - * - * @return 一意の場合{@code true}、そうでない場合{@code false} - */ - public boolean isUnique() { - return unique; - } - - /** - * 名前を設定します。 - * - * @param name 名前 - */ - public void setName(String name) { - this.name = name; - } - - /** - * 主キー側のカタログ名を設定します。 - * - * @param primaryKeyCatalogName 主キー側のカタログ名 - */ - public void setPrimaryKeyCatalogName(String primaryKeyCatalogName) { - this.primaryKeyCatalogName = primaryKeyCatalogName; - } - - /** - * 主キー側のスキーマ名を設定します。 - * - * @param primaryKeySchemaName 主キー側のスキーマ名 - */ - public void setPrimaryKeySchemaName(String primaryKeySchemaName) { - this.primaryKeySchemaName = primaryKeySchemaName; - } - - /** - * 主キー側のテーブル名を設定します。 - * - * @param primaryKeyTableName 主キー側のテーブル名 - */ - public void setPrimaryKeyTableName(String primaryKeyTableName) { - this.primaryKeyTableName = primaryKeyTableName; - } - - /** - * 一意の場合{@code true}、そうでない場合{@code false}を設定します。 - * - * @param unique 一意の場合{@code true} - */ - public void setUnique(boolean unique) { - this.unique = unique; - } -} Deleted: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbTableMeta.java =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbTableMeta.java 2009-04-13 10:03:49 UTC (rev 3255) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbTableMeta.java 2009-04-13 10:04:14 UTC (rev 3256) @@ -1,224 +0,0 @@ -/* - * Copyright 2007-2009 Jiemamy Project and the Others. - * Created on Apr 7, 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.entity.io.meta; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * データベースのテーブルメタデータ。 - * - * @author j5ik2o - */ -public class DbTableMeta { - - /** カタログ名 */ - protected String catalogName; - - /** スキーマ名 */ - protected String schemaName; - - /** 名前 */ - protected String name; - - /** 完全な名前 */ - protected String fullName; - - /** コメント */ - protected String comment; - - /** カラムメタデータのリスト */ - protected List<DbColumnMeta> columnMetaList = new ArrayList<DbColumnMeta>(); - - /** 主キーのカラムメタデータのリスト */ - protected List<DbColumnMeta> primaryKeyColumnMetaList = new ArrayList<DbColumnMeta>(); - - /** 外部キーメタデータのリスト */ - protected List<DbForeignKeyMeta> foreignKeyMetaList = new ArrayList<DbForeignKeyMeta>(); - - /** 一意キーメタデータのリスト */ - protected List<DbUniqueKeyMeta> uniqueKeyMetaList = new ArrayList<DbUniqueKeyMeta>(); - - - /** - * カラムのメタデータを追加する。 - * - * @param columnDesc カラム記述 - */ - public void addColumnMeta(DbColumnMeta columnDesc) { - columnMetaList.add(columnDesc); - if (columnDesc.isPrimaryKey()) { - primaryKeyColumnMetaList.add(columnDesc); - } - } - - /** - * 外部キーメタデータを追加する。 - * - * @param foreignKeyMeta 外部キーメタデータ - */ - public void addForeignKeyMeta(DbForeignKeyMeta foreignKeyMeta) { - foreignKeyMetaList.add(foreignKeyMeta); - } - - /** - * 一意キーメタデータを追加する。 - * - * @param uniqueKeyMeta 一意キーメタデータ - */ - public void addUniqueKeyMeta(DbUniqueKeyMeta uniqueKeyMeta) { - uniqueKeyMetaList.add(uniqueKeyMeta); - } - - /** - * カタログ名を返します。 - * - * @return カタログ名 - */ - public String getCatalogName() { - return catalogName; - } - - /** - * カラムのメタデータのリストを返します。 - * - * @return カラムのメタデータのリスト - */ - public List<DbColumnMeta> getColumnMetaList() { - return Collections.unmodifiableList(columnMetaList); - } - - /** - * コメントを取得する。 - * - * @return コメント - */ - public String getComment() { - return comment; - } - - /** - * 外部キーメタデータのリストを取得する。 - * - * @return 外部キーメタデータのリスト - */ - public List<DbForeignKeyMeta> getForeignKeyMetaList() { - return Collections.unmodifiableList(foreignKeyMetaList); - } - - /** - * 完全なテーブル名を取得する。 - * - * @return 完全なテーブル名 - */ - public String getFullName() { - return fullName; - } - - /** - * 名前を取得する。 - * - * @return 名前 - */ - public String getName() { - return name; - } - - /** - * 主キーのカラムメタデータのリストを取得する。 - * - * @return 主キーのカラムメタデータのリスト - */ - public List<DbColumnMeta> getPrimaryKeyColumnMetaList() { - return Collections.unmodifiableList(primaryKeyColumnMetaList); - } - - /** - * スキーマ名を取得する。 - * - * @return スキーマ名 - */ - public String getSchemaName() { - return schemaName; - } - - /** - * 一意キーメタデータのリストを取得する。 - * - * @return 一意キーメタデータのリスト - */ - public List<DbUniqueKeyMeta> getUniqueKeyMetaList() { - return Collections.unmodifiableList(uniqueKeyMetaList); - } - - /** - * 複合主キーを持つ場合{@code true}を取得する。 - * - * @return 複合主キーを持つ場合{@code true}、そうでない場合{@code false} - */ - public boolean hasCompositePrimaryKey() { - return primaryKeyColumnMetaList.size() > 1; - } - - /** - * カタログ名を設定する。 - * - * @param catalogName カタログ名 - */ - public void setCatalogName(String catalogName) { - this.catalogName = catalogName; - } - - /** - * コメントを設定する。 - * - * @param comment コメント - */ - public void setComment(String comment) { - this.comment = comment; - } - - /** - * 完全な名前を設定する。 - * - * @param fullName 完全な名前 - */ - public void setFullName(String fullName) { - this.fullName = fullName; - } - - /** - * 名前を設定する。 - * - * @param name 名前 - */ - public void setName(String name) { - this.name = name; - } - - /** - * スキーマ名を設定する。 - * - * @param schemaName スキーマ名 - */ - public void setSchemaName(String schemaName) { - this.schemaName = schemaName; - } -} Deleted: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbTableMetaReader.java =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbTableMetaReader.java 2009-04-13 10:03:49 UTC (rev 3255) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbTableMetaReader.java 2009-04-13 10:04:14 UTC (rev 3256) @@ -1,36 +0,0 @@ -/* - * Copyright 2007-2009 Jiemamy Project and the Others. - * Created on Apr 7, 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.entity.io.meta; - -import java.util.List; - -/** - * {@link DbTableMeta データベースのテーブルメタデータ}を読み取るインタフェースです。 - * - * @author j5ik2o - */ -public interface DbTableMetaReader { - - /** - * データベースのテーブルメタデータを読み取ります。 - * - * @return テーブルメタデータのリスト - */ - List<DbTableMeta> read(); -} Deleted: leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbUniqueKeyMeta.java =================================================================== --- leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbUniqueKeyMeta.java 2009-04-13 10:03:49 UTC (rev 3255) +++ leto/jiemamy-entity-io/trunk/src/main/java/org/jiemamy/entity/io/meta/DbUniqueKeyMeta.java 2009-04-13 10:04:14 UTC (rev 3256) @@ -1,105 +0,0 @@ -/* - * Copyright 2007-2009 Jiemamy Project and the Others. - * Created on Apr 7, 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.entity.io.meta; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * データベースの一意キーメタデータです。 - * - * @author j5ik2o - */ -public class DbUniqueKeyMeta { - - /** 名前 */ - protected String name; - - /** 主キーの場合{@code true} */ - protected boolean primaryKey; - - /** カラム名 */ - protected List<String> columnNameList = new ArrayList<String>(); - - - /** - * カラム名を追加します。 - * - * @param columnName カラム名 - */ - public void addColumnName(String columnName) { - columnNameList.add(columnName); - } - - /** - * カラム名のリストを返します。 - * - * @return カラム名のリスト - */ - public List<String> getColumnNameList() { - return Collections.unmodifiableList(columnNameList); - } - - /** - * 名前を返します。 - * - * @return 名前 - */ - public String getName() { - return name; - } - - /** - * 複合一意キーの場合{@code true}、そうでない場合{@code false}を返します。 - * - * @return 複合一意キーの場合{@code true}、そうでない場合{@code false} - */ - public boolean isComposite() { - return columnNameList.size() > 1; - } - - /** - * 主キーの場合{@code true}、そうでない場合{@code false}を返します。 - * - * @return 主キーの場合{@code true}、そうでない場合{@code false} - */ - public boolean isPrimaryKey() { - return primaryKey; - } - - /** - * 名前を設定します。 - * - * @param name 名前 - */ - public void setName(String name) { - this.name = name; - } - - /** - * 主キーの場合{@code true}、そうでない場合{@code false}を設定します。 - * - * @param primaryKey 主キーの場合{@code true}、そうでない場合{@code false} - */ - public void setPrimaryKey(boolean primaryKey) { - this.primaryKey = primaryKey; - } - -}