Thank you, emmanuel for your attention, i see that you are working much on helping people at this forum.
Actually that code runs without exceptions. Before posting my question here i was working on this issue for something like 3 days. So could you please point out where exactly, do you think, that should be ClastCastException, and why?
By the way, we are experiencing kind of black magic here.
The domain model is like:
Operation 1-1 Algorithm 1-n Procedure 1-1 ProcedureText 1-n ProcedureTextBlock... and so on.
I would like to have Operation-Algorithm and Procedure-ProcedureText to be LAZY. Because of problems described in first post to this topic, I've turned LAZY to EAGER for both assocciations mentioned. TestCases went fine. THEN i've turned Operation-Algorithm back to LAZY and TestCases went fine also, BUT in our application we started to get LazyInitException at the algorithm.getProcedures() witch have allways been an EAGER assocciation! :)
You can find my domain model here :
http://www.bekarsoft.com/mikler/domain.rar
what ever...
i would like you to answer to question, witch i can not find in docs, FAQs or anywhere else. The question is
WHAT IS THE RIGHT WAY TO INITIALIZE LAZY PROPERTY, WITCH WAS LOADED IN ANOTHER ENTITYMANAGER?