01: /*
02: * The contents of this file are subject to the terms of the Common Development
03: * and Distribution License (the License). You may not use this file except in
04: * compliance with the License.
05: *
06: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
07: * or http://www.netbeans.org/cddl.txt.
08: *
09: * When distributing Covered Code, include this CDDL Header Notice in each file
10: * and include the License file at http://www.netbeans.org/cddl.txt.
11: * If applicable, add the following below the CDDL Header, with the fields
12: * enclosed by brackets [] replaced by your own identifying information:
13: * "Portions Copyrighted [year] [name of copyright owner]"
14: *
15: * The Original Software is NetBeans. The Initial Developer of the Original
16: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17: * Microsystems, Inc. All Rights Reserved.
18: */
19: package org.netbeans.modules.sql.framework.codegen.base;
20:
21: import java.util.HashMap;
22: import java.util.Map;
23: import org.netbeans.modules.sql.framework.codegen.AbstractDB;
24: import org.netbeans.modules.sql.framework.codegen.AbstractGeneratorFactory;
25: import org.netbeans.modules.sql.framework.model.SQLConstants;
26:
27: /**
28: * @author Ritesh Adval
29: * @author Ahimanikya Satapathy
30: * @version $Revision$
31: */
32: public class BaseGeneratorFactory extends AbstractGeneratorFactory {
33:
34: public BaseGeneratorFactory(AbstractDB database) {
35: super (database);
36: }
37:
38: public Map<Integer, String> initializeObjectToGeneratorMap() {
39: Map<Integer, String> map = new HashMap<Integer, String>();
40: map
41: .put(new Integer(SQLConstants.SOURCE_COLUMN),
42: "org.netbeans.modules.sql.framework.codegen.base.BaseColumnGenerator");
43: map
44: .put(new Integer(SQLConstants.TARGET_COLUMN),
45: "org.netbeans.modules.sql.framework.codegen.base.BaseColumnGenerator");
46: map
47: .put(new Integer(SQLConstants.COLUMN_REF),
48: "org.netbeans.modules.sql.framework.codegen.base.BaseConditionColumnGenerator");
49: map
50: .put(new Integer(SQLConstants.SOURCE_TABLE),
51: "org.netbeans.modules.sql.framework.codegen.base.BaseSourceTableGenerator");
52: map
53: .put(new Integer(SQLConstants.TARGET_TABLE),
54: "org.netbeans.modules.sql.framework.codegen.base.BaseTargetTableGenerator");
55: map
56: .put(new Integer(SQLConstants.JOIN),
57: "org.netbeans.modules.sql.framework.codegen.base.BaseJoinGenerator");
58: map
59: .put(new Integer(SQLConstants.VISIBLE_PREDICATE),
60: "org.netbeans.modules.sql.framework.codegen.base.BaseOperatorGenerator");
61: map
62: .put(new Integer(SQLConstants.PREDICATE),
63: "org.netbeans.modules.sql.framework.codegen.base.BaseOperatorGenerator");
64: map
65: .put(new Integer(SQLConstants.VISIBLE_LITERAL),
66: "org.netbeans.modules.sql.framework.codegen.base.BaseLiteralGenerator");
67: map
68: .put(new Integer(SQLConstants.LITERAL),
69: "org.netbeans.modules.sql.framework.codegen.base.BaseLiteralGenerator");
70: map
71: .put(new Integer(SQLConstants.GENERIC_OPERATOR),
72: "org.netbeans.modules.sql.framework.codegen.base.BaseOperatorGenerator");
73: map
74: .put(new Integer(SQLConstants.CUSTOM_OPERATOR),
75: "org.netbeans.modules.sql.framework.codegen.base.BaseOperatorGenerator");
76: map
77: .put(
78: new Integer(
79: SQLConstants.DATE_ARITHMETIC_OPERATOR),
80: "org.netbeans.modules.sql.framework.codegen.base.BaseOperatorGenerator");
81: map
82: .put(new Integer(SQLConstants.CASE),
83: "org.netbeans.modules.sql.framework.codegen.base.BaseCaseGenerator");
84: map
85: .put(
86: new Integer(SQLConstants.DATE_ADD_OPERATOR),
87: "org.netbeans.modules.sql.framework.codegen.base.BaseDateArithmeticOperatorGenerator");
88: map
89: .put(
90: new Integer(SQLConstants.DATE_DIFF_OPERATOR),
91: "org.netbeans.modules.sql.framework.codegen.base.BaseDateArithmeticOperatorGenerator");
92: map
93: .put(new Integer(SQLConstants.CAST_OPERATOR),
94: "org.netbeans.modules.sql.framework.codegen.base.BaseCastAsOperatorGenerator");
95: return map;
96: }
97: }
|