-
1. Re: seam-gen.reveng.xml sequence entry not applied
luckm May 19, 2009 8:16 PM (in response to luckm)I see that when entities are generated by
./seam generate
called in terminal, everything works fine. But if I use Jboss ToolsSeam Generate Entities
from project's context menu, then reveng.xml file is totally ignored. Am I missing something and Jboss Tools have it's own reverse engineering descriptor, or it's not proper behavior of IDE? -
2. Re: seam-gen.reveng.xml sequence entry not applied
atamhank Oct 27, 2009 10:28 PM (in response to luckm)I have the same problem.
The file seam.reveng.xml (in the hibernatetools directory) appears to make no difference in seam gen.
here is the entry in the seam.reveng.xml
<table name="test_table" schema="public"> <primary-key> <generator class="sequence"> <param name="sequence">test_table_id1_seq</param> </generator> <key-column name="id"/> </primary-key> </table>
here is the line in the java file created for the table and id does not seem to take notice of the sequence
@Id @Column(name = "id", unique = true, nullable = false) public int getId() { return this.id;
Tried several permutation and combinations but still having issues. running seam generate from dos terminal does not help (I am running all commands from command line)
Any one having any suggestions?
thanks,
Aaditi -
3. Re: seam-gen.reveng.xml sequence entry not applied
atamhank Oct 28, 2009 1:48 AM (in response to luckm)This is what worked for autogeneration:
After some experimentation this code worked for me. putting in here for others who may not have to struggle...Put this code (after changing the table names from test table to your table) in the seam.reveng.xml file
<table name="test_table" schema ="public"> <primary-key> <!-- setting up a specific id generator for a table --> <generator class="sequence"> <param name="table">test_table_id1_seq</param> </generator> <key-column name="id"/> </primary-key> </table>
-
4. Re: seam-gen.reveng.xml sequence entry not applied
atamhank Oct 28, 2009 1:52 AM (in response to luckm)This is how it looks like in the entity java file:
@SequenceGenerator(name = "generator") @Id @GeneratedValue(strategy = SEQUENCE, generator = "generator") @Column(name = "id", unique = true, nullable = false) public Integer getId() { return this.id; }
Thanks and happy coding.
Aaditi