[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1801?page=all ]
Emmanuel Bernard resolved HHH-1801:
-----------------------------------
Resolution: Rejected
method reflection is certainly much slower than string comparison.
And the hashtable operation is pretty slow too.
As per the doc
"Essentially all of the methods of the Session interface correlate to an event. You have a LoadEvent, a FlushEvent, etc (consult the XML configuration-file DTD or the org.hibernate.event package for the full list of defined event types)."
Did you check the doc and the DTD?
> Event names for Configuration.setEventListener() should be fixed and documented.
> --------------------------------------------------------------------------------
>
> Key: HHH-1801
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1801
> Project: Hibernate3
> Type: Bug
> Components: core
> Versions: 3.2.0.alpha2
> Reporter: Jak Mang
>
>
> There should be public static constants defined for the name parameter of Configuration.setEventListener(). That way, even if they *are not* documented, the JavaDoc will pick them up. I don't know why these were not integers or enums instead of strings.
> I had to go to look at the source to find the correct names and who knows if someone will change them and break my code.
> The implementation is pretty slow and fat with all of the string comparisons, but it probably does not matter since it is a startup issue. You could use a static hash string to integer and a switch.
> Another alternative would be to do reflection on the listener object. You would need to handle the case where an object implemented multiple interfaces. This would make the user/caller code quite brief.
--
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
|