|
Yes, I see that a class should be mappable to multiple tables: which explains the exception.
However I would have thought that the following would be essentially equivalent: session.createCriteria(AImpl.class).add(Restrictions.idEq(1)).uniqueResult() session.load(AImpl.class, 1)
(not that I would typically go for the former) ...but I guess that's not the case.
It is a little confusing that createCriteria and load/get appear in the API accepting both a string and a class to determine the 'type of entity' to load but the meaning in each case is subtly different. Maybe a comment in the API doc is warranted (or am I the only one to be caught by this?).
Thanks.
|