Hi!
I first just tried this.
Code:
(SchemaInfo) session.load(SchemaInfo.class, new Long(id));
But that allways throwed an ClassCastException. Then i tried all kinds of diffrent ways to aviod the Exception. The code i posted here was the one i thought would take care of every way it could go wrong.
Quote:
My thought on the lightweight pattern was to prevent unnecessary fetching. It looks from your code, that SchemaInfo extends Schema (you're right this is sort of backwards && confusing).
That is exactly what i want.
Quote:
But then you try to load Schema and check to see if it's an instance of SchemaInfo? Since you have polymorphism = explicit, will it *ever* come back as SchemaInfo? I suspect not. (I could be wrong though).
Hmm no it wont. Maybe this it what i intended (can