A problem with seam-gen and mysql? Simple types instead of @ManyToOne or @OneToMany realtions. If you are using Eclipse in this article you may find the reason of this problem.
Simple fill all possible fields of the Seam application wizard
Here is a very simple mysql script that I have used to create database:
DROP DATABASE IF EXISTS smartGwt;
CREATE DATABASE smartGwt DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_polish_ci;
USE smartGwt;
GRANT ALL ON smartGwt TO `smartGwt` IDENTIFIED BY 'smartGwt';
GRANT ALL PRIVILEGES ON *.* TO 'smartGwt'@'%' IDENTIFIED BY 'smartGwt' WITH GRANT OPTION;
FLUSH PRIVILEGES;
CREATE TABLE invoice (
id BIGINT AUTO_INCREMENT NOT NULL ,
contractor_name VARCHAR( 100 ) NOT NULL,
issue_date DATE NOT NULL,
contractor_tax_number BIGINT NOT NULL,
CONSTRAINT pk_ids PRIMARY KEY(id)) engine=InnoDB;
CREATE TABLE invoic_epostion (
id BIGINT AUTO_INCREMENT NOT NULL ,
invoice_id BIGINT NOT NULL,
name VARCHAR( 100 ) NOT NULL,
price DOUBLE NOT NULL,
CONSTRAINT PK_ID PRIMARY KEY ( id ),
CONSTRAINT fk_invoice FOREIGN KEY ( invoice_id ) REFERENCES invoice ( id )) engine=InnoDB;UWAGA! Nie wszystkie przeglądarki obsługują kompresję! Te przeglądarki, z którym kompatybilne jest GWT, obsługują kompresję.
I used Jboss Seam Tools to generate entities, as I usually do. I was really surprised that generated entities did not have relations. Instead of getInvoice() method in InvoicePosition I had getInvoiceId(). It was quite iritating, because I have used this tool a lot and never encounterd any problems.
After a while it turned out that I left important fields empty. I thought that all necessary data are available if you just have database URL, which you provide in "New Connection Profile" dialog.

It turnes out that fields "database schema name" and "database catalog name" should have proper data, in my case it was "smartGwt" in both cases.
Other possible reason - Some other DB engine than InnoDB in use
Seam-gen while generating entities from mysql uses "innoDB" engine, which allows JDBC driver to obtain information about whole schema including all constraints.
Sources
Here you can fins some extra information about this topic
http://seamframework.org/12697.lace
http://dev.mysql.com/doc/refman/5.0/en/innodb-storage-engine.html




