[hibernate-issues] [Hibernate-JIRA] Created: (ANN-796) @Proxy annotation's reference documentation needs to improved

Joonas Koivunen (JIRA) noreply at atlassian.com
Thu Jan 15 08:36:38 EST 2009


@Proxy annotation's reference documentation needs to improved
-------------------------------------------------------------

                 Key: ANN-796
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-796
             Project: Hibernate Annotations
          Issue Type: Improvement
          Components: documentation
    Affects Versions: 3.4.0.GA
         Environment: Core 3.3.1.GA, Apache Derby
            Reporter: Joonas Koivunen


I stumbled upon the problem documented for example here: http://www.hibernate.org/250.709.html, that you cannot just ask for the super-class and expect a child class' instance, even if for example toString() gives the correct answer.

In http://www.hibernate.org/hib_docs/v3/reference/en/html/performance.html#performance-fetching-proxies the use of 
<sub-class class="..." proxy="...">...</subclass>
is documented. From that I realized that was this @Proxy annotation that I never thought of using before.

Looking at http://www.hibernate.org/hib_docs/annotations/reference/en/html/entity.html#entity-hibspec that documents @Proxy:

1) It talks about proxyClassName attribute, which doesn't exist (any more at least), it has been replaced with Class<?> proxyClass
2) It doesn't mention anything about you having to annotate every class in the hierarchy from Cat to DomesticCat with @Proxy(proxyClass=BusinessInterfaceForEachClass.class)

If not all of the hierarchy are annotated with @Proxy it'll throw a MappingException complaining that proxyClass is not an interface or the class itself, which doesn't quite translate to "you need to annotate whole hierarchy." Is this error because of some defaulting to void.class in the upper hierarchy perhaps?


-- 
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