-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Views for fetching, tables for inserts/updates
PostPosted: Tue Dec 12, 2006 10:16 pm 
Newbie

Joined: Wed Dec 06, 2006 11:36 am
Posts: 8
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.