There is native query written by developer
String sql = "Select * from TERP_META where id=" + id + " and type='KCH' ORDER BY ID ASC";
return entityManagerMaster.createNativeQuery(sql, TerpStatus.class).getResultList();
We can also write Named query for thist.
Now for simple query shall we use Native or Named? I understand that Native shall be used for complex queries and for simple Named is used but don't know the reason.
Can anyone clarify what is technically difference in execution of both to choose best among both?