-
1. Re: AS7-2460 allow hibernate.id.new_generator_mappings=false to be specified in the persistence.xml does not work (for me)
guinotphil Dec 29, 2011 4:51 AM (in response to guinotphil)This looks definitely like a bug for me, because org.jboss.as.jpa.hibernate3.HibernatePersistenceProviderAdaptor.addProviderProperties() is actuall called by org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.addPuService() which actually do not load any properties into the properties Map parameter (lines 251-255):
final HashMap properties = new HashMap();
if (!ValidationMode.NONE.equals(pu.getValidationMode())) {
ValidatorFactory validatorFactory = SerializableValidatorFactory.validatorFactory();
properties.put("javax.persistence.validation.factory", validatorFactory);
}
So, the hibernate.id.new_generator_mappings property will always be overridden to true !!!
I guess org.jboss.as.jpa.hibernate3.HibernatePersistenceProviderAdaptor.addProviderProperties() miss something like
properties.putAll(pu.getProperties());
before calling the putPropertyIfAbsent methods.
Or, putPropertyIfAbsent should check if the property is absent from the properties Map and the PersistenceUnitInfo’s properties.
Should I re-open https://issues.jboss.org/browse/AS7-2460 then ?
-
2. Re: AS7-2460 allow hibernate.id.new_generator_mappings=false to be specified in the persistence.xml does not work (for me)
jaikiran Dec 29, 2011 4:54 AM (in response to guinotphil)1 of 1 people found this helpfulWhich JBoss AS7 are you using?
guinotphil wrote:
Should I re-open https://issues.jboss.org/browse/AS7-2460 then ?
Let's wait for Scott.
-
3. Re: AS7-2460 allow hibernate.id.new_generator_mappings=false to be specified in the persistence.xml does not work (for me)
guinotphil Dec 29, 2011 4:56 AM (in response to jaikiran)I'm using 7.1.0.CR1b. But I also had the issue with 7.1.0.Final-SNAPSHOT from 23rd december.
-
4. Re: AS7-2460 allow hibernate.id.new_generator_mappings=false to be specified in the persistence.xml does not work (for me)
smarlow Dec 29, 2011 9:12 AM (in response to guinotphil)1 of 1 people found this helpfulGood catch, please open a new jira for this bug.
putPropertyIfAbsent should check the pu.getProperties() instead of the empty HashMap.
We don't need to add the pu properties to the empty HashMap. These are only integration level properties, that are passed in addition to the pu itself in the later call to
PersistenceProvider.createContainerEntityManagerFactory(
PersistenceUnitInfo info, Map map)
-
5. Re: AS7-2460 allow hibernate.id.new_generator_mappings=false to be specified in the persistence.xml does not work (for me)
guinotphil Dec 29, 2011 9:29 AM (in response to smarlow)Thank you.
Here is it: https://issues.jboss.org/browse/AS7-3146
I guess this bug affect the jpa connector for Hibernate 3 as well as the jpa connector for Hibernate 4.
-
6. Re: AS7-2460 allow hibernate.id.new_generator_mappings=false to be specified in the persistence.xml does not work (for me)
guinotphil Jan 6, 2012 5:17 AM (in response to guinotphil)Thank you very much for fixing this.