> > >The generated classes now have a dependency upon > commons-lang, which > > >doesn't bother me in the slightest, but other people may > have another > > >opinion. > > > > Yes - me for one :) I would like to keep the generated code > as simple > > as possible :) (but at the same time I like to broaden the usage of > > commons-lang) > > > > Thus, I'll suggest (and also make a patch as I get to it) that it > > should be optional to have the dependency on commons-lang. > Optimal, we > > could generate a bare-boned toString method based on the > > attributes/properties know to the metadata. > > > > On second thought - I'll add an option to either have the > codegenerator use the methods provided by commons-lang OR not > do anything at all :) > > The "do nothing" option is for those who want to have either > a base or their own custom subclass for their classes (nicely > supported by my metaattribute patch :)
Yes, I'm happy to agree to that in the case of toString(). However, in the case of equals() and hashCode() for composite-id classes, we actually *need* them. (Its required by Hibernate.) I would much prefer the commons-lang dependency to trying to fully generate the equals() and hashCode() methods (thats actually *more* complicated). And after this discussion, I'm leaning toward the view that generated entity classes should implement equals() had hashCode() consistent with identifier equality, though I suppose that should also be optional. > > And what about the meta-attribute thingy ? (it is not that a big > > codechange compared to the recent commit :) (i'm just > pushing here :) > > How about adding the meta-attribute thingy as an extra X-mas > gift - it would instantly make me happy, and the > codegenerator so much more better :) After this discussion I'm finally satisfied that this is a requirement if CodeGenerator is to become really useful. So I'm perfectly happy to allow things like: <class name="Foo" ... > <meta attribute="description">JavaDoc comment for Foo</meta> <meta attribute="base-class">AbstractPersistent</meta> <meta attribute="generated-class">FooBase</meta> ..... <property name="bar" type="serializable" ....> <meta attribute="description"> JavaDoc comment for getBar() </meta> <meta attribute="java-type">java.lang.Object</meta> </property> ..... </class> The only bad thing about <meta> is its not very well self-documenting. So we will really need a page of documentation about CodeGenerator. Particularly since it is now maturing quite nicely :) ********** CAUTION - Disclaimer ********** This message may contain privileged and confidential information. If you are not the intended recipient of this message (or responsible for delivery of the message to such person) you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. If you have received this message in error, you should destroy it and kindly notify the sender by reply e-mail. Please advise immediately if you or your employer do not consent to Internet e-mail for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Expert Information Services Pty Ltd ("The Company") shall be understood as neither given nor endorsed by it. The Company advises that this e-mail and any attached files should be scanned to detect viruses. The Company accepts no liability for loss or damage (whether caused by negligence or not) resulting from the use of any attached files. **EIS******** End of Disclaimer ********** ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel