Package org.hibernate.impl

Examples of org.hibernate.impl.SessionFactoryImpl


    Properties copy = new Properties();
    copy.putAll( properties );
    ConfigurationHelper.resolvePlaceHolders( copy );
    Settings settings = buildSettings( copy, serviceRegistry );

    return new SessionFactoryImpl(
        this,
        mapping,
        serviceRegistry,
        settings,
        sessionFactoryObserver
View Full Code Here


    Connection connection = null;
    JbpmConfiguration jbpmConfiguration = AntHelper.getJbpmConfiguration(null);
    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
    try {
      DbPersistenceServiceFactory dbPersistenceServiceFactory = (DbPersistenceServiceFactory) jbpmContext.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
      SessionFactoryImpl sessionFactory = (SessionFactoryImpl) dbPersistenceServiceFactory.getSessionFactory();
      ConnectionProvider connectionProvider = sessionFactory.getConnectionProvider();
      connection = connectionProvider.getConnection();
      Statement statement = connection.createStatement();
      log("shutting down database");
      statement.executeUpdate("SHUTDOWN");
      connection.close();
View Full Code Here

    Properties copy = new Properties();
    copy.putAll( properties );
    PropertiesHelper.resolvePlaceHolders( copy );
    Settings settings = buildSettings( copy );

    return new SessionFactoryImpl(
        this,
        mapping,
        settings,
        getInitializedEventListeners(),
        sessionFactoryObserver
View Full Code Here

    Properties copy = new Properties();
    copy.putAll( properties );
    PropertiesHelper.resolvePlaceHolders( copy );
    Settings settings = buildSettings( copy );

    return new SessionFactoryImpl(
        this,
        mapping,
        settings,
        getInitializedEventListeners(),
        sessionFactoryObserver
View Full Code Here

    Properties copy = new Properties();
    copy.putAll( properties );
    ConfigurationHelper.resolvePlaceHolders( copy );
    Settings settings = buildSettings( copy, serviceRegistry );

    return new SessionFactoryImpl(
        this,
        mapping,
        serviceRegistry,
        settings,
        getInitializedEventListeners(),
View Full Code Here

   
    return PageQueryUtils.pageQuery(getHibernateTemplate(),pageRequest,queryXsqlResult,countQueryXsqlResult);
  }
 
  protected XsqlBuilder getXsqlBuilder() {
    SessionFactoryImpl sf = (SessionFactoryImpl)(getSessionFactory());
    Dialect dialect = sf.getDialect();
   
    //or SafeSqlProcesserFactory.getMysql();
    SafeSqlProcesser safeSqlProcesser = SafeSqlProcesserFactory.getFromCacheByHibernateDialect(dialect);
    XsqlBuilder builder = new XsqlBuilder(safeSqlProcesser);
   
View Full Code Here

    Properties copy = new Properties();
    copy.putAll( properties );
    PropertiesHelper.resolvePlaceHolders( copy );
    Settings settings = buildSettings( copy );

    return new SessionFactoryImpl(
        this,
        mapping,
        settings,
        getInitializedEventListeners(),
        sessionFactoryObserver
View Full Code Here

    preCollectionRemoveListener = new PreCollectionRemoveListener( this );
    preCollectionUpdateListener = new PreCollectionUpdateListener( this );
    postCollectionRecreateListener = new PostCollectionRecreateListener( this );
    postCollectionRemoveListener = new PostCollectionRemoveListener( this );
    postCollectionUpdateListener = new PostCollectionUpdateListener( this );
    SessionFactoryImpl impl = ( SessionFactoryImpl ) sf;
    impl.getEventListeners().setInitializeCollectionEventListeners(
        new InitializeCollectionEventListener[] { initializeCollectionListener }
    );
    impl.getEventListeners().setPreCollectionRecreateEventListeners(
        new PreCollectionRecreateEventListener[] { preCollectionRecreateListener }
    );
    impl.getEventListeners().setPostCollectionRecreateEventListeners(
        new PostCollectionRecreateEventListener[] { postCollectionRecreateListener }
    );
    impl.getEventListeners().setPreCollectionRemoveEventListeners(
        new PreCollectionRemoveEventListener[] { preCollectionRemoveListener }
    );
    impl.getEventListeners().setPostCollectionRemoveEventListeners(
        new PostCollectionRemoveEventListener[] { postCollectionRemoveListener }
    );
    impl.getEventListeners().setPreCollectionUpdateEventListeners(
        new PreCollectionUpdateEventListener[] { preCollectionUpdateListener }
    );
    impl.getEventListeners().setPostCollectionUpdateEventListeners(
        new PostCollectionUpdateEventListener[] { postCollectionUpdateListener }
    );
  }
View Full Code Here

        getServletContext().setAttribute("started", new DateTime().toString("dd/MM/yyyy hh:mm:ss (ZZZ)"));

        ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(getServletContext());

        PostPersistenceEventListener selectingListener = (PostPersistenceEventListener) context.getBean("selectingPostPersistenceEventListener");
        SessionFactoryImpl sessionFactoryBean = (SessionFactoryImpl) context.getBean("sessionFactory");
        sessionFactoryBean.getEventListeners().setPostDeleteEventListeners(new PostDeleteEventListener[]{selectingListener});
        sessionFactoryBean.getEventListeners().setPostUpdateEventListeners(new PostUpdateEventListener[]{selectingListener});
        sessionFactoryBean.getEventListeners().setPostInsertEventListeners(new PostInsertEventListener[]{selectingListener});

        AuditingPostPersistenceEventListener listener = (AuditingPostPersistenceEventListener) context.getBean("auditLoggingPostPersistenceEventListener");
        SessionContextProvider provider = (SessionContextProvider) context.getBean("webSessionPersistenceContextProvider");
        listener.setSessionContextProvider(provider);
    }
View Full Code Here

    Properties copy = new Properties();
    copy.putAll( properties );
    PropertiesHelper.resolvePlaceHolders( copy );
    Settings settings = buildSettings( copy );

    return new SessionFactoryImpl(
        this,
        mapping,
        settings,
        getInitializedEventListeners(),
        sessionFactoryObserver
View Full Code Here

TOP

Related Classes of org.hibernate.impl.SessionFactoryImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.