Hellu,
I would like to use the interface 'class' in my session.get(), like:
- session.get(Myinterface.class, id).
I understand that it doesn't work, probably Hibernate needs more information to retrieve this.
I get a hibernate mapping exception telling my that ofcourse it can't find the MyInterface class.
I had a look at the proxy attribute, but I don't think that is my solution. I tried it and it doesn't work.
But then why does this work with a Criteria query???
That is, I do:
Criteria crit = session.createCriteria(MyInterface);
..
crit.list().
This work fine....
But then why this works and not the the session.get(Interface.class, id)... ?? :(
I am abit confused, please some help?
I realy don't like to use my implementation classes in my code. That's basically why I was looking at this.
But then how do I overcome this?...
|