Hibernate, return custom object with Criteria or HQL -


there way return custom object criteria query or hql query?

for example, have class myclass constructor myclass(int id, string text), want incapsulate queries result in class:

"select new myclass(e.id, e.name) example e" 

myclass not entity, simple custom class.

thank all.

in hql queries works showed (class name should qualified, i.e. package).

although, far understand, it's not supported in hibernate criteria api, supported in jpa 2.0 criteria api criteriabuilder.construct().


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -