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: How to insert data into views
PostPosted: Wed Apr 02, 2008 9:29 am 
Newbie

Joined: Sun Jan 27, 2008 4:26 pm
Posts: 18
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
1.2.1

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


How to insert values into views in database.Our application using views.how to create map files for views,how to insert values into views.Could you please tell me on this.If you provide me any code it would be great.I want to know is it possible through Nhibernate can we insert values into Views.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 02, 2008 9:49 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
As long as the view allows insert/update, you can use it with hibernate as any other table.

_________________
--Wolfgang


Top
 Profile  
 
 Post subject: how to create mapping files for views
PostPosted: Wed Apr 02, 2008 11:54 am 
Newbie

Joined: Sun Jan 27, 2008 4:26 pm
Posts: 18
How to create mapping files for views to insert data into views.Could you please provide me an example or code it would be great.i could not find any information on book regarding views.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 03, 2008 1:58 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
What kind of scenario exactly do you have in mind. If you can do a plain insert/update statement against your view, you can use it with hibernate exactly like a normal table.
If you want to select from a view and make insert/updates directly to the underlying table(s) surpassing the view, you'll either have to work with triggers on the view, custom sql or stored procedures.

Have a look at that post, there are some links to documentation

http://forum.hibernate.org/viewtopic.php?t=984362&highlight=trigger+instead

_________________
--Wolfgang


Top
 Profile  
 
 Post subject: insert data into views
PostPosted: Thu Apr 03, 2008 5:35 am 
Newbie

Joined: Sun Jan 27, 2008 4:26 pm
Posts: 18
Our database contains already views which contains select statement 2 or more tables.so we need to insert data into those views and the records will be inserted into views as well as underlying tables also.is we are tables in nhibernate we will specify in .hbm.xml file we specify table="table name" ,if we use views what will specify there and and how to create mapping files.for the views which were already existing in the table.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 03, 2008 5:38 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
table="name of view" and the mapping files are written as if you would write them for a table.

_________________
--Wolfgang


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.