In my web application (a simple app), I created a hibernate mapping file, customer.hbm.xml. I mapped Customer.java to CUSTOMER table. Customer.java is serializable and has a constructor.
A user can fill in their personal details (Name, Address etc) and that information should persist in CUSTOMER TABLE. Each Customer is uniquely identified by CUSTOMER_ID (populated from a Oracle Sequence).
I am using a HibernateDaoSupport based Dao layer. From Dao, when I acquire and call session.save(customer), it does not do anything. No error, nothing. The only query it generates is for fetching nextval from CUST_SEQ. It does not generate any query for inserting customer data into the CUSTOMER table.
I changed the table name to a random name (anything but ""). It did not throw any error like "Table does not exists". But any change to the name of Sequence is detected and error is thrown.
When I remove the table name (keep it empty) and say <class = "Customer" table = "">, it does notice that there is no table name specified.
Am I missing any key factor here in the configuration? Is this a known problem? Any input in this regard will be appreciated. I am using Hibernate 3.6 along with Spring 3+. Regards.
|