[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6938?page=c...
]
Stephane Nicoll commented on HHH-6938:
--------------------------------------
Hey Steve, thanks again for the response. I actually went through the redhat support and
since 3.6 is not supported, I could not get any response from them. I perfectly understand
the limitation of configuration and I agree with that. How about a constructor in
Ejb3Configuration taking a Configuration instance ?
If you look how Spring is starting the JPA container, it goes through that
PersistenceContext and currently that's the only way as far as I can see to touch the
Hibernate config before it starts.
And thanks for the pointers, I'll have a look.
As far as this issue, my apologies. I realized indeed it was more a question than an issue
itself. If there is an alternative to what I am currently doing with Spring bootstrap, I
am more than happy to change my code.
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