SHARE
TWEET

Untitled

a guest Feb 22nd, 2012 10 Never
  1. Sometimes, you want the Database to do some computation for you rather than in the JVM, you might also create some kind of virtual column. You can use a SQL fragment (aka formula) instead of mapping a property into a column. This kind of property is read only (its value is calculated by your formula fragment).
  2.  
  3. @Formula("obj_length * obj_height * obj_width")
  4. public long getObjectVolume()
  5.  
  6. The SQL fragment can be as complex as you want and even include subselects.
RAW Paste Data
Top