My Java bean has a childCount property. This property does not appear in the database column . Instead, it should be calculated using the database using the COUNT() function, which acts when combining my Java bean and its children. It would be even better if this property could be calculated on demand / "lazy", but this is not necessary.
In the worst case scenario, I can set this bean property using the HQL or API criteria, but I would prefer not to.
Hibernate @Formula may help, but I could hardly find any documentation.
Any help is greatly appreciated. Thank.
java orm hibernate jpa hibernate-mapping
Francois Jun 06 '10 at 23:14 2010-06-06 23:14
source share