Guest User

Untitled

a guest
Apr 26th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. big_messy_sql = "select t1.f1 as somealias, t2.f2 as somehthingelse from obj1 t1, obj2 t2 where crazy_conditions....";
  2.  
  3. Query query = entityManager.createNativeQuery(big_messy_sql);
  4.  
  5.  
  6. List<Object> results = query.getResultList();
  7.  
  8. for (Object oRow : results) {
  9. Object[] r = (Object[]) oRow;
  10. // Do more crazy stuff
  11.  
  12. }
  13.  
  14. 15:39:02,089 INFO [Version] Hibernate Annotations 3.4.0.GA
  15. 15:39:02,167 INFO [Environment] Hibernate 3.3.2.GA
  16. 15:39:02,183 INFO [Environment] hibernate.properties not found
  17. 15:39:02,198 INFO [Environment] Bytecode provider name : javassist
  18. 15:39:02,198 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
  19. 15:39:02,495 INFO [Version] Hibernate Commons Annotations 3.1.0.GA
  20. 15:39:02,511 INFO [Version] Hibernate EntityManager 3.4.0.GA
  21.  
  22. 12:06:09,031 INFO [BigDecimalType] could not read column value from result set: id; S0022: Invalid column name 'id'.
Add Comment
Please, Sign In to add comment