[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2035) Generate hibernate.cfg file from used persisted entities only

Holger Haag (JIRA) noreply at atlassian.com
Tue Aug 29 05:41:24 EDT 2006


Generate hibernate.cfg file from used persisted entities only
-------------------------------------------------------------

         Key: HHH-2035
         URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2035
     Project: Hibernate3
        Type: New Feature

  Components: core  
 Environment: Hibernate 3.x + Hibernate annotations

    Reporter: Holger Haag
    Priority: Minor
 Attachments: TwoPhaseLoad-writeUsedPersisters.patch, hibernate-template.cfg.xml

Original post from Hibernate forum: http://forum.hibernate.org/viewtopic.php?t=963888

The patch allows to call a new method TwoPhaseLoad.writeUsedPersisters which will generate a complete hibernate.cfg configuration file containing only the entities which have been persisted so far. 

The rationale behind this is that for unit test cases it is often sufficient - and much faster - to initialize hibernate with only a subset of all persisted classes, but it is cumbersome to find out which subset is the smallest possible.

Attached is a SVN patch for the latest SVN trunk and a sample template file.

Feel free to modify/put it into the hibernate code in any way you want, I think it can increase productivity - startup times for my test cases have dropped by 10 seconds.

Please note that this patch will only work if you use Hibernate annotations since the generated XML file only contains class, not column mappings.

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