[ http://jira.andromda.org/browse/HIB-13?page=comments#action_12163 ] Jens Vagts commented on HIB-13: -------------------------------
The current implementation of the formula tag does not work for hibernate3: the "name" attribute does not exist, the formula tag is a data only tag (lok at the DTD)!! The hibernate2 version (with property attribute works). The formula is a very nice option of hibernate. It's the only way to define selects within selects in hibernate! With hibernate 3.0 the lazy attribute (property tag) is also supported for formulas. So the subquery is only executed if this "virtual" property is read (e.g. in a hql). I want to define a "childCount" property by a formula, which has to be "lazy" since it's time consuming. The main advantage of formulas against other "handcoded" queries in my opinion, is the possibilty to replace the formulas with "real" properties/data at any time, without a change in any code or query! So if my childCount lacks of performance I "only" have to maintain a new data field in my database. I'm currently working on a patch and will give it to you if you want it?! > Formula Fields > -------------- > > Key: HIB-13 > URL: http://jira.andromda.org/browse/HIB-13 > Project: Hibernate Cartridge > Type: New Feature > Reporter: Carlos Cuenca > Assignee: Carlos Cuenca > Priority: Minor > > Add the ability to define formula fields. ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl