Hey,
I can't get the Pk class when i use aliasToBean I get Null in the main when I use hagaf.getHagafPK() My Code: public List<Hagaf> getHagafByChativaUnique(String chativaCode) { List<Hagaf> list_hagaf = null; Criteria crit_hagaf = getSession().createCriteria(Hagaf.class) .add(Restrictions.eq("chativaCode", chativaCode)) .setProjection(Projections.projectionList() .add(Projections.distinct(Projections.property("hagafName").as("hagafName"))) ); crit_hagaf.setResultTransformer(Transformers.aliasToBean(Hagaf.class)); list_hagaf = crit_hagaf.list(); return list_hagaf; }
public static void main(String[] args) { List<Hagaf> list = getHagafByChativaUnique("55") for (Hagaf hagaf : list) { hagaf.getHagafPK(); } }
class that i have: class HagafPK class Hagaf
Thankx!!!
|