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 {
...
}
But how do i do reverse engineering using JBoss Tools for multiple schemas?
exactly the same way.
When you use Seam Generate entities a Hibernate Tools code generation launch is generated which you can copy to allow you to edit it and set whatever custom setup you want, including a .reveng.xml.
Max Rydahl Andersen
Hi, Can integration tests be run now on a Maven 2 template based project? Regards Mark Joe
This is a really good read for me. Must admit that you are one of the best bloggers I have ever read. Thanks for posting this informative article.
Mole Removal
Your blog page is excellent. Thank you truly for sharing a huge amount of powerful ideas. I will bookmark your web site and will be without a doubt coming back. Again, I appreciate all your work and supplying much priceless info for the many people.chin strap for snoring
Interesting post and thanks for sharing. Some things in here I have not thought about before.Thanks for making such a cool post which is really very well written. Will be referring a lot of friends about this. Keep blogging jiu jitsu gear
Interesting post and thanks for sharing. Some things in here I have not thought about before. Thanks for making such a cool post which is really very well written.mole removal