All,
is there any easy way to tell hibernate to fetch all data using a view, but somehow tell it what tables to update/insert?
for example:
all my data needs to come from, say, v_SomethingOrOther
v_SomethingOrOther contains about 10 fields from table Something. The other 5 fields are either derived/calculated fields or join fields from ref tables...stuff I don't want to update.
These 15 fields all map to one Bean, the SomethingOrOther bean. (too late to change this...it's already got its tentacles into everything)
So....
I can define the class as having table="V_SomethingOrOther", but then I get not updateable errors, obviously.
I can define it as a table and join it to the view with a <JOIN> tag, but it's incredibly slow for reasons I don't understand since the resultant sql is fast.
So... should I just write the class as a view and then override the sql-insert and sql-update mappings? is that the preferred way of doing this when one has to do this sort of thing?
Thanks for any advice... it's extremely appreciated!
I'm coming from years of straight, fast, no-frills JDBC and I've got people breathing down my neck because i'm trying out hibernate instead of doing it the way we've been doing it for years.
|