Hibernate Configuration and Mapping Resources


This chapter is composed of :

  1. Introduction
  2. Hibernate Configuration and Mapping Resources
    1. Source Folder
    2. Package
    3. Schema
    4. Options
      1. Multiple Files
      2. XDoclet Support
    5. Finish
  3. Templates

1. Introduction

The purpose of this chapter is to show how to generate Hibernate Configuration and Mapping Resources.

This wizard will generate :

This wizard needs to use a target Java Project.

 

2. Hibernate Configuration and Mapping Resources

To start the Hibernate Configuration and Mapping Resources wizard, select :

File->New->Other->Database->Hibernate Configuration and Mapping Resources

or

Select an object in the Package Explorer View or the Navigator View then right-click and select :

New->Other->Database->Hibernate Configuration and Mapping Resources

The selection is contextual.

This means that if you select an existing Database Object:

 

 

The wizard will be opened with a selected Database Connection if applicable.

 

Otherwise:

 

 

The wizard will be opened without any selected Database Connection.


 

2.1. Source Folder

 

 

Type in the Java Source Folder text field the targeted Java Source Folder.

The Java Source Folder should exist.

Otherwise use the Browse button :

 

 

Select the appropriate Java Source Folder.

 

2.2. Package

 

 

Type in the Package text field the targeted Java Package.

Otherwise use the Browse button :

 

 

Select the appropriate targeted Java Package.

 

2.3. Schema

 

 

Use the Browse button :

 

 

The Database Schema selector displays the available Database Schema in your current Project.

Select the appropriate Database Schema.

 

2.4. Options

You can set various Hibernate options.

 

2.4.1. Multiple Files

Each Database Table will see its Hibernate Mapping definition in its own file.

 

 

Otherwise only one Hibernate Mapping file will be generated.

 

 

 

2.4.2. XDoclet Support

If checked, Hibernate Mapping file will contain XDoclet attributes.

 

 

Otherwise, no XDoclet attributes will be generated.

 

 

2.5. Finish

The Hibernate Configuration and Mapping generation process will be performed in the targeted Java Source Folder and its designated target package.

 

 

Detailed information will be displayed in the DatabaseConsole window.

 

 

3. Templates

This wizard is Template based.

Below your Plugin Templates or MyTemplates you should see the following Velocity files:

Torque/Hibernate/configuration.vm

Torque/Hibernate/mapping.vm

 

 

These templates are Velocity based and use the EclipseDatabase API.

This API is not yet published.