-->
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.  [ 4 posts ] 
Author Message
 Post subject: Swap Table for Database view: Possible?
PostPosted: Mon Mar 28, 2005 9:53 am 
Newbie

Joined: Mon Feb 16, 2004 11:28 pm
Posts: 16
Hibernate version: 2.1.6

Is it possible to treat a database view in oracle as if it's a table to hibernate? Basically I want to create a view for a complex legacy database(read only) and use it in HQL queries. Is this possible to just specify the columns that are present in the view and in the class element of the mapping specify the view name where table name goes?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 28, 2005 10:10 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes a view is accessed in jdbc the same way as a table - no diff for hibernate.

why dont you just try it ? ,)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 28, 2005 10:27 am 
Newbie

Joined: Mon Feb 16, 2004 11:28 pm
Posts: 16
I have tried it but Im running into some errors. I was wondering if it was even possible before looking into it further :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 28, 2005 3:53 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
you have to make id - choose all view's columns if you doesn't know id for view

regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.