Examples of openSession()


Examples of org.apache.ibatis.session.SqlSessionFactory.openSession()

        }
    }

    private void doSelectOne(Exchange exchange) throws Exception {
        SqlSessionFactory client = endpoint.getSqlSessionFactory();
        SqlSession session = client.openSession();
        try {
            Object result;
            Object in = exchange.getIn().getBody();
            if (in != null) {
                if (LOG.isTraceEnabled()) {
View Full Code Here

Examples of org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSession()

  @Test(expected = BindingException.class)
  public void shouldFailSelectOneAuthorUsingMapperClassWithTwoResultHandlers() {
    Configuration configuration = new Configuration(sqlMapper.getConfiguration().getEnvironment());
    configuration.addMapper(AuthorMapperWithMultipleHandlers.class);
    SqlSessionFactory sqlMapperWithMultipleHandlers = new DefaultSqlSessionFactory(configuration);
    SqlSession sqlSession = sqlMapperWithMultipleHandlers.openSession();
    try {
      DefaultResultHandler handler1 = new DefaultResultHandler();
      DefaultResultHandler handler2 = new DefaultResultHandler();
      AuthorMapperWithMultipleHandlers mapper = sqlSession.getMapper(AuthorMapperWithMultipleHandlers.class);
      mapper.selectAuthor(101, handler1, handler2);
View Full Code Here

Examples of org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManagerFactory.openSession()

      dbEntityManger.insert(hpi);
      dbEntityManger.flush();

      monitor.sync();

      DbEntityManager dbEntityManager = dbEntityManagerFactory.openSession();
      dbEntityManager.createHistoricProcessInstanceQuery().list();

      monitor.sync();

      return null;
View Full Code Here

Examples of org.chromattic.api.Chromattic.openSession()

   }

   public GadgetRegistry getRegistry()
   {
      Chromattic chromattic = chromatticLifeCycle.getChromattic();
      ChromatticSession session = chromattic.openSession();
      GadgetRegistry registry = session.findByPath(GadgetRegistry.class, "app:gadgets");
      if (registry == null)
      {
         registry = session.insert(GadgetRegistry.class, "app:gadgets");
      }
View Full Code Here

Examples of org.chromattic.api.Chromattic.openSession()

         // No context should be open
         assertNull(test1LF.getContext(true));

         // Opens a session with the provided Chromattic
         ChromatticSession session = chromattic.openSession();

         // Now we should have a context
         SessionContext context = test1LF.getContext(true);
         assertNotNull(context);
View Full Code Here

Examples of org.compass.core.Compass.openSession()

    }

    public <T extends Model> Page<T> search(String queryString,PageCriteria pageCriteria,Class<T> modelClass){
        List<T> result =  new ArrayList<>();
        Compass compass = compassTemplate.getCompass();
        CompassSession session=compass.openSession();
        CompassHits hits=  session.find(queryString);
        LOG.info("命中:"+hits.getLength());
        LOG.info("查询字符串:"+queryString);
        if(pageCriteria!=null){
            int start = (pageCriteria.getPage()-1) * pageCriteria.getSize();
 
View Full Code Here

Examples of org.hibernate.SessionBuilder.openSession()

        catch (ClassCastException e) {
          throw new PersistenceException("Session interceptor does not implement Interceptor: " + sessionInterceptorClass, e);
        }
      }
      sessionBuilder.autoJoinTransactions( getTransactionType() != PersistenceUnitTransactionType.JTA );
      session = sessionBuilder.openSession();
      if ( persistenceContextType == PersistenceContextType.TRANSACTION ) {
        ( (SessionImplementor) session ).setAutoClear( true );
      }
    }
    return session;
View Full Code Here

Examples of org.hibernate.SessionBuilder.openSession()

        catch (ClassCastException e) {
          throw new PersistenceException("Session interceptor does not implement Interceptor: " + sessionInterceptorClass, e);
        }
      }
      sessionBuilder.autoJoinTransactions( getTransactionType() != PersistenceUnitTransactionType.JTA );
      session = sessionBuilder.openSession();
      if ( persistenceContextType == PersistenceContextType.TRANSACTION ) {
        ( (SessionImplementor) session ).setAutoClear( true );
      }
    }
    return session;
View Full Code Here

Examples of org.hibernate.SessionFactory.openSession()

  private static Session createSession()
  {
    SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
   
    return sessionFactory.openSession();
  }

}
View Full Code Here

Examples of org.hibernate.SessionFactory.openSession()

    // open the hibernate-session
    Session session = null;
    if (connectionName!=null) {
      Connection connection = (Connection) wireContext.get(connectionName);
      log.finest("creating hibernate session with connection "+connection);
      session = sessionFactory.openSession(connection);

    } else {
      log.finest("creating hibernate session");
      session = sessionFactory.openSession();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.