From: Jak M. (JIRA) <no...@at...> - 2006-05-31 18:20:17
|
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 |