]
Marco Tedone updated HHH-2825:
------------------------------
Attachment: ConfigurationFactory.java
In the HibernateService (JMX) create support for annotated classes
------------------------------------------------------------------
Key: HHH-2825
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2825
Project: Hibernate3
Issue Type: New Feature
Components: core
Affects Versions: 3.2.5
Reporter: Marco Tedone
Attachments: ConfigurationFactory.java, ExternalSessionFactoryConfig.java,
HibernateService.java, HibernateServiceMBean.java
Hi, I was faced with the problem of declaring an HB SessionFactory as a JMX service
(using the HibernateService class) but I was impossibilitated from declaring mapped
classes. Basically as it stands at the moment, the HibernateService MBean allows only to
specify a mapResources property which is a comma separated list of .hbm.xml files. I
changed the current service in order to allow another property (mappedClasses) which
allows a comma separated list of @Entity classes which are loaded and mapped at runtime.
It would be nice if this change would be included in future versions of Hibernate. This
change involved the following:
1) To add two extra methods in the org.hibernate.jmx.HibernateServiceMBean interface
(getter/setter for the new property)
2) To add another String attribute to org.hibernate.util.ExternalSessionFactoryConfig to
contain the additional property
3) To create a new ConfigurationFactory class which creates standard configurations
(Configuration) or configurations which support annotations (AnnotationConfiguration)
depending if the new property contains any values (this property is mutually exclusive
with the mapResources one)
The drawback is that AnnotationConfiguration is part of the hibernate-annotations
artifact, so in order for this change to work, hibernate-annotations should be included in
the hibernate/lib folder, introducing a dependency that maybe is unwanted. If you guys
find a better way, feel free to change things around
As I said it would be nice to have this feature in the next HB release, so I'm happy
to post/attach the code I've changed, just let me know how could I do that.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: