Hi,
I am trying to run a query which returns a record based on the user_id(column name) of the table being equal to a value. I am saying:
public void deleteUserdetails (int user_id)
{
String userID = String.valueOf(user_id);
try {
...........
Transaction transaction = session.beginTransaction();
Query query = session.createQuery("from User usr where usr.id = :userID");
query.setString("userID",userID);
session.delete(query);
transaction.commit();
Util.closeSession();
}
}
13:49:19,858 DEBUG SessionImpl:528 - opened session
13:49:19,865 DEBUG JDBCTransaction:37 - begin
13:49:19,872 DEBUG JDBCTransaction:41 - current autocommit status:false
13:49:19,908 DEBUG SessionImpl:1072 - deleting a transient instance
|