Hi all,
Thank you all, for your posts.
I agree with you all, concerning equals/hashcode.
Now, about toString, I've been struggling with this for years, looking for a way to, automatically, generate a toString method in all POJOs, with hibernate tools. I know that I can use the meta attribute use-in-tostring in hbm.xml... but how can I do this when
not using hbm.xml files at all???
The reason why I don't use hbm.xml files is that, when doing reverse engineering, hbm.xml files are always overwrited, so the meta attribute use-in-tostring are cleaned. And when in development stage, you have to execute the reverse engineering tool, against hundreds of tables, many times, because the schema changes many times, too, so it's very painful having to edit hbm.xml files manually to insert use-in-tostring over and over again... and having a backup folder and merge hbm.xml files manually is not a good solution either...
max wrote:
nebenzal wrote:
In addition in my configuration where I don't use hbm.xml files where can I configure which properties should take place in toString/equals?
if you are doing reverse engineering need to set the properties in reveng.xml or in a custom reverseengineeringstrateg.
Max, can I specify in reveng.xml what colums/properties should take place in toString? Is this possible? I can't find in the docs.... Or, can I do this in reverse engineering strategy?
The only way I can do this is modifying the freemarker templates, but I would prefer an out-of-the-box way...
Thank you again!
Rui Baeta