I read that in the Javadoc, but as you can see, I never use a session.load().
To retreive my object, I use a DAO under Spring. Per exemple this finder use a composite key:
Code:
public Composante findComposanteByIds(String institution, String transit, short serviceCenter) {
Session session = SessionFactoryUtils.getSession(getSessionFactory(), true);
Criteria criteria = session.createCriteria(Composante.class);
criteria.add(Expression.eq("id.institution", institution));
criteria.add(Expression.eq("id.transit", transit));
criteria.add(Expression.eq("id.serviceCenter", new Short(serviceCenter)));
return (Composante)criteria.uniqueResult();
}
Having the "composante", i just do a
Code:
composante.getB();
in my code and doing that, i get the ObjectNotFoundException because the foreign key of my composante is equal to "" or any corrupted value...
So, I dont see how I could use a session.get() here.... instead of the session.load() probably made by the composante.getB();
Thanks.
Etienne.