public OptimizeManager getOptimizeManager() { return getSession(OptimizeManager.class); } }
protected <T extends Session> T spyOnSession(CommandContext commandContext, Class<T> sessionClass) { T manager = commandContext.getSession(sessionClass); T spy = spy(manager); commandContext.getSessions().put(sessionClass, spy); return spy; }
public OptimizeManager getOptimizeManager() { return getSession(OptimizeManager.class); } }
public ProcessDefinitionManager getProcessDefinitionManager() { return getSession(ProcessDefinitionManager.class); }
public Object execute(CommandContext commandContext) { commandContext .getSession(PersistenceSession.class) .dbSchemaPrune(); return null; } });
public Object execute(CommandContext commandContext) { commandContext .getSession(PersistenceSession.class) .dbSchemaDrop(); return null; } });
public Object execute(CommandContext commandContext) { commandContext .getSession(PersistenceSession.class) .dbSchemaDrop(); return null; } });
public Object execute(CommandContext commandContext) { commandContext .getSession(PersistenceSession.class) .dbSchemaPrune(); return null; } });
public Object execute(CommandContext commandContext) { commandContext.getSession(PersistenceSession.class).dbSchemaCreate(); return null; } });
public Object execute(CommandContext commandContext) { commandContext.getSession(PersistenceSession.class).dbSchemaCreate(); return null; } });
private Object findEntity(Class< ? > entityClass, Object primaryKey) { EntityManager em = Context .getCommandContext() .getSession(EntityManagerSession.class) .getEntityManager(); Object entity = em.find(entityClass, primaryKey); ensureNotNull("Entity does not exist: " + entityClass.getName() + " - " + primaryKey, "entity", entity); return entity; }
private Object findEntity(Class< ? > entityClass, Object primaryKey) { EntityManager em = Context .getCommandContext() .getSession(EntityManagerSession.class) .getEntityManager(); Object entity = em.find(entityClass, primaryKey); ensureNotNull("Entity does not exist: " + entityClass.getName() + " - " + primaryKey, "entity", entity); return entity; }
public DbEntityManager openSession() { PersistenceSession persistenceSession = Context.getCommandContext().getSession(PersistenceSession.class); return new DbEntityManager(idGenerator, persistenceSession); }
public DbEntityManager openSession() { PersistenceSession persistenceSession = Context.getCommandContext().getSession(PersistenceSession.class); return new DbEntityManager(idGenerator, persistenceSession); }
public Object execute(CommandContext commandContext) { String databaseSchemaUpdate = Context.getProcessEngineConfiguration().getDatabaseSchemaUpdate(); if (ProcessEngineConfiguration.DB_SCHEMA_UPDATE_CREATE_DROP.equals(databaseSchemaUpdate)) { commandContext.getSession(PersistenceSession.class).dbSchemaDrop(); } return null; } }
public Object execute(CommandContext commandContext) { String databaseSchemaUpdate = Context.getProcessEngineConfiguration().getDatabaseSchemaUpdate(); if (ProcessEngineConfiguration.DB_SCHEMA_UPDATE_CREATE_DROP.equals(databaseSchemaUpdate)) { commandContext.getSession(PersistenceSession.class).dbSchemaDrop(); } return null; } }
public Void execute(CommandContext commandContext) { DbSqlSession sqlSession = commandContext.getSession(DbSqlSession.class); assertTrue(sqlSession.isTablePresent("SOME_TABLE")); return null; } });
public static void dbCreateHistoryLevel(CommandContext commandContext) { ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); HistoryLevel configuredHistoryLevel = processEngineConfiguration.getHistoryLevel(); PropertyEntity property = new PropertyEntity("historyLevel", Integer.toString(configuredHistoryLevel.getId())); commandContext.getSession(DbEntityManager.class).insert(property); LOG.creatingHistoryLevelPropertyInDatabase(configuredHistoryLevel); }
public static void dbCreateHistoryLevel(CommandContext commandContext) { ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); HistoryLevel configuredHistoryLevel = processEngineConfiguration.getHistoryLevel(); PropertyEntity property = new PropertyEntity("historyLevel", Integer.toString(configuredHistoryLevel.getId())); commandContext.getSession(DbEntityManager.class).insert(property); LOG.creatingHistoryLevelPropertyInDatabase(configuredHistoryLevel); }
public Object execute(CommandContext commandContext) { PersistenceSession persistenceSession = commandContext.getSession(PersistenceSession.class); persistenceSession.dbSchemaDrop(); persistenceSession.dbSchemaCreate(); HistoryLevelSetupCommand.dbCreateHistoryLevel(commandContext); return null; } });