-
1. Re: seam-gen overwritting
andygibson.contact.andygibson.net Jul 11, 2008 8:23 PM (in response to alderion)I think people only really use the Seam-Gen stuff to get started, I don't think it is meant as a continuous two way tool between the database and the model/view.
Cheers,
Andy Gibson
-
2. Re: seam-gen overwritting
luxspes Jul 11, 2008 9:44 PM (in response to alderion)Hi!
Andy Gibson wrote on Jul 11, 2008 20:23:
I think people only really use the Seam-Gen stuff to get started, I don't think it is meant as a continuous two way tool between the database and the model/view.
Cheers,
Andy GibsonWell, in my team we are trying to reshape it in to a continuous two way tool between the database and the model/view, but it is harder job than I though because the documentation on how to enhance JbossTools is... well, lets just say that
is not
.Regards,
-
3. Re: seam-gen overwritting
taccart.thierry.accart.name Jul 11, 2008 10:47 PM (in response to alderion)Hi
in fact, the document is there, but another there than where you're looking for ;-)
The reverse engineering and POJO code generation are documented on hibernate web site.
If you have a look in seam-gen sub folders, you'll find all freemaker templates (.flt files) used.They could give you ideas for implementations of your needs.
For instance, you could modify the flt template files for entities generation to add custom toString() ala commonclipse generated ones, or template of xxxxEdit.xhtml pages to use RichFaces listShuttle in many to many / manyToOne / oneToMany relations...Having a permanent generation of code, IMHO, is relevant that your DB has not been designed correctly. Of course, your needs cab change and your schema can change, but most of time it affects one or two tables.
In this case, the simplest solution is to run seam-gen on a distinct project and run a compare between seamgen generated project and developers project.You should consider also this hibernate article on Equals and HashCode before going for a constant generation of code.
I wish this will help :-)
Rgds
-
4. Re: seam-gen overwritting
luxspes Jul 11, 2008 11:16 PM (in response to alderion)Hi!
thierry accart wrote on Jul 11, 2008 22:47:
Hi
in fact, the document is there, but another there than where you're looking for ;-)
The reverse engineering and POJO code generation are documented on hibernate web site.
If you have a look in seam-gen sub folders, you'll find all freemaker templates (.flt files) used.Been there, read that, done that, it is good for the basics, but it is insufficient just try to find the answer to this question in there.
They could give you ideas for implementations of your needs.
For instance, you could modify the flt template files for entities generation to add custom toString() ala commonclipse generated ones, or template of xxxxEdit.xhtml pages to use RichFaces listShuttle in many to many / manyToOne / oneToMany relations...Again been there, done that. :-)
Having a permanent generation of code, IMHO, is relevant that your DB has not been designed correctly. Of course, your needs cab change and your schema can change, but most of time it affects one or two tables.Sadly, in my experience, requirement changes from customers affect a lot more than two tables...
In this case, the simplest solution is to run seam-gen on a distinct project and run a compare between seamgen generated project and developers project.Or, if I could find an answer to that question, generation could be easily controlled using annotations... Or you could use Ant.. but I really prefer Eclipse (yes, I think I may be crazy)
You should consider also this hibernate article on Equals and HashCode before going for a constant generation of code.
I wish this will help :-)
RgdsRead that too... but I can not see a direct relationship between that and code generation
Regards,