Author: gk
Date: Tue Oct 20 14:38:29 2020
New Revision: 1882697
URL: http://svn.apache.org/viewvc?rev=1882697&view=rev
Log:
- update old code examples
Modified:
db/torque/trunk/torque-site/src/site/xdoc/documentation/tutorial/orm/step1-ant.xml
db/torque/trunk/torque-site/src/site/xdoc/documentation/tutorial/orm/step1-maven.xml
Modified:
db/torque/trunk/torque-site/src/site/xdoc/documentation/tutorial/orm/step1-ant.xml
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-site/src/site/xdoc/documentation/tutorial/orm/step1-ant.xml?rev=1882697&r1=1882696&r2=1882697&view=diff
==============================================================================
---
db/torque/trunk/torque-site/src/site/xdoc/documentation/tutorial/orm/step1-ant.xml
(original)
+++
db/torque/trunk/torque-site/src/site/xdoc/documentation/tutorial/orm/step1-ant.xml
Tue Oct 20 14:38:29 2020
@@ -63,6 +63,10 @@
<?xml version="1.0"?>
<project name="Torque" default="main" basedir=".">
+ <property name="build.properties" value="build.properties"/>
+ <property name="torque.contextProperties" value="${build.properties}"/>
+ <property file="${torque.contextProperties}"/>
+
<path id="ant-classpath">
<fileset dir="lib/ant">
<include name="*.jar"/>
@@ -70,10 +74,12 @@
</path>
<path id="runtime-classpath">
- <fileset dir="lib/runtime">
- <include name="*.jar"/>
+ <fileset dir="libs">
+ <include name="**/*.jar"/>
</fileset>
</path>
+
+ <pathconvert property="classpathRuntime" refid="runtime-classpath"/>
<taskdef
name="torque-generator"
@@ -100,7 +106,7 @@
<target name="compile">
<mkdir dir="target/classes"/>
- <javac debug="on" source="1.5" destdir="target/classes">
+ <javac debug="on" source="1.8" target="1.8" destdir="target/classes"
includeAntRuntime="false" classpathref="runtime-classpath" fork="yes">
<src path="src/main/java"/>
<src path="src/main/generated-java"/>
<src path="target/generated-sources"/>
@@ -113,10 +119,10 @@
<target name="execute-sql">
<sql classpathref="ant-classpath"
- driver="org.gjt.mm.mysql.Driver"
+ driver="${torque.database.driver}"
url="jdbc:mysql://localhost:3306/bookstore"
- userid="root"
- password="password"
+ userid="${torque.database.user}"
+ password="${torque.database.password}"
onerror="continue"
src="target/generated-sql/bookstore-schema.sql"/>
</target>
@@ -141,7 +147,7 @@
dbUser="${torque.database.user}"
packaging="classpath"
configPackage="org.apache.torque.templates.jdbc2schema"
- defaultOutputDir="${torque.schema.dir}"
+ defaultOutputDir="target/generated-schema"
>
</torque-jdbc2schema>
</target>
Modified:
db/torque/trunk/torque-site/src/site/xdoc/documentation/tutorial/orm/step1-maven.xml
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-site/src/site/xdoc/documentation/tutorial/orm/step1-maven.xml?rev=1882697&r1=1882696&r2=1882697&view=diff
==============================================================================
---
db/torque/trunk/torque-site/src/site/xdoc/documentation/tutorial/orm/step1-maven.xml
(original)
+++
db/torque/trunk/torque-site/src/site/xdoc/documentation/tutorial/orm/step1-maven.xml
Tue Oct 20 14:38:29 2020
@@ -78,21 +78,22 @@
<dependency>
<artifactId>torque-runtime</artifactId>
<groupId>org.apache.torque</groupId>
- <version>4.0</version>
+ <version>5.0</version>
</dependency>
<!-- db driver -->
<dependency>
<artifactId>mysql-connector-java</artifactId>
<groupId>mysql</groupId>
- <version>5.0.4</version>
+ <version>8.0.21</version>
</dependency>
- <!-- Logging via log4j -->
+ <!-- Logging via log4j2 -->
<dependency>
- <artifactId>log4j</artifactId>
- <groupId>log4j</groupId>
- <version>1.2.16</version>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <version>2.13.3</version>
+ <scope>runtime</scope>
</dependency>
</dependencies>
@@ -102,7 +103,7 @@
<plugin>
<groupId>org.apache.torque</groupId>
<artifactId>torque-maven-plugin</artifactId>
- <version>4.0</version>
+ <version>5.0</version>
<executions>
<execution>
<id>generate-sources</id>
@@ -142,7 +143,7 @@
<dependency>
<groupId>org.apache.torque</groupId>
<artifactId>torque-templates</artifactId>
- <version>4.0</version>
+ <version>5.0</version>
</dependency>
</dependencies>
</plugin>
@@ -152,7 +153,7 @@
<artifactId>sql-maven-plugin</artifactId>
<version>1.4</version>
<configuration>
- <driver>org.gjt.mm.mysql.Driver</driver>
+ <driver>com.mysql.cj.jdbc.Driver</driver>
<url>jdbc:mysql://localhost:3306/bookstore</url>
<username>root</username>
<password>password</password>
@@ -169,18 +170,18 @@
<dependency>
<artifactId>mysql-connector-java</artifactId>
<groupId>mysql</groupId>
- <version>5.0.4</version>
+ <version>8.0.21</version>
</dependency>
</dependencies>
</plugin>
<plugin>
- <!-- setting java version to 1.5 -->
+ <!-- setting java version to 1.8 -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.8</source>
+ <target>1.8</target>
</configuration>
</plugin>
@@ -194,6 +195,10 @@
<goals>
<goal>copy-dependencies</goal>
</goals>
+ <configuration>
+ <outputDirectory>libs</outputDirectory>
+ <includeScope>runtime</includeScope>
+ </configuration>
</execution>
</executions>
</plugin>
@@ -220,7 +225,7 @@
</li>
<li>
The configuration of the java compiler in the plugins section
- to allow java 1.5 code
+ to allow java 1.8 code
(needed when you compile the generated java sources)
</li>
<li>
@@ -230,7 +235,7 @@
</ul>
<p>
Configuring Maven 2 correctly is very important.
- This enablee the Torque generator to generate all of
+ This enables the Torque generator to generate all of
the required sources and SQL for your specific
database. If you experience problems later in this
tutorial, it would be wise to double-check this file.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]