<!--
~ Hibernate Tools, Tooling for your Hibernate Projects
~
~ Copyright 2016-2020 Red Hat, Inc.
~
~ Licensed under the GNU Lesser General Public License (LGPL),
~ version 2.1 or later (the "License").
~ You may not use this file except in compliance with the License.
~ You may read the licence in the 'lgpl.txt' file in the root folder of
~ project or obtain a copy at
~
~ http://www.gnu.org/licenses/lgpl-2.1.html
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" basis,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
[![Hibernate](https://static.jboss.org/hibernate/images/hibernate_200x150.png)](https://tools.hibernate.org)
# Hibernate Tools Maven Plugin
## Overview
This [Maven](http://maven.apache.org/) plugin brings the power of the [Hibernate Tools API](../orm) to your Maven build. If you are looking for a quick tutorial on the use of the Hibernate Tools Maven plugin, we can refer you to the [5 minute tutorial](docs/5-minute-tutorial.md).
The plugin contains 3 goals. Issuing `mvn help:describe -Dplugin=org.hibernate.tool:hibernate-tools-maven` at the command line will give you an overview:
```
foo@bar ~ % mvn help:describe -Dplugin=org.hibernate.tool:hibernate-tools-maven
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-help-plugin:3.2.0:describe (default-cli) @ standalone-pom ---
[INFO] org.hibernate.tool:hibernate-tools-maven:6.0.0-SNAPSHOT
Name: Hibernate Tools Maven Plugin
Description: Maven plugin to provide hibernate-tools reverse engineering and
code/schema generation abilities.
Group Id: org.hibernate.tool
Artifact Id: hibernate-tools-maven
Version: 6.0.0-SNAPSHOT
Goal Prefix: hibernate-tools
This plugin has 3 goals:
hibernate-tools:hbm2ddl
Description: Mojo to generate DDL Scripts from an existing database.
See
https://docs.jboss.org/tools/latest/en/hibernatetools/html_single/#d0e4651
hibernate-tools:hbm2java
Description: Mojo to generate Java JPA Entities from an existing database.
See:
https://docs.jboss.org/tools/latest/en/hibernatetools/html_single/#d0e4821
hibernate-tools:help
Description: Display help information on hibernate-tools-maven.
Call mvn hibernate-tools:help -Ddetail=true -Dgoal=<goal-name> to display
parameter details.
For more information, run 'mvn help:describe [...] -Ddetail'
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.489 s
[INFO] Finished at: 2020-03-10T10:19:38+01:00
[INFO] ------------------------------------------------------------------------
foo@bar ~ %
```
## hibernate-tools-maven:hbm2ddl
The `hbm2ddl` goal allows you to start from a Hibernate metamodel and create DDL and possibly execute it against a database.
You can issue `mvn org.hibernate.tool:hibernate-tools-maven:help -Ddetail=true -Dgoal=hbm2ddl` at the command line to get an overview of all the possible paremeters:
```
foo@bar ~ % mvn org.hibernate.tool:hibernate-tools-maven:help -Ddetail=true -Dgoal=hbm2ddl
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- hibernate-tools-maven:6.0.0-SNAPSHOT:help (default-cli) @ standalone-pom ---
[INFO] Hibernate Tools Maven Plugin 6.0.0-SNAPSHOT
Maven plugin to provide hibernate-tools reverse engineering and code/schema
generation abilities.
hibernate-tools:hbm2ddl
Mojo to generate DDL Scripts from an existing database.
See https://docs.jboss.org/tools/latest/en/hibernatetools/html_single/#d0e4651
Available parameters:
createCollectionForForeignKey (Default: true)
If true, a collection will be mapped for each foreignkey.
createManyToOneForForeignKey (Default: true)
If true, a many-to-one association will be created for each foreignkey
found.
delimiter (Default: ;)
Set the end of statement delimiter.
detectManyToMany (Default: true)
If true, tables which are pure many-to-many link tables will be mapped as
such. A pure many-to-many table is one which primary-key contains exactly
two foreign-keys pointing to other entity tables and has no other columns.
detectOneToOne (Default: true)
If true, a one-to-one association will be created for each foreignkey
found.
detectOptimisticLock (Default: true)
If true, columns named VERSION or TIMESTAMP with appropriate types will be
mapped with the appropriate optimistic locking corresponding to <version>
or <timestamp>.
format (Default: true)
Should we format the sql strings?
haltOnError (Default: true)
Should we stop once an error occurs?
outputDirectory (Default: ${project.build.directory}/generated-resources/)
The directory into which the DDLs will be generated.
outputFileName (Default: schema.ddl)
The default filename of the generated DDL script.
packageName
The default package name to use when mappings for classes are created.
propertyFile (Default:
${project.basedir}/src/main/hibernate/hibernate.properties)
The name of a property file, e.g. hibernate.properties.
revengFile
The name of a property file, e.g. hibernate.properties.
revengStrategy
The class name of the reverse engineering strategy to use. Extend the
DefaultReverseEngineeringStrategy and override the corresponding methods,
e.g. to adapt the generate class names or to provide custom type mappings.
schemaExportAction (Default: CREATE)
The DDLs statements to create.
- NONE: None - duh :P.
- CREATE (default): Create only.
- DROP: Drop only.
- BOTH: Drop and then create.
targetTypes (Default: SCRIPT)
The type of output to produce.
- DATABASE: Export to the database.
- SCRIPT (default): Write to a script file.
- STDOUT: Write to System.out.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.718 s
[INFO] Finished at: 2020-03-10T10:23:55+01:00
[INFO] ------------------------------------------------------------------------
foo@bar ~ %
```
## hibernate-tools-maven:hbm2java
The `hbm2java` goal allows you to start from an existing database and generate JPA entities that will map to this database. A lot of possible options allow you to control the generation output.
You can issue `mvn org.hibernate.tool:hibernate-tools-maven:help -Ddetail=true -Dgoal=hbm2java` at the command line to get an overview of all the possible paremeters:
```
foo@bar ~ % mvn org.hibernate.tool:hibernate-tools-maven:help -Ddetail=true -Dgoal=hbm2java
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- hibernate-tools-maven:6.0.0-SNAPSHOT:help (default-cli) @ standalone-pom ---
[INFO] Hibernate Tools Maven Plugin 6.0.0-SNAPSHOT
Maven plugin to provide hibernate-tools reverse engineering and code/schema
generation abilities.
hibernate-tools:hbm2java
Mojo to generate Java JPA Entities from an existing database
没有合适的资源?快使用搜索试试~ 我知道了~
HibernateCore的代码生成、逆向工程、ant任务和更多工具___下载.zip
共963个文件
java:466个
sql:204个
xml:156个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 135 浏览量
2023-04-19
00:42:17
上传
评论
收藏 1.07MB ZIP 举报
温馨提示
HibernateCore的代码生成、逆向工程、ant任务和更多工具___下载.zip
资源推荐
资源详情
资源评论
收起资源包目录
HibernateCore的代码生成、逆向工程、ant任务和更多工具___下载.zip (963个子文件)
doc-style.css 2KB
test.mv.db 28KB
test.mv.db 24KB
test.mv.db 24KB
daohome.ftl 12KB
entity.ftl 12KB
daohome.ftl 11KB
table.ftl 6KB
persistentclass.hbm.ftl 4KB
id.hbm.ftl 3KB
entitygraph.dot.ftl 2KB
tablegraph.dot.ftl 2KB
sql-query.hbm.ftl 1KB
PojoConstructors.ftl 1KB
map.hbm.ftl 1KB
property.hbm.ftl 1KB
debug.ftl 1KB
summary.ftl 1KB
summary.ftl 1KB
package-summary.ftl 1KB
idbag.hbm.ftl 1KB
common.ftl 1KB
list.hbm.ftl 922B
array.hbm.ftl 918B
index.ftl 900B
many-to-one.hbm.ftl 896B
index.ftl 889B
hibernate-mapping.hbm.ftl 867B
schema-summary.ftl 864B
primitive-array.hbm.ftl 822B
perPackageEntity-list.ftl 809B
PojoEqualsHashcode.ftl 788B
PojoPropertyAccessors.ftl 780B
package-list.ftl 773B
schema-list.ftl 756B
bag.hbm.ftl 733B
set.hbm.ftl 732B
schema-table-list.ftl 731B
any.hbm.ftl 729B
Ejb3PropertyGetAnnotation.ftl 705B
one-to-one.hbm.ftl 645B
allEntity-list.ftl 632B
table-list.ftl 617B
query.hbm.ftl 610B
generalhbm.hbm.ftl 585B
PojoInterfacePropertyAccessors.ftl 558B
Ejb3TypeDeclaration.ftl 556B
collection-tableattr.hbm.ftl 551B
generic-class.ftl 545B
generic-class.ftl 545B
PojoToString.ftl 536B
Pojo.ftl 508B
Pojo.ftl 508B
PojoFields.ftl 469B
PojoFields.ftl 466B
nested-composite-element.hbm.ftl 442B
many-to-any-element.hbm.ftl 409B
composite-element.hbm.ftl 408B
component.hbm.ftl 388B
dynamic-component.hbm.ftl 365B
many-to-many-element.hbm.ftl 358B
filter-def.hbm.ftl 346B
timestamp.hbm.ftl 304B
freemarker.ftl 302B
version.hbm.ftl 292B
test.ftl 292B
PojoTypeDeclaration.ftl 279B
column.hbm.ftl 273B
meta.hbm.ftl 266B
one-to-many-element.hbm.ftl 246B
key.hbm.ftl 244B
properties.hbm.ftl 241B
generic-test.ftl 238B
Pojo.ftl 221B
generic-exception.ftl 206B
import.hbm.ftl 201B
PojoExtraClassCode.ftl 193B
element-element.hbm.ftl 158B
pkcolumn.hbm.ftl 76B
text-report.ftl 51B
Pojo.ftl 46B
GetPropertyAnnotation.ftl 44B
generic-content.ftl 31B
freeinc.ftl 7B
hibernate_logo.gif 2KB
inherit.gif 71B
.gitignore 73B
verify.groovy 651B
verify.groovy 207B
verify.groovy 205B
verify.groovy 197B
index.html 307B
PersistentClassWrapperFactoryTest.java 52KB
EntityPOJOClass.java 34KB
BasicPOJOClass.java 29KB
TestCase.java 28KB
OracleMetaDataDialect.java 26KB
TestCase.java 25KB
OverrideRepository.java 25KB
TestCase.java 24KB
共 963 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功