I have follow code in my java DAO class.

Query query = session.createQuery("select new Question(q.qid, q.qtype) from Question q where q.qlang=:lang ");
  1. Does using new object type in a hibernate query affect performance? In What way is it affected?
  2. Over all code execution (be it the above java code or the sql query it gets converted into and then the assembly of the sql result in a Question object), does it increase or decrease the overall performance of the application?
  • This question would probably be better suited for the Stack Overflow community: "Stack Overflow is a question and answer site for professional and enthusiast programmers." While the question initially does contains database elements, Hibernate (and JPA) is a 3-rd party database abstraction layer that is not directly related to MySQL. Hence the recommendation to post in Stack Overflow. – John K. N. Jun 18 '18 at 6:08
  • @hot2use done.. – sofs1 Jun 18 '18 at 6:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.