File tree Expand file tree Collapse file tree 4 files changed +81
-0
lines changed Expand file tree Collapse file tree 4 files changed +81
-0
lines changed Original file line number Diff line number Diff line change 1+ # ###########################################################################
2+ # Hibernate Tools, Tooling for your Hibernate Projects #
3+ # #
4+ # Copyright 2004-2025 Red Hat, Inc. #
5+ # #
6+ # Licensed under the Apache License, Version 2.0 (the "License"); #
7+ # you may not use this file except in compliance with the License. #
8+ # You may obtain a copy of the License at #
9+ # #
10+ # http://www.apache.org/licenses/LICENSE-2.0 #
11+ # #
12+ # Unless required by applicable law or agreed to in writing, software #
13+ # distributed under the License is distributed on an "AS IS" basis, #
14+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
15+ # See the License for the specific language governing permissions and #
16+ # limitations under the License. #
17+ # ###########################################################################
18+ generated-sources
Original file line number Diff line number Diff line change 1+ <!--
2+ ~ Copyright 2004 - 2025 Red Hat, Inc.
3+ ~
4+ ~ Licensed under the Apache License, Version 2.0 (the "License");
5+ ~ you may not use this file except in compliance with the License.
6+ ~ You may obtain a copy of the License at
7+ ~
8+ ~ http://www.apache.org/licenses/LICENSE-2.0
9+ ~
10+ ~ Unless required by applicable law or agreed to in writing, software
11+ ~ distributed under the License is distributed on an "AS IS" basis,
12+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ ~ See the License for the specific language governing permissions and
14+ ~ limitations under the License.
15+ -->
16+ To run this example:
17+ - Have [ Apache Ant] ( https://ant.apache.org ) installed
18+ - Issue ` ant ` from a command-line window
Original file line number Diff line number Diff line change 1+ <!--
2+ ~ Copyright 2004 - 2025 Red Hat, Inc.
3+ ~
4+ ~ Licensed under the Apache License, Version 2.0 (the "License");
5+ ~ you may not use this file except in compliance with the License.
6+ ~ You may obtain a copy of the License at
7+ ~
8+ ~ http://www.apache.org/licenses/LICENSE-2.0
9+ ~
10+ ~ Unless required by applicable law or agreed to in writing, software
11+ ~ distributed under the License is distributed on an "AS IS" basis,
12+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ ~ See the License for the specific language governing permissions and
14+ ~ limitations under the License.
15+ -->
16+ <project name =" native-cfg" default =" reveng" >
17+
18+ <!-- Include the 'hibernatetool' task definition from the file '../common/included.xml' -->
19+ <include file =" ../common/included.xml" />
20+
21+ <target name =" clean" >
22+ <!-- Delete the folder 'generated-sources' if it exists -->
23+ <delete dir =" generated-sources" />
24+ </target >
25+
26+ <target name =" reveng" depends =" clean" >
27+ <hibernatetool destdir =" generated-sources" >
28+ <!-- Native configuration reading properties from '../common/hibernate.properties' -->
29+ <configuration propertyfile =" ../common/hibernate.properties" />
30+ <!-- Transform the 'hibernate.properties' file in 'hibernate.cfg.xml' -->
31+ <hbm2cfgxml />
32+ </hibernatetool >
33+ </target >
34+
35+ </project >
36+
Original file line number Diff line number Diff line change @@ -186,6 +186,15 @@ elements is to be found in section 2 further down this guide.
186186Hibernate Tools is very versatile and can be used to generate a wide variety of artefacts. This generation
187187is performed when adding one or more exporter elements to the ` <hibernatetool> ` task.
188188
189+ ``` xml
190+ <target name =" reveng" >
191+ <hibernatetool destdir =" ..." >
192+ <jdbcconfiguration propertyfile =" hibernate.properties" />
193+ <hbm2java />
194+ </hibernatetool >
195+ </target >
196+ ```
197+
189198The most used exporters are
190199* ` <hbm2java> ` for the generation of Java files
191200* ` <hbmtemplate> ` when generating artefacts based on custom templates
You can’t perform that action at this time.
0 commit comments