Create new JBoss Tools Documentation Jira issue

This will launch the Jboss Tools Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.orgCommunity Documentation

Chapter 7. Seam Generate Entities

The main purpose of this chapter is to tell you about Seam Generate Entities.

Generate Entities is available directly from Eclipse using Hibernate Tools plugin for the standard seam-gen generation.

The wizard generates a set of CRUD Seam components and web pages based on existing tables in a database or on existing entities in your application.

Generate Seam Entities Wizard

Figure 7.1. Generate Seam Entities Wizard


By default, the generation mode is set to Reverse engineer from database. The reverse engineering from a database could be described in four steps:

  1. The wizard gets in database, extracts the tables and their connections

  2. On basis of this metainfomation the Entity classes are generated into org.domain.project.entity package

  3. For the entities from step 2 the classes EntityList and EntityHome are generated into org.domain.project.session package

  4. The xhtml pages are generated.

Note:

The entities are generated from a database based on the console configuration that is created automatically during a Seam project creation. (Read more about console configuration). The created console configuration is based on the connection profile set on the Seam Facets wizard page while creating a project. Configured connection profile settings are hold in the generated hibernate-console.properties. To change the connection profile, double-click the console configuration. It could be found in the Hibernate Configurations view (Window > Show view > Other > Hibernate > Hibernate Configurations or just switch to the Hibernate perspective).

Checking the Use existing entities mode the wizard executes only 3 and 4 steps. It generates missing classes and xhtml pages.

Read the Generate a CRUD Database Application chapter in order to see how the Generate Seam Entities wizard can be used.