読者です 読者をやめる 読者になる 読者になる

AKAI TSUKI

System development or Technical something

S2Dao-CodeGenを試す

dicon/CodeGen.diconを修正

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container 2.3//EN"
	"http://www.seasar.org/dtd/components23.dtd">

<components>
	<include path="j2ee.dicon"/>
	<include path="internal.dicon"/>
	<component name="path" class="org.seasar.codegen.ant.DirectoryList" >
<!-- addメソッドの第2引数は生成したソースの出力先です -->
		<initMethod name="add">
			<arg>"java"</arg>
			<arg>"target/gen/java"</arg>			
		</initMethod>
		<initMethod name="add" >
			<arg>"resource"</arg>
			<arg>"target/gen/resources"</arg>
		</initMethod>
		<initMethod name="add" >
			<arg>"createtable"</arg>
			<arg>"target/gen/ddl"</arg>
		</initMethod>
	</component>
	<component class="org.seasar.codegen.impl.CodeGenConfigImpl" >
		<property name="headerTemplatePath">"test/header.txt"</property>
		<property name="versionNoPropertyName">"versionno"</property>
		<property name="outputAllDaoDicon">true</property>
		<property name="outputDDL">true</property>
		<property name="encoding">"UTF-8"</property>
		<!--入力ファイル名設定 -->
		<property name="inputFile">"src/test/resources/codegen.jer"</property>
		<!--パッケージ名名設定 -->
		<property name="packageName">"org.seasar.codegen.sample"</property>
	</component>
<!--入力ファイル設定 -->
<!--
	<component class="org.seasar.codegen.impl.ERWinCSVImportCodeData" >
	</component>
-->
<!--
	<component class="org.seasar.codegen.impl.ExcelImportCodeDataSingleSheet">
	</component>
-->
<!--
	<component class="org.seasar.codegen.impl.ExcelImportCodeDataMultiSheet">
	</component>
-->
<!--
	<component class="org.seasar.codegen.impl.JiemamyImportCodeData">
	</component>
-->
	<component class="org.seasar.codegen.impl.DatabaseImportCodeData">
		<property name="schemaName">"public"</property>
		<initMethod name="addTable">
			<arg>"SAMPLE_INFO"</arg>
		</initMethod>
<!--		<initMethod name="addTable">
			<arg>"DEPT4"</arg>
		</initMethod>
-->
	</component>
<!--DBタイプ設定-->
<!--
	<component class="org.seasar.codegen.dbms.DB2" >
	</component>
-->
<!--
	<component class="org.seasar.codegen.dbms.MySQL">
	</component>
-->
<!--
	<component class="org.seasar.codegen.dbms.MaxDB">
	</component>
-->
<!--
	<component class="org.seasar.codegen.dbms.Oracle">
	</component>
-->
<!--
	<component class="org.seasar.codegen.dbms.HSQL">
	</component>
-->
	<component class="org.seasar.codegen.dbms.PostgreSQL">
	</component>
<!--
	<component class="org.seasar.codegen.dbms.Derby">
	</component>
-->
<!--
	<component class="org.seasar.codegen.dbms.H2">
	</component>
-->
<!--
	<component class="org.seasar.codegen.dbms.MSSQLServer">
	</component>
-->
	<component class="org.seasar.codegen.convert.impl.FKNameChildNameConverterImpl">
	</component>
	<component class="org.seasar.codegen.convert.impl.CamelConverterImpl">
	</component>
<!--	
	<component name="templateDir">"fm/java"</component>
-->
</components>

dicon/jdbc.diconを修正

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container//EN"
"http://www.seasar.org/dtd/components.dtd">
<components namespace="j2ee">

	<include path="jta.dicon"/>
	<component class="org.seasar.extension.jdbc.impl.BasicResultSetFactory"/>
	<component class="org.seasar.extension.jdbc.impl.BasicStatementFactory"/>
	<!--
	<component class="org.seasar.extension.jdbc.impl.OracleResultSetFactory"/>
	<component class="org.seasar.extension.jdbc.impl.BooleanToIntStatementFactory"/>
	-->

	<component name="xaDataSource"
		class="org.seasar.extension.dbcp.impl.XADataSourceImpl">
		<property name="driverClassName">
			"org.postgresql.Driver"
        </property>
        <property name="URL">
          "jdbc:postgresql://localhost/データベース名"
        </property>
        <property name="user">"ユーザ"</property>
        <property name="password">"パスワード"</property>
	</component>
    
    	<!--
	<component name="xaDataSource"
		class="org.seasar.extension.dbcp.impl.XADataSourceImpl">
		<property name="driverClassName">
			"oracle.jdbc.driver.OracleDriver"
		</property>
		<property name="URL">
			"jdbc:oracle:thin:@xxx:1521:yyy"
		</property>
		<property name="user">"ark"</property>
		<property name="password">"ark"</property>
	</component>
	
	<component name="xaDataSource"
		class="org.seasar.extension.dbcp.impl.XADataSourceImpl">
		<property name="driverClassName">
			"com.sap.dbtech.jdbc.DriverSapDB"
		</property>
		<property name="URL">
			"jdbc:sapdb://192.168.0.109/MAXDB?unicode"
		</property>
		<property name="user">"BURI2"</property>
		<property name="password">"buri2"</property>
	</component>
	-->
<!--
	<component name="xaDataSource"
		class="org.seasar.extension.dbcp.impl.XADataSourceImpl">
		<property name="driverClassName">
			"org.apache.derby.jdbc.ClientDriver"
		</property>
		<property name="URL">
			"jdbc:derby://localhost:1527/testdb;create=true"
		</property>
	</component>
	
	
	-->
	
<!--
	<component name="xaDataSource"
		class="org.seasar.extension.dbcp.impl.XADataSourceImpl">
		<property name="driverClassName">
			"org.hsqldb.jdbcDriver"
		</property>
		<property name="URL">
			"jdbc:hsqldb:hsql://localhost/"
		</property>
		<property name="user">"sa"</property>
		<property name="password">""</property>

		<initMethod>#out.println(
			"jdbc:hsqldb:file:"
				+ @org.seasar.framework.util.ResourceUtil@getBuildDir(@org.seasar.codegen.impl.DatabaseImportCodeDataTest@class).getCanonicalPath()
				+ "/data/demo")
		</initMethod>

	</component>
-->
	
<!--
	<component name="xaDataSource"
		class="org.seasar.extension.dbcp.impl.XADataSourceImpl">
		<property name="driverClassName">
			"org.apache.derby.jdbc.EmbeddedDriver"
		</property>
		<property name="URL">
			"jdbc:derby:testdb;create=true"
		</property>
	</component>
-->
	<component name="connectionPool"
		class="org.seasar.extension.dbcp.impl.ConnectionPoolImpl">
		<property name="timeout">600</property>
		<property name="maxPoolSize">10</property>
		<destroyMethod name="close"/>
	</component>
	<component name="dataSource"
		class="org.seasar.extension.dbcp.impl.DataSourceImpl"/>
	
	<!-- WebLogic
	<component name="initialContext" class="javax.naming.InitialContext"/>
	<component name="transactionManager"
	    class="org.seasar.extension.j2ee.JndiTransactionManager">
	    <arg>initialContext</arg>
	    <arg>"javax.transaction.TransactionManager"</arg>
	</component>
	<component
	    class="org.seasar.extension.j2ee.JndiDataSource">
	    <arg>initialContext</arg>
	    <arg>"jndiName"</arg>
	</component>
	-->
	
	<!-- WebSphere 4
	<component name="initialContext" class="javax.naming.InitialContext"/>
	<component name="transactionManager"
		class="org.seasar.extension.j2ee.SingletonTransactionManager">
		<arg>"com.ibm.ejs.jts.jta.JTSXA"</arg>
		<arg>"getTransactionManager"</arg>
	</component>
	<component
		class="org.seasar.extension.j2ee.JndiDataSource">
		<arg>initialContext</arg>
		<arg>"jndiName"</arg>
	</component>
	-->
	
	<!-- WebSphere 5
	<component name="initialContext" class="javax.naming.InitialContext"/>
	<component name="transactionManager"
		class="org.seasar.extension.j2ee.SingletonTransactionManager">
		<arg>"com.ibm.ejs.jts.jta.TransactionManagerFactory"</arg>
		<arg>"getTransactionManager"</arg>
	</component>
	<component
		class="org.seasar.extension.j2ee.JndiDataSource">
		<arg>initialContext</arg>
		<arg>"jndiName"</arg>
	</component>
	-->
	
	<!-- JBoss
	<component name="initialContext" class="javax.naming.InitialContext"/>
	<component name="transactionManager"
		class="org.seasar.extension.j2ee.JndiTransactionManager">
		<arg>initialContext</arg>
		<arg>"java:/TransactionManager"</arg>
	</component>
	<component
		class="org.seasar.extension.j2ee.JndiDataSource">
		<arg>initialContext</arg>
		<arg>"jndiName"</arg>
	</component>
	-->
	
</components>