I have a sleep request, as shown below:
String mySql = "SELECT S.col1, S.col2, T.col3, T.col4, T.col5 FROM myTable S, myTable1 T WHERE S.id = :id and S.id = T.id"; Query myQuery = this.em.createQuery(mySql); myQuery.setParameter("id", "123"); List<Object> result = myQuery.getResultList();
The table myTable and myTable1 are entity classes.
myTO is a simple java class with properties col1, col2, col3, col4, col5.
The result of the above query should be matched with the properties of myTO.
How to iterate columns as a result? Or am I getting the result wrong?
source share