From ab5b99d75186af87a3972d726b1d98804a70e33d Mon Sep 17 00:00:00 2001 From: taktos9 Date: Mon, 27 Oct 2008 02:08:27 +0000 Subject: [PATCH] =?utf8?q?=E3=83=87=E3=82=A3=E3=82=AF=E3=82=B7=E3=83=A7?= =?utf8?q?=E3=83=8A=E3=83=AA=E6=A9=9F=E8=83=BD=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.sourceforge.jp/svnroot/ea2ddl/trunk/ea2ddl@67 136db618-7844-41ca-8ac1-fb3fd040db1d --- .../ea2ddl/ddl/factory/impl/DatabaseModelFactoryImpl.java | 10 +++++++++- ea2ddl-ddl/src/main/resources/app-config.dicon | 3 +++ ea2ddl-ddl/src/test/resources/dictionary.properties | 3 +++ ea2ddl-ddl/src/test/resources/jdbc.dicon | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 ea2ddl-ddl/src/test/resources/dictionary.properties 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" "" -- 2.11.0