You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
By default, Hibernate Tools (used by both seam-gen and JBoss Tools) focuses in on a single schema. You may have provided a schema when you setup the project or Hibernate Tools is simply using the default schema. To get Hibernate Tools to look at more than one schema, you need to customize the reverse engineering configuration.
If you are using seam-gen from the commmandline, first create a project using seam create-project. Then, populate the project file resources/seam-gen.reveng.xml with the following contents:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-reverse-engineering SYSTEM "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" > <hibernate-reverse-engineering> <schema-selection match-schema="SCHEMA1"/> <schema-selection match-schema="SCHEMA2"/> </hibernate-reverse-engineering>
If the database supports foreign keys that cross schemas, Hibernate Tools should create the appropriate associations in the entity classes. Hibernate Tools will also put the name of the schema in the @Table annotation on the entity class:
@Entity @Table(name = "TABLE1", schema = "SCHEMA1") public class Table1 implements java.io.Serializable { ... }