JBoss.orgCommunity Documentation

Chapter 7. Seam Generate Entities

Generate Entities is available by navigating to FileNewOtherSeamSeam Generate Entities

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 the console configuration in the Hibernate guides). The created console configuration is based on the connection profile set on the Section 2.6, “Configure Seam Facet Settings” 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 (WindowShow viewOtherHibernateHibernate 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 Chapter 13, Generate a CRUD Database Application chapter in order to see how the Generate Seam Entities wizard can be used.