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.
By default, the generation mode is set to Reverse engineer from database. The reverse engineering from a database could be described in four steps:
The wizard gets in database, extracts the tables and their connections
On basis of this metainfomation the Entity classes are generated into
org.domain.project.entity
package
For the entities from step 2 the classes EntityList and EntityHome are generated
into org.domain.project.session
package
The xhtml pages are generated.
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.