2 Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
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.
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.
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
18 package com.mysql.clusterj.core.spi;
20 import com.mysql.clusterj.Session;
21 import com.mysql.clusterj.core.store.Dictionary;
22 import com.mysql.clusterj.core.store.Index;
23 import com.mysql.clusterj.core.store.IndexOperation;
24 import com.mysql.clusterj.core.store.IndexScanOperation;
25 import com.mysql.clusterj.core.store.Operation;
26 import com.mysql.clusterj.core.store.ResultData;
27 import com.mysql.clusterj.core.store.ScanOperation;
28 import com.mysql.clusterj.core.store.Table;
29 import com.mysql.clusterj.query.QueryDomainType;
31 import java.util.BitSet;
36 public interface SessionSPI extends Session {
38 <T> T initializeFromDatabase(
39 DomainTypeHandler<T> domainTypeHandler, T object,
40 ValueHandler valueHandler, ValueHandler createKeyValueHandler);
42 public ResultData selectUnique(DomainTypeHandler<?> domainTypeHandler,
43 ValueHandler keyHandler, BitSet fields);
45 Operation insert(DomainTypeHandler<?> domainTypeHandler, ValueHandler valueHandler);
47 Operation update(DomainTypeHandler<?> domainTypeHandler, ValueHandler valueHandler);
49 Operation delete(DomainTypeHandler<?> domainTypeHandler, ValueHandler valueHandler);
51 int deletePersistentAll(DomainTypeHandler<?> domainTypeHandler);
53 int deletePersistentAll(ScanOperation op, boolean abort);
61 void setRollbackOnly();
63 boolean getRollbackOnly();
65 void startAutoTransaction();
67 void endAutoTransaction();
69 void failAutoTransaction();
71 void executeNoCommit();
73 void executeNoCommit(boolean abort, boolean force);
75 Operation getSelectOperation(Table storeTable);
77 Operation getDeleteOperation(Table storeTable);
79 IndexOperation getUniqueIndexOperation(Index storeIndex, Table storeTable);
81 IndexOperation getUniqueIndexDeleteOperation(Index storeIndex, Table storeTable);
83 IndexScanOperation getIndexScanOperation(Index storeIndex, Table storeTable);
85 IndexScanOperation getIndexScanDeleteOperation(Index storeIndex, Table storeTable);
87 IndexScanOperation getIndexScanOperationMultiRange(Index storeIndex, Table storeTable);
89 ScanOperation getTableScanOperation(Table storeTable);
91 ScanOperation getTableScanDeleteOperation(Table storeTable);
93 Dictionary getDictionary();
95 <T> QueryDomainType<T> createQueryDomainType(DomainTypeHandler<T> handler);
97 String getCoordinatedTransactionId();
99 void setCoordinatedTransactionId(String coordinatedTransactionId);
101 boolean isEnlisted();