change query for hibernate