Project

General

Profile

Download (2.06 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9

    
10
package eu.etaxonomy.cdm.io.common.mapping.out;
11

    
12
import java.sql.Types;
13

    
14
import org.apache.log4j.Logger;
15

    
16

    
17
/**
18
 * @author a.mueller
19
 * @created 12.05.2009
20
 * @version 1.0
21
 */
22
public class DbBooleanMapper extends DbSingleAttributeExportMapperBase implements IDbExportMapper {
23
	@SuppressWarnings("unused")
24
	private static final Logger logger = Logger.getLogger(DbBooleanMapper.class);
25

    
26
	public static DbBooleanMapper NewInstance(String cdmAttributeString, String dbAttributeString){
27
		return new DbBooleanMapper(cdmAttributeString, dbAttributeString, null, false);
28
	}
29

    
30
	public static DbBooleanMapper NewInstance(String cdmAttributeString, String dbAttributeString, Boolean defaultValue){
31
		return new DbBooleanMapper(cdmAttributeString, dbAttributeString, defaultValue, false);
32
	}
33

    
34
	public static DbBooleanMapper NewFalseInstance(String cdmAttributeString, String dbAttributeString){
35
		return new DbBooleanMapper(cdmAttributeString, dbAttributeString, false, false);
36
	}
37

    
38
	public static DbBooleanMapper NewInstance(String cdmAttributeString, String dbAttributeString, Boolean defaultValue, Boolean obligatory){
39
		return new DbBooleanMapper(cdmAttributeString, dbAttributeString, false, obligatory);
40
	}
41

    
42
	/**
43
	 * @param dbAttributeString
44
	 * @param cdmAttributeString
45
	 */
46
	private DbBooleanMapper(String cdmAttributeString, String dbAttributeString, Boolean defaultValue, Boolean obligatory) {
47
		super(cdmAttributeString, dbAttributeString, defaultValue, obligatory);
48
	}
49

    
50
	/* (non-Javadoc)
51
	 * @see eu.etaxonomy.cdm.io.berlinModel.out.mapper.DbSingleAttributeExportMapperBase#getValueType()
52
	 */
53
	@Override
54
	protected int getSqlType() {
55
		return Types.BOOLEAN;
56
	}
57

    
58
	/* (non-Javadoc)
59
	 * @see eu.etaxonomy.cdm.io.common.CdmSingleAttributeMapperBase#getTypeClass()
60
	 */
61
	@Override
62
	public Class<?> getTypeClass() {
63
		return Boolean.class;
64
	}
65

    
66

    
67

    
68
}
(6-6/40)