Guest User

Untitled

a guest
Feb 22nd, 2012
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  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.
Add Comment
Please, Sign In to add comment