-->
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: problem in insert record
PostPosted: Thu Sep 13, 2007 1:26 am 
Newbie

Joined: Thu Sep 13, 2007 1:01 am
Posts: 1
Location: aa
Hi To All
I am new to Hibernate.
I am trying to insert a record in simple order table. i am using hibenate.cfg.xml and order.hbm.xml and insertorder.java.here i am giving some of the code for the reference.
order.hbm.xml
<id name="orderID" column="ORDERID">
<generator class="native"/></id>
<property name="orderNumber"/>
<property name="partNumber"/>
<property name="quantity"/>

and in insertorder.java

sf = new Configuration().configure().buildSessionFactory();
session = sf.openSession();
Transaction t = session.beginTransaction();
Order order= new Order();
order.setOrderNumber("SUMA1111");
order.setPartNumber("numberAir Bag");
order.setQuantity(150);
session.save(order);
t.commit();
session.close();

when run and check the output in console

SystemOut O OrderID: 0 OrderNumberSUMA1111 part number Air Bag quantity150
SystemOut O Hibernate: insert into ORDER(orderNumber, partNumber, quantity, ORDERDETAILID) values (?, ?, ?, default)

but record not inserted in database. when i checked in database trace, the insert qurey not executed. i am not getting where is the problem?????????
can any body help me out..thanks in advance

_________________
aaa


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.