@Override public Object beanManagerLifeCycle(BeanManager beanManager) { if ( isHibernateExtendedBeanManagerSupported() ) { return new HibernateExtendedBeanManager( beanManager ); } // for ORM 5.0, return null to indicate that the org.hibernate.jpa.event.spi.jpa.ExtendedBeanManager extension should not be used. return null; }
@SuppressWarnings("deprecation") @Override public void addProviderProperties(Map properties, PersistenceUnitMetadata pu) { putPropertyIfAbsent(pu, properties, AvailableSettings.JPAQL_STRICT_COMPLIANCE, "true"); // JIPI-24 ignore jpql aliases case putPropertyIfAbsent(pu, properties, AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "true"); putPropertyIfAbsent(pu, properties, AvailableSettings.KEYWORD_AUTO_QUOTING_ENABLED,"false"); putPropertyIfAbsent(pu, properties, AvailableSettings.IMPLICIT_NAMING_STRATEGY, NAMING_STRATEGY_JPA_COMPLIANT_IMPL); putPropertyIfAbsent(pu, properties, AvailableSettings.SCANNER, HibernateArchiveScanner.class); properties.put(AvailableSettings.APP_CLASSLOADER, pu.getClassLoader()); putPropertyIfAbsent(pu, properties, AvailableSettings.JTA_PLATFORM, new JBossAppServerJtaPlatform(jtaManager)); putPropertyIfAbsent(pu,properties, org.hibernate.ejb.AvailableSettings.ENTITY_MANAGER_FACTORY_NAME, pu.getScopedPersistenceUnitName()); putPropertyIfAbsent(pu, properties, AvailableSettings.SESSION_FACTORY_NAME, pu.getScopedPersistenceUnitName()); if (!pu.getProperties().containsKey(AvailableSettings.SESSION_FACTORY_NAME)) { putPropertyIfAbsent(pu, properties, AvailableSettings.SESSION_FACTORY_NAME_IS_JNDI, Boolean.FALSE); } }
@Override public void addProviderDependencies(PersistenceUnitMetadata pu) { ormOriginalAdaptor.addProviderDependencies( pu ); }
@Override public void addProviderProperties(Map properties, PersistenceUnitMetadata pu) { ormOriginalAdaptor.addProviderProperties( properties, pu ); // Use "putIfAbsent" to allow overriding the setting: properties.putIfAbsent( "hibernate.ogm.enabled", "true" ); properties.putIfAbsent( Environment.DATASOURCE, "---PlaceHolderDSForOGM---" ); }
@Override public Object beanManagerLifeCycle(BeanManager beanManager) { return ormOriginalAdaptor.beanManagerLifeCycle( beanManager ); } }
@Override public void afterCreateContainerEntityManagerFactory(PersistenceUnitMetadata pu) { ormOriginalAdaptor.afterCreateContainerEntityManagerFactory( pu ); }
@Override public void addProviderDependencies(PersistenceUnitMetadata pu) { ormOriginalAdaptor.addProviderDependencies( pu ); }
@Override public void addProviderProperties(Map properties, PersistenceUnitMetadata pu) { ormOriginalAdaptor.addProviderProperties( properties, pu ); // Use "putIfAbsent" to allow overriding the setting: properties.putIfAbsent( "hibernate.ogm.enabled", "true" ); properties.putIfAbsent( Environment.DATASOURCE, "---PlaceHolderDSForOGM---" ); }
@Override public Object beanManagerLifeCycle(BeanManager beanManager) { return ormOriginalAdaptor.beanManagerLifeCycle( beanManager ); } }
@Override public void afterCreateContainerEntityManagerFactory(PersistenceUnitMetadata pu) { ormOriginalAdaptor.afterCreateContainerEntityManagerFactory( pu ); }
@Override public Object beanManagerLifeCycle(BeanManager beanManager) { if( isHibernateExtendedBeanManagerSupported()) { return new HibernateExtendedBeanManager(beanManager); } // for ORM 5.0, return null to indicate that the org.hibernate.jpa.event.spi.jpa.ExtendedBeanManager extension should not be used. return null; }
@SuppressWarnings("deprecation") @Override public void addProviderProperties(Map properties, PersistenceUnitMetadata pu) { putPropertyIfAbsent(pu, properties, AvailableSettings.JPAQL_STRICT_COMPLIANCE, "true"); // JIPI-24 ignore jpql aliases case putPropertyIfAbsent(pu, properties, AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "true"); putPropertyIfAbsent(pu, properties, AvailableSettings.KEYWORD_AUTO_QUOTING_ENABLED,"false"); putPropertyIfAbsent(pu, properties, AvailableSettings.IMPLICIT_NAMING_STRATEGY, NAMING_STRATEGY_JPA_COMPLIANT_IMPL); putPropertyIfAbsent(pu, properties, AvailableSettings.SCANNER, HibernateArchiveScanner.class); properties.put(AvailableSettings.APP_CLASSLOADER, pu.getClassLoader()); putPropertyIfAbsent(pu,properties, org.hibernate.ejb.AvailableSettings.ENTITY_MANAGER_FACTORY_NAME, pu.getScopedPersistenceUnitName()); putPropertyIfAbsent(pu, properties, AvailableSettings.SESSION_FACTORY_NAME, pu.getScopedPersistenceUnitName()); if (!pu.getProperties().containsKey(AvailableSettings.SESSION_FACTORY_NAME)) { putPropertyIfAbsent(pu, properties, AvailableSettings.SESSION_FACTORY_NAME_IS_JNDI, Boolean.FALSE); } // the following properties were added to Hibernate ORM 5.3, for JPA 2.2 spec compliance. putPropertyIfAbsent( pu, properties, AvailableSettings.PREFER_GENERATOR_NAME_AS_DEFAULT_SEQUENCE_NAME, true ); putPropertyIfAbsent( pu, properties, AvailableSettings.JPA_TRANSACTION_COMPLIANCE, true ); putPropertyIfAbsent( pu, properties, AvailableSettings.JPA_CLOSED_COMPLIANCE, true ); putPropertyIfAbsent( pu, properties, AvailableSettings.JPA_QUERY_COMPLIANCE, true ); putPropertyIfAbsent( pu, properties, AvailableSettings.JPA_LIST_COMPLIANCE, true ); putPropertyIfAbsent( pu, properties, AvailableSettings.JPA_CACHING_COMPLIANCE, true ); putPropertyIfAbsent( pu, properties, AvailableSettings.JPA_PROXY_COMPLIANCE, true ); putPropertyIfAbsent( pu, properties, AvailableSettings.ENABLE_LAZY_LOAD_NO_TRANS, false ); putPropertyIfAbsent( pu, properties, AvailableSettings.JPA_ID_GENERATOR_GLOBAL_SCOPE_COMPLIANCE, true); // Search hint putPropertyIfAbsent( pu, properties,"hibernate.search.index_uninverting_allowed", "true" ); }
@Override public void markPersistenceUnitAvailable(Object wrapperBeanManagerLifeCycle) { if ( isHibernateExtendedBeanManagerSupported() ) { HibernateExtendedBeanManager hibernateExtendedBeanManager = (HibernateExtendedBeanManager) wrapperBeanManagerLifeCycle; // notify Hibernate ORM ExtendedBeanManager extension that the entity listener(s) can now be registered. hibernateExtendedBeanManager.beanManagerIsAvailableForUse(); } }
@Override @SuppressWarnings({"deprecation", "unchecked"}) public void addProviderProperties(Map properties, PersistenceUnitMetadata pu) { putPropertyIfAbsent( pu, properties, AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "true" ); putPropertyIfAbsent( pu, properties, AvailableSettings.KEYWORD_AUTO_QUOTING_ENABLED, "false" ); putPropertyIfAbsent( pu, properties, NAMING_STRATEGY_JPA_COMPLIANT_IMPL ); putPropertyIfAbsent( pu, properties, AvailableSettings.SCANNER, HibernateArchiveScanner.class ); properties.put( AvailableSettings.APP_CLASSLOADER, pu.getClassLoader() ); putPropertyIfAbsent( pu, properties, pu.getScopedPersistenceUnitName() ); putPropertyIfAbsent( pu, properties, ); if ( !pu.getProperties().containsKey( AvailableSettings.SESSION_FACTORY_NAME ) ) { putPropertyIfAbsent( pu, properties, AvailableSettings.SESSION_FACTORY_NAME_IS_JNDI, Boolean.FALSE ); putPropertyIfAbsent( pu, properties, AvailableSettings.PREFER_GENERATOR_NAME_AS_DEFAULT_SEQUENCE_NAME, true ); putPropertyIfAbsent( pu, properties, AvailableSettings.JPA_TRANSACTION_COMPLIANCE, true ); putPropertyIfAbsent( pu, properties, AvailableSettings.JPA_CLOSED_COMPLIANCE, true );
@Override public void markPersistenceUnitAvailable(Object wrapperBeanManagerLifeCycle) { if(isHibernateExtendedBeanManagerSupported()) { HibernateExtendedBeanManager hibernateExtendedBeanManager = (HibernateExtendedBeanManager) wrapperBeanManagerLifeCycle; // notify Hibernate ORM ExtendedBeanManager extension that the entity listener(s) can now be registered. hibernateExtendedBeanManager.beanManagerIsAvailableForUse(); } }
@SuppressWarnings("deprecation") @Override public void addProviderProperties(Map properties, PersistenceUnitMetadata pu) { putPropertyIfAbsent(pu, properties, AvailableSettings.JPAQL_STRICT_COMPLIANCE, "true"); // JIPI-24 ignore jpql aliases case putPropertyIfAbsent(pu, properties, AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "true"); putPropertyIfAbsent(pu, properties, AvailableSettings.KEYWORD_AUTO_QUOTING_ENABLED,"false"); putPropertyIfAbsent(pu, properties, AvailableSettings.IMPLICIT_NAMING_STRATEGY, NAMING_STRATEGY_JPA_COMPLIANT_IMPL); putPropertyIfAbsent(pu, properties, AvailableSettings.SCANNER, HibernateArchiveScanner.class); properties.put(AvailableSettings.APP_CLASSLOADER, pu.getClassLoader()); putPropertyIfAbsent(pu,properties, org.hibernate.ejb.AvailableSettings.ENTITY_MANAGER_FACTORY_NAME, pu.getScopedPersistenceUnitName()); putPropertyIfAbsent(pu, properties, AvailableSettings.SESSION_FACTORY_NAME, pu.getScopedPersistenceUnitName()); if (!pu.getProperties().containsKey(AvailableSettings.SESSION_FACTORY_NAME)) { putPropertyIfAbsent(pu, properties, AvailableSettings.SESSION_FACTORY_NAME_IS_JNDI, Boolean.FALSE); } // the following properties were added to Hibernate ORM 5.3, for JPA 2.2 spec compliance. putPropertyIfAbsent( pu, properties, AvailableSettings.PREFER_GENERATOR_NAME_AS_DEFAULT_SEQUENCE_NAME, true ); putPropertyIfAbsent( pu, properties, AvailableSettings.JPA_TRANSACTION_COMPLIANCE, true ); putPropertyIfAbsent( pu, properties, AvailableSettings.JPA_CLOSED_COMPLIANCE, true ); putPropertyIfAbsent( pu, properties, AvailableSettings.JPA_QUERY_COMPLIANCE, true ); putPropertyIfAbsent( pu, properties, AvailableSettings.JPA_LIST_COMPLIANCE, true ); putPropertyIfAbsent( pu, properties, AvailableSettings.JPA_CACHING_COMPLIANCE, true ); putPropertyIfAbsent( pu, properties, AvailableSettings.JPA_PROXY_COMPLIANCE, true ); putPropertyIfAbsent( pu, properties, AvailableSettings.ENABLE_LAZY_LOAD_NO_TRANS, false ); putPropertyIfAbsent( pu, properties, AvailableSettings.JPA_ID_GENERATOR_GLOBAL_SCOPE_COMPLIANCE, true); // Search hint putPropertyIfAbsent( pu, properties,"hibernate.search.index_uninverting_allowed", "true" ); }
@Override public void markPersistenceUnitAvailable(Object wrapperBeanManagerLifeCycle) { if(isHibernateExtendedBeanManagerSupported()) { HibernateExtendedBeanManager hibernateExtendedBeanManager = (HibernateExtendedBeanManager) wrapperBeanManagerLifeCycle; // notify Hibernate ORM ExtendedBeanManager extension that the entity listener(s) can now be registered. hibernateExtendedBeanManager.beanManagerIsAvailableForUse(); } }
@SuppressWarnings("deprecation") @Override public void addProviderProperties(Map properties, PersistenceUnitMetadata pu) { putPropertyIfAbsent(pu, properties, AvailableSettings.JPAQL_STRICT_COMPLIANCE, "true"); // JIPI-24 ignore jpql aliases case putPropertyIfAbsent(pu, properties, AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "true"); putPropertyIfAbsent(pu, properties, AvailableSettings.KEYWORD_AUTO_QUOTING_ENABLED,"false"); putPropertyIfAbsent(pu, properties, AvailableSettings.IMPLICIT_NAMING_STRATEGY, NAMING_STRATEGY_JPA_COMPLIANT_IMPL); putPropertyIfAbsent(pu, properties, AvailableSettings.SCANNER, HibernateArchiveScanner.class); properties.put(AvailableSettings.APP_CLASSLOADER, pu.getClassLoader()); putPropertyIfAbsent(pu, properties, AvailableSettings.JTA_PLATFORM, new JBossAppServerJtaPlatform(jtaManager)); putPropertyIfAbsent(pu,properties, org.hibernate.ejb.AvailableSettings.ENTITY_MANAGER_FACTORY_NAME, pu.getScopedPersistenceUnitName()); putPropertyIfAbsent(pu, properties, AvailableSettings.SESSION_FACTORY_NAME, pu.getScopedPersistenceUnitName()); if (!pu.getProperties().containsKey(AvailableSettings.SESSION_FACTORY_NAME)) { putPropertyIfAbsent(pu, properties, AvailableSettings.SESSION_FACTORY_NAME_IS_JNDI, Boolean.FALSE); } }
@Override public Object beanManagerLifeCycle(BeanManager beanManager) { if( isHibernateExtendedBeanManagerSupported()) { return new HibernateExtendedBeanManager(beanManager); } // for ORM 5.0, return null to indicate that the org.hibernate.jpa.event.spi.jpa.ExtendedBeanManager extension should not be used. return null; }
@Override public Object beanManagerLifeCycle(BeanManager beanManager) { if( isHibernateExtendedBeanManagerSupported()) { return new HibernateExtendedBeanManager(beanManager); } // for ORM 5.0, return null to indicate that the org.hibernate.jpa.event.spi.jpa.ExtendedBeanManager extension should not be used. return null; }