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

Max Rydahl Andersen (JIRA) noreply at atlassian.com
Tue Aug 29 07:14:24 EDT 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2035?page=comments#action_24204 ] 

Max Rydahl Andersen commented on HHH-2035:
------------------------------------------

i like the idea, but:

1) Where are the code that actual add elements to the usedPersisters map ?

2) Does it work with associations ? (e..g if A point to B and only A is used, B is still needed in your configuration)

3) Couldn't this be done via eventlisteners instead of mutating TwoPhaseLoad class?



> 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