public class BatchDao extends Object
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"
scope="singleton">
<constructor-arg ref="dataSource" />
</bean>
<bean id="batchDao" class="net.sf.appstatus.batch.jdbc.BatchDao"
scope="singleton"> <property name="jdbcTemplate" ref="jdbcTemplate" />
</bean>
<bean id="jdbcBatchManager"
class="net.sf.appstatus.batch.jdbc.JdbcBatchManager" scope="singleton">
<property name="batchDao" ref="batchDao" />
</bean>
Create table: BATCH
| UUID_BATCH | varchar (256) |
| GROUP_BATCH | varchar (256) |
| NAME_BATCH | varchar (256) |
| START_DATE | DATETIME |
| END_DATE | DATETIME |
| UPDATED | DATETIME |
| STATUS | varchar (64) |
| SUCCESS | BOOLEAN |
| ITEMCOUNT | LONG |
| ITEM | varchar (256) |
| CURRENT_TASK | varchar (256) |
| PROGRESS | Float |
| REJECT | CLOB |
| LAST_MSG | varchar (1024) |
| Modifier and Type | Field and Description |
|---|---|
static int |
BATCH_CREATE_TABLE |
static int |
BATCH_DELETE |
static int |
BATCH_DELETE_OLD |
static int |
BATCH_DELETE_SUCCESS |
static int |
BATCH_FETCH |
static int |
BATCH_FETCH_BY_NAME |
static int |
BATCH_INSERT |
static int |
BATCH_UPDATE |
protected String |
tableName |
| Constructor and Description |
|---|
BatchDao() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
createDbIfNecessary()
Check for storage table and create if necessary.
|
void |
deleteBatch(String uuidBatch) |
void |
deleteOldBatches(int delay) |
void |
deleteSuccessBatches() |
List<BdBatch> |
fetch(String group,
String name,
int max) |
List<BdBatch> |
fetchError(int max) |
List<BdBatch> |
fetchFinished(int max) |
List<BdBatch> |
fetchRunning(int max) |
protected String |
getSql(int query)
Get SQL query for the requested action.
|
BdBatch |
save(BdBatch bdBatch) |
void |
setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate) |
void |
setTableName(String tableName) |
void |
update(BdBatch bdBatch) |
public static final int BATCH_FETCH
public static final int BATCH_DELETE
public static final int BATCH_DELETE_OLD
public static final int BATCH_DELETE_SUCCESS
public static final int BATCH_INSERT
public static final int BATCH_UPDATE
public static final int BATCH_CREATE_TABLE
public static final int BATCH_FETCH_BY_NAME
protected String tableName
public boolean createDbIfNecessary()
@Transactional(propagation=REQUIRES_NEW) public void deleteBatch(String uuidBatch)
@Transactional(propagation=REQUIRES_NEW) public void deleteOldBatches(int delay)
@Transactional(propagation=REQUIRES_NEW) public void deleteSuccessBatches()
protected String getSql(int query)
Override this method to adapt to a new SQL Dialect.
query - BATCH_FETCH BATCH_CREATE_TABLE@Transactional(propagation=REQUIRES_NEW) public void update(BdBatch bdBatch)
public void setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
public void setTableName(String tableName)
Copyright © 2010–2016. All rights reserved.