Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GRAILS-2761 added script to create hibernate.cfg.xml files
- Loading branch information
1 parent
26751fb
commit 283b65d
Showing
3 changed files
with
29 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
If [GORM (Grails Object Relational Mapping)|guide:GORM] is not flexible enough for your liking you can alternatively map your domain class using Hibernate. To do this create a @hibernate.cfg.xml@ file in the @grails-app/conf/hibernate@ directory of your project and the corresponding HBM mapping xml files for your domain classes. | ||
If [GORM|guide:GORM] (Grails Object Relational Mapping) is not flexible enough for your liking you can alternatively write some or all of your domain classes in Java or re-use an existing domain model that has been mapped using Hibernate. To do this create a @hibernate.cfg.xml@ file in the @grails-app/conf/hibernate@ directory of your project and add the corresponding HBM mapping xml files for your domain classes. You can do this manually or by running the [create-hibernate-cfg-xml|commandLine] script. | ||
|
||
{note} | ||
For more info on how to do this read the [documentation on mapping|http://www.hibernate.org/] on the Hibernate Website | ||
For more info on how to do this read the [documentation on mapping|http://docs.jboss.org/hibernate/core/3.3/reference/en/html/mapping.html] at the Hibernate Website | ||
{note} | ||
|
||
This will allow you to map Grails domain classes onto a wider range of legacy systems and be more flexible in the creation of your database schema. | ||
This will allow you to map Grails domain classes onto a wider range of legacy systems and have more flexibility in the creation of your database schema. | ||
|
||
Grails also allows you to write your domain model in Java or re-use an existing domain model that has been mapped using Hibernate. All you have to do is place the necessary @hibernate.cfg.xml@ file and corresponding mappings files in the @grails-app/conf/hibernate@ directory. | ||
|
||
Additionally, the good news is you will still be able to call all of the dynamic persistent and query methods allowed in [GORM|guide:GORM]! | ||
Additionally, you will still be able to call all of the dynamic persistent and query methods allowed in [GORM|guide:GORM]! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
h1. create-hibernate-cfg-xml | ||
|
||
h2. Purpose | ||
|
||
The @create-hibernate-cfg-xml@ command will create a hibernate.cfg.xml file for custom Hibernate mappings. | ||
|
||
h2. Examples | ||
|
||
bc. | ||
grails create-hibernate-cfg-xml | ||
|
||
h2. Description | ||
|
||
Creates a @hibernate.cfg.xml@ file in the @grails-app/conf/hibernate@ directory. You can add @<mapping>@ elements there to reference annotated Java domain classes, classes mapped by hbm.xml files, or hbm.xml files containing @<database-object>@ elements defining custom DDL that's not supported by GORM. | ||
|
||
Usage: | ||
{code:java} | ||
grails create-hibernate-cfg-xml | ||
{code} | ||
|
||
Fired Events: | ||
|
||
* @CreatedFile@ - When the file is created | ||
|