HHH-7527 - OSGI manifests for hibernate-orm

This commit is contained in:
Steve Ebersole 2012-08-16 15:20:32 -05:00
parent 6b5a428b3f
commit af4fedc98b
1 changed files with 22 additions and 8 deletions

View File

@ -186,15 +186,29 @@ public class JpaIntegrator implements Integrator {
}
}
/**
* {@inheritDoc}
*
* @see org.hibernate.integrator.spi.Integrator#integrate(org.hibernate.metamodel.source.MetadataImplementor, org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.service.spi.SessionFactoryServiceRegistry)
*/
@Override
public void integrate( MetadataImplementor metadata,
SessionFactoryImplementor sessionFactory,
SessionFactoryServiceRegistry serviceRegistry ) {
public void integrate(
MetadataImplementor metadata,
SessionFactoryImplementor sessionFactory,
SessionFactoryServiceRegistry serviceRegistry ) {
// first, register the JPA-specific persist cascade style
CascadeStyles.registerCascadeStyle(
"persist",
new CascadeStyles.BaseCascadeStyle() {
@Override
public boolean doCascade(CascadingAction action) {
return action == JpaPersistEventListener.PERSIST_SKIPLAZY
|| action == CascadingActions.PERSIST_ON_FLUSH;
}
@Override
public String toString() {
return "STYLE_PERSIST_SKIPLAZY";
}
}
);
// then prepare listeners
final EventListenerRegistry eventListenerRegistry = serviceRegistry.getService( EventListenerRegistry.class );
boolean isSecurityEnabled = sessionFactory.getProperties().containsKey( AvailableSettings.JACC_ENABLED );