Top > SAStrutsあれこれ > MySQLからS2JDBC-GenでEntityを自動生成(コマンドライン編)

  0
  1
  2
  3
  4
  5
  6
  7
  8
  9
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container 2.4//EN" 
	"http://www.seasar.org/dtd/components24.dtd">
<components>
	<component class="org.seasar.framework.convention.impl.NamingConventionImpl">
		<initMethod name="addRootPackageName">
			<arg>""</arg>
		</initMethod>
	</component>
	<component class="org.seasar.framework.convention.impl.PersistenceConventionImpl"/>
</components>
  0
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container 2.4//EN"
	"http://www.seasar.org/dtd/components24.dtd">
<components>
	<include path="jdbc.dicon"/>
	<include path="s2jdbc-internal.dicon"/>
	<component name="jdbcManager" class="org.seasar.extension.jdbc.manager.JdbcManagerImpl">
		<property name="maxRows">0</property>
		<property name="fetchSize">0</property>
		<property name="queryTimeout">0</property>
		<property name="dialect">mysqlDialect</property>
	</component>
</components>
  0
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container 2.4//EN"
	"http://www.seasar.org/dtd/components24.dtd">
<components namespace="jdbc">
	<include path="jta.dicon"/>
	<component name="xaDataSource"
		class="org.seasar.extension.dbcp.impl.XADataSourceImpl">
		<property name="driverClassName">
			"com.mysql.jdbc.Driver"
		</property>
		<property name="URL">
			"jdbc:mysql://localhost:3306/sastruts"
		</property>
		<property name="user">"sastruts"</property>
		<property name="password">"sastruts"</property>
	</component>
 
	<component name="connectionPool"
		class="org.seasar.extension.dbcp.impl.ConnectionPoolImpl">
		<property name="timeout">600</property>
		<property name="maxPoolSize">10</property>
		<property name="allowLocalTx">true</property>
		<destroyMethod name="close"/>
	</component>
 
	<component name="DataSource"
		class="org.seasar.extension.dbcp.impl.DataSourceImpl"
	/>
</components>
  0
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
<?xml version="1.0"?>
<project name="sample" default="gen-entity" basedir=".">
    <path id="classpath">
        <fileset dir="lib"/>
    </path>
    <taskdef resource="s2jdbc-gen-task.properties" classpathref="classpath"/>
    <target name="gen-entity">
        <gen-entity
            rootpackagename="mysql"
            classpathref="classpath"
            classpath="conf"
            overwrite="true"
        />
    </target>
</project>
  0
  1
  2
  3
  4
  5
  6
  7
C:\usr\local\s2jdbc>ant -f s2jdbc-gen-build.xml gen-entity
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.6.
0_07\lib\tools.jar
Buildfile: s2jdbc-gen-build.xml
 
gen-entity:
 
BUILD SUCCESSFUL
Total time: 3 seconds
* 結
  0
  1
src/main/mysql/entity/Address.java
src/main/mysql/entity/Department.java
src/main/mysql/entity/Employee.java

Everything is expanded.Everything is shortened.
  1
  2
  3
  4
  5
  6
  7
 
 
 
 
 
 
 
    /** addressIdプロパティ */
    @Column(precision = 10, nullable = true, unique = false)
    public Integer addressId;
 
    /** address関連プロパティ */
    @ManyToOne
    public Address address;

  0
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
─────────────────────────────────────
C:\usr\local\s2jdbc
s2jdbc                                        < Dir > 
├ conf                                       < Dir > 
│ ├ convention.dicon                            442  2008/09/03 14:37:57
│ ├ jdbc.dicon                                1,306  2008/09/03 10:29:28
│ └ s2jdbc.dicon                                542  2008/09/03 13:52:31
├ lib                                        < Dir > 
│ ├ ant-1.7.0.jar                         1,289,806  2008/09/02 17:58:48
│ ├ aopalliance-1.0.jar                       4,467  2008/06/26 23:53:12
│ ├ commons-logging-1.1.jar                  52,915  2008/06/26 23:54:08
│ ├ freemarker-2.3.13.jar                   870,292  2008/09/02 17:58:44
│ ├ geronimo-annotation_1.0_spec-1.0.jar     12,085  2008/06/26 23:53:50
│ ├ geronimo-ejb_3.0_spec-1.0.jar            31,752  2008/06/26 23:54:14
│ ├ geronimo-interceptor_3.0_spec-1.0.jar     8,954  2008/06/26 23:54:14
│ ├ geronimo-jpa_3.0_spec-1.0.jar            52,555  2008/06/26 23:54:00
│ ├ geronimo-jta_1.1_spec-1.0.jar            14,972  2008/06/26 23:54:04
│ ├ geronimo-jta_1.1_spec-1.0-tsr.jar         7,329  2008/06/26 23:54:08
│ ├ hsqldb-1.8.0.1.jar                      625,096  2008/06/26 23:54:02
│ ├ javassist-3.4.ga.jar                    471,005  2008/06/26 23:54:12
│ ├ junit-3.8.2.jar                         120,640  2008/06/26 23:54:12
│ ├ log4j-1.2.13.jar                        358,180  2008/06/26 23:54:10
│ ├ mysql-connector-java-5.1.6-bin.jar      703,265  2008/03/05 17:27:00
│ ├ ognl-2.6.9-patch-20070908.jar           166,995  2008/06/26 23:54:00
│ ├ poi-3.0-FINAL.jar                     1,767,938  2008/06/26 23:53:56
│ ├ s2-extension-2.4.28.jar                 385,584  2008/08/26 16:50:36
│ ├ s2-framework-2.4.28.jar                 654,191  2008/08/26 17:34:36
│ ├ s2jdbc-gen-0.9.0.jar                    366,917  2008/09/02 19:41:58
│ ├ s2-tiger-2.4.28.jar                     569,177  2008/08/26 17:34:36
│ └ servlet-api.jar                          97,703  2008/06/26 23:54:08
├ src                                        < Dir > 
│ └ main                                    < Dir > 
│    └ java                                 < Dir > 
│       └ mysql                             < Dir > 
│          └ entity                         < Dir > 
│             ├ Address.java                    743  2008/09/04 09:03:35
│             ├ Department.java                 752  2008/09/04 09:03:35
│             └ Employee.java                 1,300  2008/09/04 09:03:35
└ s2jdbc-gen-build.xml                           447  2008/09/04 08:53:57
─────────────────────────────────────

リロード   新規 編集 凍結解除 差分 添付 複製 名前変更   ホーム 一覧 単語検索 最終更新 バックアップ リンク元   ヘルプ   最終更新のRSS
Last-modified: 2012-08-08 (水) 23:26:05 (2925d)