-->
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: Nhibernate isnert...
PostPosted: Wed Aug 06, 2008 9:53 am 
Newbie

Joined: Tue Jul 08, 2008 4:53 pm
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

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

Hi i am struggling with nhibernate insert statement..
can any one please give syntax to the nhibernate insert statement..

i am writing all my queries in a mapping file.. for time being ..

Even i can write it in code behind .. either of the syntax are fine for me..

Aslesh


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 06, 2008 10:57 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
You mean custom insert statements for an entity ? Have a look at:

http://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html/querysql.html#querysql-cud

If this doesn't help, post what you already have and what's not working there.

_________________
--Wolfgang


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 06, 2008 11:13 am 
Newbie

Joined: Tue Jul 08, 2008 4:53 pm
Posts: 2
I have that documentation.. but i was not able to understand where do i have to call and how to call..it ?

_________________
Thanks&Regards
Aslesh


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 06, 2008 11:31 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
You don't call it explicitly. Hibernate uses these statements if it has to persist a new entity:

Code:
Customer cust = new Customer();
cust.Name = ...
cust.FirstName = ...
....

session.BeginTransaction();
session.Save(cust);
session.Commit();   // Hibernate issues the insert statement at writes the object to the DB

_________________
--Wolfgang


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.