java - Is there a way for selecting extra fields - not to be saved - in hibernate? -


i want execute following sql in hibernate:

select emp.*, utilspkg.getemployeedisplayname(emp.id) employee emp; 

so far good... thing - need fetched entity - can update employee. of course pl\sql function not updateable nor part of actual table...

how can generate such entity in hibernate - field calculated , not updateable?

many thanks!

using @formula annotation, explained in hibernate documentation:

sometimes, want database computation rather in jvm, might create kind of virtual column. can use sql fragment (aka formula) instead of mapping property column. kind of property read (its value calculated formula fragment).


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -