//code in java file String hql="delete from CONTACT c where ID=6"; Query query=session.createQuery(hql); //error when executing above code CONTACT is not mapped [delete from CONTACT] int i=query.executeUpdate();
What is the name of mapping (model) class file? Is it CONTACT.java?
In this you are writing table name in query. You have to write the name of java class file in query.
You query should:
String hql="delete from Contact c where ID=6"; Query query=session.createQuery(hql);
Where Contact is the name of java class file.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.