01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) Copyright IBM Corporation, 2005. All rights reserved.
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: */
17: package org.geotools.data.db2;
18:
19: import org.geotools.data.jdbc.fidmapper.NullFIDMapper;
20: import java.util.logging.Logger;
21:
22: /**
23: * Overrides NullFIDMapper methods for DB2-specific handling.
24: *
25: * @author David Adler - IBM Corporation
26: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/unsupported/db2/src/main/java/org/geotools/data/db2/DB2NullFIDMapper.java $
27: */
28: public class DB2NullFIDMapper extends NullFIDMapper {
29: private static final Logger LOGGER = org.geotools.util.logging.Logging
30: .getLogger("org.geotools.data.db2");
31: private int currentFID = 1;
32:
33: /**
34: * Default constructor.
35: */
36: public DB2NullFIDMapper() {
37: super ();
38: }
39:
40: /**
41: * Constructor to set schema and table name for Null mapper.
42: *
43: * @param tableSchemaName
44: * @param tableName
45: */
46: public DB2NullFIDMapper(String tableSchemaName, String tableName) {
47: super (tableSchemaName, tableName);
48: }
49:
50: /**
51: * @see org.geotools.data.jdbc.fidmapper.FIDMapper#getID(java.lang.Object[])
52: */
53: public String getID(Object[] attributes) {
54: currentFID++;
55:
56: return String.valueOf(currentFID);
57: }
58: }
|