title: Which is faster :Criteria query or native query?
body: <p>I have a table Admin which might contain 1000 or even more records. Now, I am confused on which query to use so that the performance while fetching the entire data is not compromised. </p>
  
  <p>I've tried fetching the data using native query and criteria query but only for small amount of data. I also studied the relevant questions but it didn't satisfy my question completely. </p>
  
  <p><a href="https://stackoverflow.com/questions/6575462/which-sql-query-is-faster-and-why">Which SQL query is faster and why?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/16179175/named-query-native-query-or-criteria-api">Named Query, Native Query or Criteria API</a></p>
  
  <p><a href="https://stackoverflow.com/questions/12248863/native-query-is-faster-than-hql-criteria-query-in-hibernate">Native query is faster than HQL/Criteria query in Hibernate</a></p>
  
  <p><a href="https://stackoverflow.com/questions/12187358/which-is-better-performance-in-hibernate-native-query-or-hql">Which is better performance in hibernate native query or HQL</a></p>
  
  <p>My entity class somehow looks like: </p>
  
  <pre><code>@Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Long id;
  
  private String username;
  
  private String emailAddress;
  
  private String password;
  
  private Character status;
  </code></pre>
  
  <p>Using Criteria Query:</p>
  
  <pre><code> public List&lt;Admin&gt; fetchAdmin() {
  
      CriteriaBuilder builder = entityManager.getCriteriaBuilder();
      CriteriaQuery&lt;Admin&gt; criteria = builder.createQuery(Admin.class);
  
      List&lt;Admin&gt; adminList = entityManager.createQuery(criteria).getResultList();
  
      return adminList;
  }
  </code></pre>
  
  <p>Using Native query:</p>
  
  <pre><code>@Query(value = "SELECT * FROM admin", nativeQuery = true)
  List&lt;Admin&gt; fetchAllAdmins();
  </code></pre>
  
  <p>I expect, selection of a query that would fetch big data.</p>