svnno****@sourc*****
svnno****@sourc*****
2009年 5月 21日 (木) 19:53:14 JST
Revision: 3414 http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=3414 Author: blackyman Date: 2009-05-21 19:53:14 +0900 (Thu, 21 May 2009) Log Message: ----------- テーブル情報編集で型リストが表示されたのでコミットしてみる Modified Paths: -------------- artemis/trunk/jiemamy-dialect-oracle/src/main/java/org/jiemamy/dialect/oracle/OracleDialect.java -------------- next part -------------- Modified: artemis/trunk/jiemamy-dialect-oracle/src/main/java/org/jiemamy/dialect/oracle/OracleDialect.java =================================================================== --- artemis/trunk/jiemamy-dialect-oracle/src/main/java/org/jiemamy/dialect/oracle/OracleDialect.java 2009-05-21 10:52:57 UTC (rev 3413) +++ artemis/trunk/jiemamy-dialect-oracle/src/main/java/org/jiemamy/dialect/oracle/OracleDialect.java 2009-05-21 10:53:14 UTC (rev 3414) @@ -18,7 +18,25 @@ */ package org.jiemamy.dialect.oracle; +import static org.jiemamy.model.datatype.DataTypeCategory.BIT; +import static org.jiemamy.model.datatype.DataTypeCategory.BLOB; +import static org.jiemamy.model.datatype.DataTypeCategory.BOOLEAN; +import static org.jiemamy.model.datatype.DataTypeCategory.CHARACTER; +import static org.jiemamy.model.datatype.DataTypeCategory.CLOB; +import static org.jiemamy.model.datatype.DataTypeCategory.DATE; +import static org.jiemamy.model.datatype.DataTypeCategory.DECIMAL; +import static org.jiemamy.model.datatype.DataTypeCategory.DOUBLE; +import static org.jiemamy.model.datatype.DataTypeCategory.FLOAT; import static org.jiemamy.model.datatype.DataTypeCategory.INTEGER; +import static org.jiemamy.model.datatype.DataTypeCategory.INTERVAL; +import static org.jiemamy.model.datatype.DataTypeCategory.NUMERIC; +import static org.jiemamy.model.datatype.DataTypeCategory.OTHER; +import static org.jiemamy.model.datatype.DataTypeCategory.REAL; +import static org.jiemamy.model.datatype.DataTypeCategory.SMALLINT; +import static org.jiemamy.model.datatype.DataTypeCategory.TIME; +import static org.jiemamy.model.datatype.DataTypeCategory.TIMESTAMP; +import static org.jiemamy.model.datatype.DataTypeCategory.VARBIT; +import static org.jiemamy.model.datatype.DataTypeCategory.VARCHAR; import java.util.List; @@ -29,12 +47,15 @@ import org.jiemamy.dialect.internal.BuiltinDataTypeMoldImpl; import org.jiemamy.dialect.internal.impl.DefaultDialectInitializer; import org.jiemamy.dialect.internal.impl.DefaultMoldManager; +import org.jiemamy.model.datatype.adapter.PrecisionedDataTypeAdapter; +import org.jiemamy.model.datatype.adapter.SizedDataTypeAdapter; +import org.jiemamy.model.datatype.adapter.TimezonedDataTypeAdapter; import org.jiemamy.utils.CollectionsUtil; /** * Oracleに対するSQL方言実装クラス。 * - * @author daisuke + * @author BlackyMan */ public class OracleDialect extends AbstractDialect { @@ -42,9 +63,27 @@ static { List<BuiltinDataTypeMold> list = CollectionsUtil.newArrayList(); - list.add(new BuiltinDataTypeMoldImpl(INTEGER)); - // TODO - typeList = UnmodifiableList.decorate(list); + list.add(new BuiltinDataTypeMoldImpl(DECIMAL, "NUMBER", PrecisionedDataTypeAdapter.class)); + list.add(new BuiltinDataTypeMoldImpl(INTEGER, "NUMBER - INTEGER", PrecisionedDataTypeAdapter.class)); + list.add(new BuiltinDataTypeMoldImpl(SMALLINT, "NUMBER - SMALLINT", PrecisionedDataTypeAdapter.class)); + list.add(new BuiltinDataTypeMoldImpl(NUMERIC, "NUMBER - NUMERIC", PrecisionedDataTypeAdapter.class)); + list.add(new BuiltinDataTypeMoldImpl(FLOAT, "NUMBER - FLOAT", PrecisionedDataTypeAdapter.class)); + list.add(new BuiltinDataTypeMoldImpl(REAL, "NUMBER - REAL", PrecisionedDataTypeAdapter.class)); + list.add(new BuiltinDataTypeMoldImpl(DOUBLE, "NUMBER - DOUBLE", PrecisionedDataTypeAdapter.class)); + list.add(new BuiltinDataTypeMoldImpl(BIT, "NUMBER - BIT", PrecisionedDataTypeAdapter.class)); + list.add(new BuiltinDataTypeMoldImpl(VARBIT, "NUMBER - VARBIT", PrecisionedDataTypeAdapter.class)); + list.add(new BuiltinDataTypeMoldImpl(BOOLEAN, "NUMBER - BOOLEAN", PrecisionedDataTypeAdapter.class)); + list.add(new BuiltinDataTypeMoldImpl(OTHER, "RAW", SizedDataTypeAdapter.class)); + list.add(new BuiltinDataTypeMoldImpl(OTHER, "LONGRAW", SizedDataTypeAdapter.class)); + list.add(new BuiltinDataTypeMoldImpl(CHARACTER, "CHAR", SizedDataTypeAdapter.class)); + list.add(new BuiltinDataTypeMoldImpl(VARCHAR, "VARCHAR2", SizedDataTypeAdapter.class)); + list.add(new BuiltinDataTypeMoldImpl(CLOB, SizedDataTypeAdapter.class)); + list.add(new BuiltinDataTypeMoldImpl(BLOB, SizedDataTypeAdapter.class)); + list.add(new BuiltinDataTypeMoldImpl(DATE)); + list.add(new BuiltinDataTypeMoldImpl(TIME, "DATE - TIME", TimezonedDataTypeAdapter.class)); + list.add(new BuiltinDataTypeMoldImpl(TIMESTAMP, "DATE - TIMESTAMP", TimezonedDataTypeAdapter.class)); + list.add(new BuiltinDataTypeMoldImpl(INTERVAL, "DATE - INTERVAL")); + OracleDialect.typeList = UnmodifiableList.decorate(list); } @@ -55,6 +94,11 @@ super(new DefaultDialectInitializer(new DefaultMoldManager(typeList))); } + @Override + public String getConnectionUriTemplate() { + return "jdbc:oracle:thin:@[host]:1521:[sid]"; + } + public String getName() { return "Oracle 10g"; }