[
https://issues.apache.org/jira/browse/WICKET-4414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13211806#comment-13211806
]
Andre L edited comment on WICKET-4414 at 2/20/12 12:29 PM:
-----------------------------------------------------------
The patch/test seems to work for JDK based proxies, but will it also work for
for cglib/javaassist enhanced classes that you typically get from JPA relations
that are configured to be lazy-loaded?
Example:
class Person {
@ManyToOne(fetch = FetchType.LAZY...)
Address address;
}
class Address {
}
Person person = a person instance loaded from a JPA EntityManager
converterLocator.set(Address.class, ...)
converterLocator.getConverter(person.getAddress().getClass()) //This fails as
the name of the Addess class will be something like
Address<javassist/EnhancerByCGLIB>.class
A PersonAddress class that inherits Address would neither match Address since
the class name is used as key in the classToConverter registry, but that is
another question, should inherited classes be supported by the locator or
registered explicitly? If the internal registry classToConverter used Class as
a key the ConverterLocator#getConverter() could support both enhanced and
inherited classes (if that is wanted).
was (Author: jomarl):
The patch/test seems to work for JDK based proxies, but will it also work
for for cglib/javaassist enhanced classes that you typically get from JPA
relations that are configured to be lazy-loaded?
Example:
class Person {
@ManyToOne(fetch = FetchType.LAZY...)
Address address;
}
class Address {
}
Person person = a person instance loaded from a JPA EntityManager
converterLocator.set(Address.class, ...)
converterLocator.getConverter(person.getAddress()) //This fails as the name of
the Addess class will be something like
Address<javassist/EnhancerByCGLIB>.class
A PersonAddress class that inherits Address would neither match Address since
the class name is used as key in the classToConverter registry, but that is
another question, should inherited
classes be supported by the locator or registered explicitly? If the internal
registry classToConverter used Class as a key the
ConverterLocator#getConverter() could support both enhanced and inherited
classes (if that is wanted).
> ConverterLocator should support proxied classes
> -----------------------------------------------
>
> Key: WICKET-4414
> URL: https://issues.apache.org/jira/browse/WICKET-4414
> Project: Wicket
> Issue Type: Wish
> Components: wicket
> Affects Versions: 1.5.3, 1.5.4
> Environment: Not relevant.
> Reporter: Andre L
> Assignee: Martin Grigorov
> Priority: Minor
> Attachments: WICKET-4414.patch
>
>
> It would be nice if Wicket's default implementation of IConverter would work
> with proxied classes. The current implementation uses Class#getName() to
> locate registered classes, and it will therefore not work with enhanced
> classes.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira