-->
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.  [ 6 posts ] 
Author Message
 Post subject: reading from view and insert/update to table?possible?
PostPosted: Tue Sep 21, 2004 2:15 pm 
Newbie

Joined: Fri Aug 27, 2004 5:36 pm
Posts: 16
Location: Pittsburgh
2.1.5, 4.8.2004


Is it possible to populate a mapped object from a view but insert/update to the table.

The view and table would have same columns and type and the mapping same for both view and the table.

Any help or directions would be helpful.

Thanks
Vish


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 21, 2004 6:40 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
No thats not possible (easily), at least not in Hibernate2 - Hibernate3 you could just define your own SQL for CRUD operations. Can't you just make the view updateable?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 22, 2004 8:45 am 
Newbie

Joined: Fri Aug 27, 2004 5:36 pm
Posts: 16
Location: Pittsburgh
Thanks for replying Michael.

I can't .. the view is the union of two different tables. One table just consist of ids and foreingn keys to other tables. The second table is composed of names doesn't have any foreign keys.

So the view resolves the ids (foreign keys) to names and unions with the second table.

So if I make view updateble, it may add records in both the tables.

If its not possible, is there any hack I can use ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 22, 2004 8:46 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Search for "INSTEAD OF" triggers.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 22, 2004 9:05 am 
Newbie

Joined: Fri Aug 27, 2004 5:36 pm
Posts: 16
Location: Pittsburgh
search in the forums or at database level ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 22, 2004 9:10 am 
Newbie

Joined: Fri Aug 27, 2004 5:36 pm
Posts: 16
Location: Pittsburgh
I did some reading on that .. i guess my database guys are not going to like that :(

Is there any other possible way before i make 2 mapping one for view (select only) and other for the table ( that gets insert/update)


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

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.