]> review.fuel-infra Code Review - packages/trusty/mysql-wsrep-5.6.git/blob
418592efae1c58ce1abc90c0d7334dfa1f037631
[packages/trusty/mysql-wsrep-5.6.git] /
1 /*
2    Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
3
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; version 2 of the License.
7
8    This program is distributed in the hope that it will be useful,
9    but WITHOUT ANY WARRANTY; without even the implied warranty of
10    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11    GNU General Public License for more details.
12
13    You should have received a copy of the GNU General Public License
14    along with this program; if not, write to the Free Software
15    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
16 */
17
18 package com.mysql.clusterj.core.spi;
19
20 import com.mysql.clusterj.core.CacheManager;
21 import com.mysql.clusterj.core.query.CandidateIndexImpl;
22 import com.mysql.clusterj.core.store.Column;
23 import com.mysql.clusterj.core.store.Operation;
24 import com.mysql.clusterj.core.store.PartitionKey;
25 import com.mysql.clusterj.core.store.ResultData;
26 import com.mysql.clusterj.core.store.Table;
27
28 import java.util.BitSet;
29 import java.util.Set;
30
31 /** DomainTypeHandler is the interface that must be implemented to allow core
32  * components to manage instances of a persistent class or interface.
33  *
34  */
35 public interface DomainTypeHandler<T> {
36
37     public CandidateIndexImpl[] createCandidateIndexes();
38
39     public String getName();
40
41     public Class<?> getOidClass();
42
43     public boolean isSupportedType();
44
45     public String getTableName();
46
47     public DomainFieldHandler getFieldHandler(String fieldName);
48
49     public Class<T> getProxyClass();
50
51     public T newInstance();
52
53     public ValueHandler getValueHandler(Object instance);
54
55     public T getInstance(ValueHandler handler);
56
57     public void objectMarkModified(ValueHandler handler, String fieldName);
58
59     public void objectSetValues(ResultData rs, ValueHandler handler);
60
61     public void objectSetKeys(Object keys, Object instance);
62
63     public void objectSetCacheManager(CacheManager cm, Object instance);
64
65     public void objectResetModified(ValueHandler handler);
66
67     public void operationGetValues(Operation op);
68
69     public void operationGetValues(Operation op, BitSet fields);
70
71     public void operationSetKeys(ValueHandler handler, Operation op);
72
73     public void operationSetNonPKValues(ValueHandler handler, Operation op);
74
75     public void operationSetModifiedValues(ValueHandler handler, Operation op);
76
77     public void operationSetModifiedNonPKValues(ValueHandler valueHandler, Operation op);
78
79     public ValueHandler createKeyValueHandler(Object keys);
80
81     public int[] getKeyFieldNumbers();
82
83     public Set<Column> getStoreColumns(BitSet fields);
84
85     public Table getStoreTable();
86
87     public PartitionKey createPartitionKey(ValueHandler handler);
88
89     public String[] getFieldNames();
90
91     public void operationSetValues(ValueHandler valueHandler, Operation op);
92
93 }