------------------------------------------------------------
revno: 132
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: ndbjmerge
timestamp: Fri 2007-06-29 08:17:26 -0700
message:
Fixed mapping problem with NDB/J ExecType enum to NdbApi ExecType enum
ndbj.BasicTest runs now!
modified:
java/com/mysql/cluster/ndbj/NdbTransaction.java
ndbtransaction.java-20070517181935-98huwjarzuh25b30-27
java/com/mysql/cluster/ndbj/NdbTransactionImpl.java
ndbtransactionimpl.j-20070517181935-98huwjarzuh25b30-28
java/testsuite/ndbj/BasicTest.java basictest.java-20070529154705-qmbr2wjlqu4mcnay-1
swig/ndbglobals.i globals.i-20070228021421-qkr4cbpxymyqdrf3-7
=== modified file 'java/com/mysql/cluster/ndbj/NdbTransaction.java'
--- a/java/com/mysql/cluster/ndbj/NdbTransaction.java 2007-05-20 09:20:25 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbTransaction.java 2007-06-29 15:17:26 +0000
@@ -88,6 +88,9 @@
{
this.type=type;
}
+ public int getEnumValue() {
+ return this.type;
+ }
};
@@ -117,6 +120,10 @@
{
this.type=type;
}
+ public int getEnumValue() {
+ return this.type;
+ }
+
};
=== modified file 'java/com/mysql/cluster/ndbj/NdbTransactionImpl.java'
--- a/java/com/mysql/cluster/ndbj/NdbTransactionImpl.java 2007-05-25 00:08:44 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbTransactionImpl.java 2007-06-29 15:17:26 +0000
@@ -107,10 +107,10 @@
public void execute(ExecType execType, AbortOption abortOption,
boolean force) throws NdbApiException {
isValid();
-
+
transRef.execute(
- com.mysql.cluster.ndbapi.ExecType.swigToEnum(execType.ordinal()),
- com.mysql.cluster.ndbapi.AbortOption.swigToEnum(abortOption.ordinal()),
+ com.mysql.cluster.ndbapi.ExecType.swigToEnum(execType.getEnumValue()),
+ com.mysql.cluster.ndbapi.AbortOption.swigToEnum(abortOption.getEnumValue()),
force);
if (execType == NdbTransaction.ExecType.Commit) {
@@ -302,8 +302,8 @@
public int execute(ExecType execType, AbortOption abortOption)
throws NdbApiException {
return transRef.execute(
- com.mysql.cluster.ndbapi.ExecType.swigToEnum(execType.ordinal()),
- com.mysql.cluster.ndbapi.AbortOption.swigToEnum(abortOption.ordinal())
+ com.mysql.cluster.ndbapi.ExecType.swigToEnum(execType.getEnumValue()),
+ com.mysql.cluster.ndbapi.AbortOption.swigToEnum(abortOption.getEnumValue())
);
}
@@ -315,7 +315,7 @@
*/
public int execute(ExecType execType) throws NdbApiException {
return transRef.execute(
- com.mysql.cluster.ndbapi.ExecType.swigToEnum(execType.ordinal()));
+ com.mysql.cluster.ndbapi.ExecType.swigToEnum(execType.getEnumValue()));
}
@@ -330,9 +330,9 @@
public void executeAsynchPrepare(ExecType execType, BaseCallback cb,
AbortOption abortOption) {
transRef.executeAsynchPrepare(
- com.mysql.cluster.ndbapi.ExecType.swigToEnum(execType.ordinal()),
+ com.mysql.cluster.ndbapi.ExecType.swigToEnum(execType.getEnumValue()),
cb,
- com.mysql.cluster.ndbapi.AbortOption.swigToEnum(abortOption.ordinal()));
+ com.mysql.cluster.ndbapi.AbortOption.swigToEnum(abortOption.getEnumValue()));
}
@@ -344,7 +344,7 @@
*/
public void executeAsynchPrepare(ExecType execType, BaseCallback cb) {
transRef.executeAsynchPrepare(
- com.mysql.cluster.ndbapi.ExecType.swigToEnum(execType.ordinal()),
+ com.mysql.cluster.ndbapi.ExecType.swigToEnum(execType.getEnumValue()),
cb);
}
@@ -360,9 +360,9 @@
INdbCallable cb,
AbortOption abortOption) {
transRef.executeAsynchPrepare(
- com.mysql.cluster.ndbapi.ExecType.swigToEnum(execType.ordinal()),
+ com.mysql.cluster.ndbapi.ExecType.swigToEnum(execType.getEnumValue()),
cb,
- com.mysql.cluster.ndbapi.AbortOption.swigToEnum(abortOption.ordinal()));
+ com.mysql.cluster.ndbapi.AbortOption.swigToEnum(abortOption.getEnumValue()));
}
/**
@@ -374,7 +374,7 @@
public void executeAsynchPrepare(ExecType execType,
com.mysql.cluster.ndbapi.INdbCallable cb) {
transRef.executeAsynchPrepare(
- com.mysql.cluster.ndbapi.ExecType.swigToEnum(execType.ordinal()),
+ com.mysql.cluster.ndbapi.ExecType.swigToEnum(execType.getEnumValue()),
cb);
}
=== modified file 'java/testsuite/ndbj/BasicTest.java'
--- a/java/testsuite/ndbj/BasicTest.java 2007-05-29 15:47:11 +0000
+++ b/java/testsuite/ndbj/BasicTest.java 2007-06-29 15:17:26 +0000
@@ -77,10 +77,9 @@
op.equal("id", 1);
op.setInt("age", 100);
trans.execute(ExecType.Commit,AbortOption.AbortOnError,false);
- //this.getSingleValue("basic_test", "age", "where id=1");
-
- int nameVal = (Integer)this.getSingleValueWithQuery("select age from basic_test where
id=1");
-
+ int nameVal = (Integer)this.getSingleValue("basic_test", "age", "where id=1");
+
+
assertEquals(nameVal,100);
System.out.println("Test done");
}
=== modified file 'swig/ndbglobals.i'
--- a/swig/ndbglobals.i 2007-06-25 16:54:09 +0000
+++ b/swig/ndbglobals.i 2007-06-29 15:17:26 +0000
@@ -75,10 +75,10 @@
enum ExecType {
NoExecTypeDef = -1,
- Prepare,
- NoCommit,
- Commit,
- Rollback
+ Prepare = 0,
+ NoCommit = 1,
+ Commit = 2,
+ Rollback = 3
};
enum NdbException {
| Thread |
|---|
| • Rev 132: Fixed mapping problem with NDB/J ExecType enum to NdbApi ExecType enum in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmerg... | Monty Taylor | 29 Jun |