From: taktos9 Date: Mon, 27 Oct 2008 02:08:27 +0000 (+0000) Subject: ディクショナリ機能追加 X-Git-Tag: ea2ddl-0.0.3~35 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ab5b99d75186af87a3972d726b1d98804a70e33d;p=ea2ddl%2Fea2ddl.git ディクショナリ機能追加 git-svn-id: http://svn.sourceforge.jp/svnroot/ea2ddl/trunk/ea2ddl@67 136db618-7844-41ca-8ac1-fb3fd040db1d --- diff --git a/ea2ddl-ddl/src/main/java/jp/sourceforge/ea2ddl/ddl/factory/impl/DatabaseModelFactoryImpl.java b/ea2ddl-ddl/src/main/java/jp/sourceforge/ea2ddl/ddl/factory/impl/DatabaseModelFactoryImpl.java index ae45280..ff3a6c8 100644 --- a/ea2ddl-ddl/src/main/java/jp/sourceforge/ea2ddl/ddl/factory/impl/DatabaseModelFactoryImpl.java +++ b/ea2ddl-ddl/src/main/java/jp/sourceforge/ea2ddl/ddl/factory/impl/DatabaseModelFactoryImpl.java @@ -147,7 +147,7 @@ public class DatabaseModelFactoryImpl implements ModelFactory { final ColumnModel column = new ColumnModel(); column.setName(attribute.getName()); column.setAlias(attribute.getStyle()); - column.setType(attribute.getType()); + column.setType(getColumnType(attribute)); column.setLength(attribute.getLength()); column.setPrecision(attribute.getPrecision()); column.setScale(attribute.getScale()); @@ -157,6 +157,14 @@ public class DatabaseModelFactoryImpl implements ModelFactory { } } + protected String getColumnType(TAttribute attribute) { + final String dictionary = _config.getProperty(attribute.getName()); + if (dictionary != null) { + return dictionary; + } + return attribute.getType(); + } + protected void generatePKModel(TableModel table, TObject tobject) { final ListResultBean pkList = _tOperationBhv.selectOperation(tobject, Constants.STEREOTYPE_PRIMARY_KEY); diff --git a/ea2ddl-ddl/src/main/resources/app-config.dicon b/ea2ddl-ddl/src/main/resources/app-config.dicon index 99f5bb6..d182ec8 100644 --- a/ea2ddl-ddl/src/main/resources/app-config.dicon +++ b/ea2ddl-ddl/src/main/resources/app-config.dicon @@ -7,5 +7,8 @@ "ea2ddl.properties" + + "dictionary.properties" + \ No newline at end of file diff --git a/ea2ddl-ddl/src/test/resources/dictionary.properties b/ea2ddl-ddl/src/test/resources/dictionary.properties new file mode 100644 index 0000000..4d80ce9 --- /dev/null +++ b/ea2ddl-ddl/src/test/resources/dictionary.properties @@ -0,0 +1,3 @@ +MONEY=NUMBER(12) +FLAG=NUMBER(1) +ID=NUMBER(8) \ No newline at end of file diff --git a/ea2ddl-ddl/src/test/resources/jdbc.dicon b/ea2ddl-ddl/src/test/resources/jdbc.dicon index 0d07484..9e25427 100644 --- a/ea2ddl-ddl/src/test/resources/jdbc.dicon +++ b/ea2ddl-ddl/src/test/resources/jdbc.dicon @@ -11,7 +11,7 @@ "sun.jdbc.odbc.JdbcOdbcDriver" - "jdbc:odbc:exampledb" + "jdbc:odbc:exampledb_ea" "sa" ""