EMMA Coverage Report (generated Tue May 06 07:29:23 PDT 2008)
[all classes][org.springframework.batch.core.repository.dao]

COVERAGE SUMMARY FOR SOURCE FILE [AbstractJdbcBatchMetadataDao.java]

nameclass, %method, %block, %line, %
AbstractJdbcBatchMetadataDao.java100% (1/1)100% (6/6)100% (27/27)100% (10/10)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AbstractJdbcBatchMetadataDao100% (1/1)100% (6/6)100% (27/27)100% (10/10)
AbstractJdbcBatchMetadataDao (): void 100% (1/1)100% (6/6)100% (2/2)
afterPropertiesSet (): void 100% (1/1)100% (4/4)100% (2/2)
getJdbcTemplate (): JdbcOperations 100% (1/1)100% (3/3)100% (1/1)
getQuery (String): String 100% (1/1)100% (6/6)100% (1/1)
setJdbcTemplate (JdbcOperations): void 100% (1/1)100% (4/4)100% (2/2)
setTablePrefix (String): void 100% (1/1)100% (4/4)100% (2/2)

1package org.springframework.batch.core.repository.dao;
2 
3import org.springframework.beans.factory.InitializingBean;
4import org.springframework.jdbc.core.JdbcOperations;
5import org.springframework.util.Assert;
6import org.springframework.util.StringUtils;
7 
8/**
9 * Encapsulates common functionality needed by JDBC batch metadata DAOs -
10 * provides jdbcTemplate for subclasses and handles table prefixes.
11 * 
12 * @author Robert Kasanicky
13 */
14public abstract class AbstractJdbcBatchMetadataDao implements InitializingBean {
15 
16        /**
17         * Default value for the table prefix property.
18         */
19        public static final String DEFAULT_TABLE_PREFIX = "BATCH_";
20 
21        private String tablePrefix = DEFAULT_TABLE_PREFIX;
22 
23        private JdbcOperations jdbcTemplate;
24 
25        protected String getQuery(String base) {
26                return StringUtils.replace(base, "%PREFIX%", tablePrefix);
27        }
28 
29        /**
30         * Public setter for the table prefix property. This will be prefixed to all
31         * the table names before queries are executed. Defaults to
32         * {@link #DEFAULT_TABLE_PREFIX}.
33         * 
34         * @param tablePrefix the tablePrefix to set
35         */
36        public void setTablePrefix(String tablePrefix) {
37                this.tablePrefix = tablePrefix;
38        }
39 
40        public void setJdbcTemplate(JdbcOperations jdbcTemplate) {
41                this.jdbcTemplate = jdbcTemplate;
42        }
43 
44        protected JdbcOperations getJdbcTemplate() {
45                return jdbcTemplate;
46        }
47 
48        public void afterPropertiesSet() throws Exception {
49                Assert.notNull(jdbcTemplate);
50        }
51 
52}

[all classes][org.springframework.batch.core.repository.dao]
EMMA 2.0.5312 (C) Vladimir Roubtsov