When I am leaving any property lets say empId unmapped to any column of the table then I am getting SQLGrammarException exception.
I am using annotations intead of a Employee.hbm.xml file.
But I have read that you can leave some properties of yuor class unmapped.While saving the object of that class,only the mapped properties will be saved and the unmapped properties will be present in the insert query.
I think you can mark them with the @Transient annotation and this will make them ignored.
If you are still having problems though then post your entity code.
I love this place!
Mohammad Nabeeluddin Ansari
Joined: Apr 20, 2011
I will try it tomorrow morning.
Another problem which I was having is:
I am using mysql DB.I have a table employee with empno as the PK.Now i set it to auto increment using an annotation.
Now when I tried to save an object of Employee class then the system gives an exception: The DB could not generate incremented value.
But when I changed the column in the employee table to auto increment then it worked properly.
I my question is not understandable to you then let me know,I will try to further explain it.