01: package com.completex.objective.components.persistency.key;
02:
03: /**
04: * @author Gennady Krizhevsky
05: */
06: public interface OdalKeyPolicy {
07:
08: /**
09: * Defines when the priority is not to be used
10: */
11: public static final int DISABLED_PRIORITY = -1;
12: /**
13: * Default priorities. Priority is considered to be higher the higher its number is.
14: */
15: public static final int DEFAULT_ODAL_KEY_PRIORITY = 20;
16: public static final int DEFAULT_SEQUENCE_PRIORITY = 10;
17: public static final int DEFAULT_IDENTITY_PRIORITY = 0;
18:
19: /**
20: * Returns identity (or auto-increment field) priority
21: *
22: * @return identity (or auto-increment field) priority
23: */
24: int getIdentityPriority();
25:
26: /**
27: * Returns odal key - when sequence is generated using "odal_sequnce" table - priority
28: *
29: * @return odal key - when sequence is generated using "odal_sequnce" table - priority
30: */
31: int getOdalKeyPriority();
32:
33: /**
34: * Returns sequence - when sequence is generated using database sequnce - priority
35: *
36: * @return sequence - when sequence is generated using database sequnce - priority
37: */
38: int getSequencePriority();
39:
40: /**
41: * Returns true if identity priority is disabled (set to DISABLED_PRIORITY)
42: *
43: * @return true if identity priority is disabled (set to DISABLED_PRIORITY)
44: */
45: boolean isIdentityPriorityDisabled();
46:
47: /**
48: * Returns true if odal key priority is disabled (set to DISABLED_PRIORITY)
49: *
50: * @return true if odal key priority is disabled (set to DISABLED_PRIORITY)
51: */
52: boolean isOdalKeyPriorityDisabled();
53:
54: /**
55: * Returns true if sequence priority is disabled (set to DISABLED_PRIORITY).
56: * Normally it would invalidate the policy.
57: *
58: * @return true if sequence priority is disabled (set to DISABLED_PRIORITY)
59: */
60: boolean isSequencePriorityDisabled();
61:
62: /**
63: * Returns true if all the priorities are disabled (set to DISABLED_PRIORITY)
64: *
65: * @return true if all the priorities are disabled (set to DISABLED_PRIORITY)
66: */
67: boolean isDisabled();
68:
69: }
|