EMMA Coverage Report (generated Fri Jan 30 13:20:29 EST 2009)
[all classes][org.springframework.batch.core.repository.dao]

COVERAGE SUMMARY FOR SOURCE FILE [AbstractJdbcBatchMetadataDao.java]

nameclass, %method, %block, %line, %
AbstractJdbcBatchMetadataDao.java100% (1/1)100% (7/7)100% (30/30)100% (11/11)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AbstractJdbcBatchMetadataDao100% (1/1)100% (7/7)100% (30/30)100% (11/11)
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)
getTablePrefix (): String 100% (1/1)100% (3/3)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        public static final int DEFAULT_EXIT_MESSAGE_LENGTH = 2500;
22 
23        private String tablePrefix = DEFAULT_TABLE_PREFIX;
24 
25        private JdbcOperations jdbcTemplate;
26 
27        protected String getQuery(String base) {
28                return StringUtils.replace(base, "%PREFIX%", tablePrefix);
29        }
30        
31        protected String getTablePrefix() {
32                return tablePrefix;
33        }
34 
35        /**
36         * Public setter for the table prefix property. This will be prefixed to all
37         * the table names before queries are executed. Defaults to
38         * {@link #DEFAULT_TABLE_PREFIX}.
39         * 
40         * @param tablePrefix the tablePrefix to set
41         */
42        public void setTablePrefix(String tablePrefix) {
43                this.tablePrefix = tablePrefix;
44        }
45 
46        public void setJdbcTemplate(JdbcOperations jdbcTemplate) {
47                this.jdbcTemplate = jdbcTemplate;
48        }
49 
50        protected JdbcOperations getJdbcTemplate() {
51                return jdbcTemplate;
52        }
53 
54        public void afterPropertiesSet() throws Exception {
55                Assert.notNull(jdbcTemplate);
56        }
57 
58}

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