[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3369) Let the proxy extends the most possible lower class in a class heirarchy

Amr Noaman (JIRA) noreply at atlassian.com
Tue Jul 1 05:04:32 EDT 2008


Let the proxy extends the most possible lower class in a class heirarchy
------------------------------------------------------------------------

                 Key: HHH-3369
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3369
             Project: Hibernate3
          Issue Type: New Feature
          Components: core
    Affects Versions: 3.3.0.CR1
            Reporter: Amr Noaman


This feature may resolve the famous ClassCastException that appear with all those who worked with proxies and type heirarchies.

If you have a type hierarchy like this:

     A
    /   \
  B    C

The following statement will return a proxy that extends A:

session.Load(typeof(A), Id);

The load operation blindly creates a proxy that extends A, even if the real object is of type B or C, and this makes casting to B or C not possible. 

Instead, It may check the discriminator value, and accordingly, it may let the proxy extend the proper actual type. So, if the discriminator says that this record is of type B, the proxy should extend type B instead of A, and so on.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list