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
|