23 #include "helpers.hpp"
25 #include "com_mysql_cluster_crund_NdbApiLoad.h"
27 #include "CrundNdbApiOperations.hpp"
36 JNIEXPORT jint JNICALL
37 Java_com_mysql_cluster_crund_NdbApiLoad_ndbinit(JNIEnv* env,
46 const char* mgmd_cstr = env->GetStringUTFChars(mgmd_jstr, NULL);
53 env->ReleaseStringUTFChars(mgmd_jstr, mgmd_cstr);
58 JNIEXPORT jint JNICALL
59 Java_com_mysql_cluster_crund_NdbApiLoad_ndbclose(JNIEnv* env,
71 JNIEXPORT
void JNICALL
72 Java_com_mysql_cluster_crund_NdbApiLoad_initConnection(JNIEnv* env,
78 TRACE(
"initConnection()");
83 const char* catalog_cstr = env->GetStringUTFChars(catalog_jstr, NULL);
84 const char* schema_cstr = env->GetStringUTFChars(schema_jstr, NULL);
87 ops->initConnection(catalog_cstr, schema_cstr, dlm);
90 env->ReleaseStringUTFChars(schema_jstr, schema_cstr);
91 env->ReleaseStringUTFChars(catalog_jstr, catalog_cstr);
94 JNIEXPORT
void JNICALL
95 Java_com_mysql_cluster_crund_NdbApiLoad_closeConnection(JNIEnv* env,
98 TRACE(
"closeConnection()");
99 ops->closeConnection();
102 JNIEXPORT
void JNICALL
103 Java_com_mysql_cluster_crund_NdbApiLoad_clearData(JNIEnv* env,
106 TRACE(
"clearData()");
110 JNIEXPORT
void JNICALL
111 Java_com_mysql_cluster_crund_NdbApiLoad_delAllA(JNIEnv* env,
118 ops->delByScan(ops->model->table_A, count, batch == JNI_TRUE);
119 assert(count == nOps);
122 JNIEXPORT
void JNICALL
123 Java_com_mysql_cluster_crund_NdbApiLoad_delAllB0(JNIEnv* env,
130 ops->delByScan(ops->model->table_B0, count, batch == JNI_TRUE);
131 assert(count == nOps);
134 JNIEXPORT
void JNICALL
135 Java_com_mysql_cluster_crund_NdbApiLoad_insA(JNIEnv* env,
142 ops->ins(ops->model->table_A, 1, nOps,
143 setAttrs == JNI_TRUE, batch == JNI_TRUE);
146 JNIEXPORT
void JNICALL
147 Java_com_mysql_cluster_crund_NdbApiLoad_insB0(JNIEnv* env,
154 ops->ins(ops->model->table_B0, 1, nOps,
155 setAttrs == JNI_TRUE, batch == JNI_TRUE);
158 JNIEXPORT
void JNICALL
159 Java_com_mysql_cluster_crund_NdbApiLoad_delAByPK(JNIEnv* env,
165 ops->delByPK(ops->model->table_A, 1, nOps, batch == JNI_TRUE);
168 JNIEXPORT
void JNICALL
169 Java_com_mysql_cluster_crund_NdbApiLoad_delB0ByPK(JNIEnv* env,
174 TRACE(
"delB0ByPK()");
175 ops->delByPK(ops->model->table_B0, 1, nOps, batch == JNI_TRUE);
178 JNIEXPORT
void JNICALL
179 Java_com_mysql_cluster_crund_NdbApiLoad_setAByPK(JNIEnv* env,
185 ops->setByPK(ops->model->table_A, 1, nOps, batch == JNI_TRUE);
188 JNIEXPORT
void JNICALL
189 Java_com_mysql_cluster_crund_NdbApiLoad_setB0ByPK(JNIEnv* env,
194 TRACE(
"setB0ByPK()");
195 ops->setByPK(ops->model->table_B0, 1, nOps, batch == JNI_TRUE);
198 JNIEXPORT
void JNICALL
199 Java_com_mysql_cluster_crund_NdbApiLoad_getAByPK_1bb(JNIEnv* env,
204 TRACE(
"getAByPK_bb()");
205 ops->getByPK_bb(ops->model->table_A, 1, nOps, batch == JNI_TRUE);
208 JNIEXPORT
void JNICALL
209 Java_com_mysql_cluster_crund_NdbApiLoad_getB0ByPK_1bb(JNIEnv* env,
214 TRACE(
"getB0ByPK_bb()");
215 ops->getByPK_bb(ops->model->table_B0, 1, nOps, batch == JNI_TRUE);
218 JNIEXPORT
void JNICALL
219 Java_com_mysql_cluster_crund_NdbApiLoad_getAByPK_1ar(JNIEnv* env,
224 TRACE(
"getAByPK_ar()");
225 ops->getByPK_ar(ops->model->table_A, 1, nOps, batch == JNI_TRUE);
228 JNIEXPORT
void JNICALL
229 Java_com_mysql_cluster_crund_NdbApiLoad_getB0ByPK_1ar(JNIEnv* env,
234 TRACE(
"getB0ByPK_ar()");
235 ops->getByPK_ar(ops->model->table_B0, 1, nOps, batch == JNI_TRUE);
238 JNIEXPORT
void JNICALL
239 Java_com_mysql_cluster_crund_NdbApiLoad_setVarbinary(JNIEnv* env,
245 TRACE(
"setVarbinary()");
246 ops->setVarbinary(ops->model->table_B0,
247 1, nOps, batch == JNI_TRUE, length);
250 JNIEXPORT
void JNICALL
251 Java_com_mysql_cluster_crund_NdbApiLoad_getVarbinary(JNIEnv* env,
257 TRACE(
"getVarbinary()");
258 ops->getVarbinary(ops->model->table_B0,
259 1, nOps, batch == JNI_TRUE, length);
262 JNIEXPORT
void JNICALL
263 Java_com_mysql_cluster_crund_NdbApiLoad_setVarchar(JNIEnv* env,
269 TRACE(
"setVarchar()");
270 ops->setVarchar(ops->model->table_B0,
271 1, nOps, batch == JNI_TRUE, length);
274 JNIEXPORT
void JNICALL
275 Java_com_mysql_cluster_crund_NdbApiLoad_getVarchar(JNIEnv* env,
281 TRACE(
"getVarchar()");
282 ops->getVarchar(ops->model->table_B0,
283 1, nOps, batch == JNI_TRUE, length);
286 JNIEXPORT
void JNICALL
287 Java_com_mysql_cluster_crund_NdbApiLoad_setB0ToA(JNIEnv* env,
293 ops->setB0ToA(nOps, batch == JNI_TRUE);
296 JNIEXPORT
void JNICALL
297 Java_com_mysql_cluster_crund_NdbApiLoad_navB0ToA(JNIEnv* env,
303 ops->navB0ToA(nOps, batch == JNI_TRUE);
306 JNIEXPORT
void JNICALL
307 Java_com_mysql_cluster_crund_NdbApiLoad_navB0ToAalt(JNIEnv* env,
312 TRACE(
"navB0ToAalt()");
313 ops->navB0ToAalt(nOps, batch == JNI_TRUE);
316 JNIEXPORT
void JNICALL
317 Java_com_mysql_cluster_crund_NdbApiLoad_navAToB0(JNIEnv* env,
323 ops->navAToB0(nOps, forceSend == JNI_TRUE);
326 JNIEXPORT
void JNICALL
327 Java_com_mysql_cluster_crund_NdbApiLoad_navAToB0alt(JNIEnv* env,
332 TRACE(
"navAToB0alt()");
333 ops->navAToB0alt(nOps, forceSend == JNI_TRUE);
336 JNIEXPORT
void JNICALL
337 Java_com_mysql_cluster_crund_NdbApiLoad_nullB0ToA(JNIEnv* env,
342 TRACE(
"nullB0ToA()");
343 ops->nullB0ToA(nOps, batch == JNI_TRUE);