[hibernate-issues] [Hibernate-JIRA] Created: (EJB-360) Create a property to intercept the Configuration for programmatic modification before the EntityManagerFactory is created

John Leach (JIRA) noreply at atlassian.com
Sun May 18 10:53:33 EDT 2008


Create a property to intercept the Configuration for programmatic modification before the EntityManagerFactory is created
-------------------------------------------------------------------------------------------------------------------------

                 Key: EJB-360
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-360
             Project: Hibernate Entity Manager
          Issue Type: New Feature
          Components: EntityManager
    Affects Versions: 3.3.2.GA
            Reporter: John Leach
         Attachments: ConfigurationCustomizer.patch

Create a property (hibernate.cfg.customizer) in persistence.xml which allows the user to specify a class which can programmatically modify the constructed Configuration object (built via annotations and XML configuration) before the EntityManagerFactory is created.

The aim is to provide a third mechanism for configuration, after annotation and XML configuration has been performed. By specifying a user supplied class name the user can then use Configuration methods to access the mappings and make programmatic modifications, such as converting Cascade.ALL (JPA) to cascade all-delete-orphans (Hibernate).

The attached patch provides the code modifications, currently used in Spikes, (http://lab.jugtorino.it/trac/sandbox/wiki/Spikes) to allow programmatic modifications of the Configuration object. The patch file was created from the current trunk (18/05/2008) of hibernate-entitymanager, more specifically, trunk/src/java/org/hibernate/ejb.

The user supplied class must have a no argument constructor, and implement the org.hibernate.ejb.ConfigurationCustomizer interface.

The mechanism is similar to hibernate.ejb.interceptor in concept, except that it acts on the Configuration object rather than on the entity life cycle.

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