-
1. Re: DefaultReverseEngineeringStrategy
maxandersen Mar 2, 2006 10:19 AM (in response to eracer)beta4 does not have the need for you to specify the reverse engineerings strategy.
if you want to change the generator strategy for *all* table/classes then the simplest thing is to implement a custom strategy that return "increment" in the getTableIdentifierStrategyName.
Your last question is a bit ambigious ? Are you asking how to generate code from existing mapping files ? Simply *don't* select to reverse engineer then it will take the current mappings and use for its code generation.
/max -
2. Re: DefaultReverseEngineeringStrategy
eracer Mar 2, 2006 10:32 AM (in response to eracer)Hi Max,
Thanks for your prompt reply.
I have changed the generators type in the mapping files by hand, then run the code generation again, but with "reverse engineering from JDBC connection" unchecked. I thought this as what you meant.
I get an error saying that it does find the xx.hbm.xml files, and they are there.
Also, the package name does not look to be taken into account when producing the Java files.
Etienne -
3. Re: DefaultReverseEngineeringStrategy
eracer Mar 2, 2006 10:33 AM (in response to eracer)I expect the id to be removed from the full and minimal constructors.
I can remove them by hand as well. -
4. Re: DefaultReverseEngineeringStrategy
maxandersen Mar 2, 2006 10:47 AM (in response to eracer)are the mapping file available through the classpath of the console configuration ?
-
5. Re: DefaultReverseEngineeringStrategy
eracer Mar 2, 2006 11:20 AM (in response to eracer)Brilliant, this is it. I confirm that the id are not in the constructors anymore if the generator is set to 'increment'.
I also confirm that the package does not work for me. The JBoss Hibernate tool creates the java files in the default package, and if I move them to another package then I get an error from Hibernate at run time for classes created for composite keys, saying he does not find the hbm file for them. Of course they are no such files.
Etienne
I will t -
6. Re: DefaultReverseEngineeringStrategy
maxandersen Mar 2, 2006 12:36 PM (in response to eracer)...and your revengstrategy is set to blank ?
...and if you have a custom revengstrategy it implements DelegateReverseEngineringStrategy so it does not "swallow" the table to package/classname calls ? -
7. Re: DefaultReverseEngineeringStrategy
eracer Mar 2, 2006 12:47 PM (in response to eracer)
>> ...and your revengstrategy is set to blank ?
To do this, I have to check the reverse engineering checkbox, and I get an ClassNotFoundException (mentioned in the link given in my first message).
So I read that I need to use this value org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy, but the package is not generated.
>> ...and if you have a custom revengstrategy it implements DelegateReverseEngineringStrategy so it does not "swallow" the table to package/classname calls ?
I don't know how to do that. Probably I would need to dip into your source code for a few days before being efficient. Is this what you mean ? -
8. Re: DefaultReverseEngineeringStrategy
maxandersen Mar 2, 2006 12:50 PM (in response to eracer)
you need to upgrade to beta4 which does not require this reveng strategy.
(and the part of how to write a revengstrategy is documented in the docs) -
9. Re: DefaultReverseEngineeringStrategy
eracer Mar 2, 2006 1:33 PM (in response to eracer)Max,
It's all ok with beta 4. The package is generated properly, the mapping file is correct regarding the package and it runs smoothly.
I will re-generate the Java files after changing manually the generator in the mapping files, this is absolutely fine.
Thanks very much for your support, especially that the code is right, I did not figure out that this functionality was so much on the edge and beta 3 was contained in the bundle.
I think I will become a big fan of JBoss, and look forward to using the Seam product in a few months.
Etienne