有一些可能产生类似结果(小册子假定你希望有一个<条码>List<NewClass>,其结果是,新地图集才有财产复制和名称):
(1) 您从“+hibernateClass.getClass ()上选取新的地图册(同上,名称)
2) 您为新地图集创建了新的地图册,用于同一数据库表,但仅具有地契和名称,然后由“+新目录”代码>查询。
3) You just do createQuery("from " + hibernateClass.getClass())
and you don t case about the superfluous values which where loaded. The extra amount of time for loading all columns compared to loading only the necessary columns is insignificant. If you prefer, you can nevertheless create a class or interface NewClass and for HibernateClass extends/implements NewClass
.
Me personally I prefer 3), but that s up to your taste.