8000 HBX-2983: Create 5 Minute Tutorial for Ant · hibernate/hibernate-tools@2a3c0a7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2a3c0a7

Browse files
committed
HBX-2983: Create 5 Minute Tutorial for Ant
- Add the complete example under 'docs/examples/5-minute-tutorial' Signed-off-by: Koen Aers <koen.aers@gmail.com>
1 parent c42e58e commit 2a3c0a7

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
generated-sources
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
To run this example:
2+
- Have [Apache Ant](https://ant.apache.org) installed
3+
- Have [H2 Sakila database](https://github.com/koentsje/sakila-h2) running
4+
- Issue `ant reveng` from a command-line window
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<project xmlns:ivy="antlib:org.apache.ivy.ant">
2+
3+
<property name="hibernate-tools.version" value="7.0.0.CR1"/>
4+
<property name="jdbc-driver.org" value="com.h2database"/>
5+
<property name="jdbc-driver.module" value="h2"/>
6+
<property name="jdbc-driver.version" value="2.3.232"/>
7+
8+
<ivy:cachepath
9+
organisation="org.hibernate.tool"
10+
module="hibernate-tools-ant"
11+
revision="${hibernate-tools.version}"
12+
pathid="hibernate-tools.path"
13+
inline="true"/>
14+
<ivy:cachepath
15+
organisation="${jdbc-driver.org}"
16+
module="${jdbc-driver.module}"
17+
revision="${jdbc-driver.version}"
18+
pathid="jdbc-driver.path"
19+
inline="true"/>
20+
21+
<path id="classpath">
22+
<path refid="hibernate-tools.path"/>
23+
<path refid="jdbc-driver.path"/>
24+
</path>
25+
26+
<taskdef
27+
name="hibernatetool"
28+
classname="org.hibernate.tool.ant.HibernateToolTask"
29+
classpathref="classpath" />
30+
31+
<target name="reveng">
32+
<hibernatetool destdir="generated-sources">
33+
<jdbcconfiguration propertyfile="hibernate.properties" />
34+
<hbm2java/>
35+
</hibernatetool>
36+
</target>
37+
38+
</project>
39+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
hibernate.connection.driver_class=org.h2.Driver
2+
hibernate.connection.url=jdbc:h2:tcp://localhost/./sakila
3+
hibernate.connection.username=sa
4+
hibernate.default_catalog=SAKILA
5+
hibernate.default_schema=PUBLIC
6+

0 commit comments

Comments
 (0)
0