mysql - How to implement a DAO in JAVA to query the result sets of two entity classes at the same time
阿神
阿神 2017-05-18 10:45:21
0
1
811

How to implement a DAO in JAVA to query the result sets of two entity classes at the same time
1. The picture is as follows:


Union all query of two tables. Now only one entity set result can be returned. The entity set of the other table is filtered. How to return two entities at the same time? set.


2. There are three pieces of data in the database query: as shown in the figure

3. The current one can only return one solution set, please ask for guidance.

阿神
阿神

闭关修行中......

reply all(1)
仅有的幸福

Baidu

hibernate 中createQuery与createSQLQuery两者区别是:
前者用的hql语句进行查询,后者可以用sql语句查询
前者以hibernate生成的Bean为对象装入list返回
后者则是以对象数组进行存储

It seems that you need to use the createSQLQuery method. The return result is an array, not a list

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template