title: Query to delete all rows in a table hibernate
body: <p>I am trying to delete all rows in table 'user_role' with hibernate query. But every time i am getting errors. Can someone please help me with it.</p>
  
  <p><strong>DaoImpl</strong></p>
  
  <pre><code>@Override
  public void deleteAll() {
      session.getCurrentSession().delete(/*delete all query*/);
  }
  </code></pre>
  
  <p><strong>model class</strong></p>
  
  <pre><code>@Entity @Table(name="user_role")
  public class User_Role {
  
      @Id @Column @GeneratedValue(strategy=GenerationType.AUTO)
      private int id;
  
      @Column(name="role_name")
      private String name;
  
      //setter and getter 
  }
  </code></pre>