Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.api / src / main / java / org / gvsig / fmap / dal / feature / ForeingKey.java @ 45739

History | View | Annotate | Download (2.56 KB)

1
package org.gvsig.fmap.dal.feature;
2

    
3
import java.util.List;
4
import org.gvsig.expressionevaluator.Expression;
5
import org.gvsig.expressionevaluator.SymbolTable;
6
import org.gvsig.fmap.dal.StoresRepository;
7
import org.gvsig.fmap.dal.expressionevaluator.FeatureSymbolTable;
8
import org.gvsig.tools.dispose.Disposable;
9
import org.gvsig.tools.dynobject.DynObject;
10
import org.gvsig.tools.dynobject.DynObjectValueItem;
11

    
12
/**
13
 *
14
 * @author jjdelcerro
15
 */
16
public interface ForeingKey {
17

    
18
    public static final int MAX_AVAILABLE_VALUES = 1000;
19
    
20
    public interface ContextForeingKey extends Disposable {
21
        public StoresRepository getStoresRepository();
22
        public FeatureStore getFeatureStore();
23
        public Expression getLabelExpression();
24
        public FeatureSymbolTable getFeatureSymbolTable();
25
        public SymbolTable getSymbolTable();
26
        public DynObject getContextValues();
27
        public void setContextValues(DynObject values);
28
    }
29
    
30
    public ContextForeingKey createContext();
31
    
32
    public boolean isForeingKey();
33

    
34
    /**
35
     * Indicates whether the foreign key reference to a closed list of values.
36
     * 
37
     * @return 
38
     */
39
    public boolean isClosedList();
40
    
41
    public String getTableName();
42

    
43
    public String getCodeName();
44

    
45
    public String getLabelFormula();
46

    
47
    
48
    public boolean isEmpty();
49

    
50
    public Object getCode(ContextForeingKey context, Feature feature);
51

    
52
    public Feature getFeature(ContextForeingKey context, Object codeValue);
53

    
54
    public FeatureStore getFeatureStore(ContextForeingKey context);
55

    
56
    public FeatureType getFeatureType(ContextForeingKey context);
57

    
58
    public List<Feature> getFeatures(ContextForeingKey context);
59

    
60
    public String getLabel(ContextForeingKey context, Object codeValue);
61

    
62
    public String getLabel(ContextForeingKey context, Feature feature);
63

    
64
    public Expression getLabelExpression(ContextForeingKey context);
65

    
66
    public FeatureQuery getQuery(ContextForeingKey context, Object codeValue);
67

    
68
    public StoresRepository getStoresRepository(ContextForeingKey context);
69

    
70
    public DynObjectValueItem[] getAvailableValues(ContextForeingKey context);
71
    
72
    public String getLabelForValue(Object value);
73

    
74
    public boolean getEnsureReferentialIntegrity();
75
    
76
    public boolean isInAvailableValues(Object valueToCheck);
77
    
78
    public boolean hasAvailableValues();
79
    
80
    /**
81
     * If the data store supports it, it ensures that referential integrity is respected.
82
     * 
83
     * @param ensureReferentialIntegrity 
84
     */
85
    public void setEnsureReferentialIntegrity(boolean ensureReferentialIntegrity);
86
}