[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6938) Clarify the use of getHibernateConfiguration and Configuration handling with JPA bootstrap

Steve Ebersole (JIRA) noreply at atlassian.com
Thu Jan 5 09:37:13 EST 2012


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44955#comment-44955 ] 

Steve Ebersole commented on HHH-6938:
-------------------------------------

No idea what spring does or does not do so I unfortunately cannot help there.

As for the Hibernate side of things, I think that in 3.6 what you are doing is exactly what you would need to do.  The bright side of us not developing 3.6 anymore is that you in fact do not have to worry about that code changing :D



> Clarify the use of getHibernateConfiguration and Configuration handling with JPA bootstrap
> ------------------------------------------------------------------------------------------
>
>                 Key: HHH-6938
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6938
>             Project: Hibernate Core
>          Issue Type: Task
>    Affects Versions: 3.6.5
>            Reporter: Stephane Nicoll
>
> Hi,
> I am willing to register custom types automatically when our application starts. We are using JPA2 and the EntityManager.
> To do so I can use a method on the Configuration object (registerTypeOverride). When configuring the JPA container, the PersistenceProvider can be extended. That's what I am doing but I came to this code (Ejb3Configuration on 3.6.5)
> {code:java}
>        /**
> 	 * This API is intended to give a read-only configuration.
> 	 * It is sueful when working with SchemaExport or any Configuration based
> 	 * tool.
> 	 * DO NOT update configuration through it.
> 	 */
> 	public AnnotationConfiguration getHibernateConfiguration() {
> 		//TODO make it really read only (maybe through proxying)
> 		return cfg;
> 	}
> {code}
> I believe there is a TODO here that may lead to a change that would disallow me to use the configuration object to register new types on startup. If this TODO gets ever resolved (why?), what could I do to register new types? 
> Thanks

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list