ClassCastException cannot dissolve proxy (OR Hibernate)

Discussion in 'Java' started by horst, Jul 26, 2007.

  1. horst

    horst Guest

    Hey !

    I have a class struture: Abstact Superclass, and two SubClasses.
    The two sublasses are mapped in one DB-Table.
    Sometimes got a ClassCastExeception because the object is an dissolve
    proxy-object from type superclass. And I can't cast from the
    superclass to a subclass ;-)
    When I try to dissolve the proxy-object manual with aObject.getUid()
    (or so), it doesn't dissolve to the correcty subclass too.

    But sometimes it absolutly correct.

    When I change in my hibernate-file the object from lazy=true in lazy =
    false it still works correctly.
    But I have at an other place the same object-struture and the same
    definition lazy=true, and it still works.

    Do you know about any problems and a solution?

    horst, Jul 26, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.