01: /**
02: * Objective Database Abstraction Layer (ODAL)
03: * Copyright (c) 2004, The ODAL Development Group
04: * All rights reserved.
05: * For definition of the ODAL Development Group please refer to LICENCE.txt file
06: *
07: * Distributable under LGPL license.
08: * See terms of license at gnu.org.
09: */package com.completex.objective.components.persistency;
10:
11: import com.completex.objective.components.persistency.key.SimpleNaturalKeyFactory;
12:
13: import java.util.HashMap;
14: import java.util.Map;
15:
16: /**
17: * @author Gennady Krizhevsky
18: */
19: public class MetaNaturalKeyFactory {
20:
21: public static final String TAG_SIMPLE_FACTORY_CLASS_NAME = "simpleFactoryClassName";
22: public static final String TAG_COMPOUND_FACTORY_CLASS_NAME = "compoundFactoryClassName";
23:
24: public static final MetaNaturalKeyFactory NULL_NATURAL_KEY_FACTORY = new MetaNaturalKeyFactory();
25:
26: private String simpleFactoryClassName;
27: private String compoundFactoryClassName;
28:
29: private SimpleNaturalKeyFactory simpleNaturalKeyFactory;
30:
31: public MetaNaturalKeyFactory() {
32: }
33:
34: public MetaNaturalKeyFactory(Map map) {
35: fromMap(map);
36: }
37:
38: public String getSimpleFactoryClassName() {
39: return simpleFactoryClassName;
40: }
41:
42: public void setSimpleFactoryClassName(String simpleFactoryClassName) {
43: this .simpleFactoryClassName = simpleFactoryClassName;
44: }
45:
46: public String getCompoundFactoryClassName() {
47: return compoundFactoryClassName;
48: }
49:
50: public void setCompoundFactoryClassName(
51: String compoundFactoryClassName) {
52: this .compoundFactoryClassName = compoundFactoryClassName;
53: }
54:
55: public SimpleNaturalKeyFactory getSimpleNaturalKeyFactory() {
56: return simpleNaturalKeyFactory;
57: }
58:
59: public void setSimpleNaturalKeyFactory(
60: SimpleNaturalKeyFactory simpleNaturalKeyFactory) {
61: this .simpleNaturalKeyFactory = simpleNaturalKeyFactory;
62: }
63:
64: public Map toMap() {
65: HashMap map = new HashMap();
66: map.put(TAG_SIMPLE_FACTORY_CLASS_NAME, simpleFactoryClassName);
67: return map;
68: }
69:
70: public void fromMap(Map map) {
71: simpleFactoryClassName = (String) map
72: .get(TAG_SIMPLE_FACTORY_CLASS_NAME);
73: }
74:
75: }
|