List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:October 1 2007 7:17pm
Subject:Rev 167: Added where{Greater,Less}Than* convenience methods. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmerge
View as plain text  
At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmerge

------------------------------------------------------------
revno: 167
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: ndbjmerge
timestamp: Mon 2007-10-01 12:17:29 -0700
message:
  Added where{Greater,Less}Than* convenience methods.
modified:
  java/com/mysql/cluster/ndbj/NdbIndexScanOperation.java
ndbindexscanoperatio-20070517181935-98huwjarzuh25b30-17
  swig/NdbIndexScanOperation.i   ndbindexscanoperatio-20070426125039-esztodu0kcqbofgn-1
=== modified file 'java/com/mysql/cluster/ndbj/NdbIndexScanOperation.java'
--- a/java/com/mysql/cluster/ndbj/NdbIndexScanOperation.java	2007-09-30 02:06:41 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbIndexScanOperation.java	2007-10-01 19:17:29 +0000
@@ -1,6 +1,7 @@
 package com.mysql.cluster.ndbj;
 
 import java.util.Calendar;
+import java.math.BigInteger;
 
 
 import com.mysql.cluster.ndbj.NdbOperation.LockMode;
@@ -415,5 +416,83 @@
 	
 	
 	public int endOfBound(long range_no) 
-			throws NdbApiException; 
+			throws NdbApiException;
+
+	public int whereGreaterThan(long columnId, double val) throws NdbApiException;
+
+	public int whereGreaterThan(String columnName, int val) throws NdbApiException;
+
+	public int whereGreaterThan(long columnId, int val) throws NdbApiException;
+
+	public int whereGreaterThan(String columnName, long val) throws NdbApiException;
+
+	public int whereGreaterThan(long columnId, long val) throws NdbApiException;
+
+	public int whereGreaterThan(String columnName, float val) throws NdbApiException;
+
+	public int whereGreaterThan(long columnId, float val) throws NdbApiException;
+
+	public int whereGreaterThan(long columnId, BigInteger val) throws NdbApiException;
+	
+	public int whereGreaterThanEqualTo(String columnName, int val) throws NdbApiException;
+
+	public int whereGreaterThanEqualTo(long columnId, int val) throws NdbApiException;
+
+	public int whereGreaterThanEqualTo(String columnName, long val) throws NdbApiException;
+
+	public int whereGreaterThanEqualTo(long columnId, long val) throws NdbApiException;
+
+	public int whereGreaterThanEqualTo(String columnName, double val) throws
NdbApiException;
+
+	public int whereGreaterThanEqualTo(long columnId, double val) throws NdbApiException;
+
+	public int whereGreaterThanEqualTo(String columnName, float val) throws NdbApiException;
+
+	public int whereGreaterThanEqualTo(long columnId, float val) throws NdbApiException;
+
+	public int whereGreaterThanEqualTo(long columnId, BigInteger val) throws
NdbApiException;
+
+	public int whereLessThan(String columnName, int val) throws NdbApiException;
+
+	public int whereLessThan(long columnId, int val) throws NdbApiException;
+
+	public int whereLessThan(String columnName, long val) throws NdbApiException;
+
+	public int whereLessThan(long columnId, long val) throws NdbApiException;
+
+	public int whereLessThan(String columnName, double val) throws NdbApiException;
+
+	public int whereLessThan(long columnId, double val) throws NdbApiException;
+
+	public int whereLessThan(String columnName, float val) throws NdbApiException;
+
+	public int whereLessThan(long columnId, float val) throws NdbApiException;
+
+	public int whereLessThan(long columnId, BigInteger val) throws NdbApiException;
+
+	public int whereLessThanEqualTo(String columnName, int val) throws NdbApiException;
+
+	public int whereLessThanEqualTo(long columnId, int val) throws NdbApiException;
+
+	public int whereLessThanEqualTo(String columnName, long val) throws NdbApiException;
+
+	public int whereLessThanEqualTo(long columnId, long val) throws NdbApiException;
+
+	public int whereLessThanEqualTo(String columnName, double val) throws NdbApiException;
+
+	public int whereLessThanEqualTo(long columnId, double val) throws NdbApiException;
+
+	public int whereLessThanEqualTo(String columnName, float val) throws NdbApiException;
+
+	public int whereLessThanEqualTo(long columnId, float val) throws NdbApiException;
+
+	public int whereLessThanEqualTo(long columnId, BigInteger val) throws NdbApiException;
+
+	public int whereGreaterThan(String anAttrName, String anInputString) throws
NdbApiException;
+
+	public int whereGreaterThan(long anAttrId, String anInputString) throws NdbApiException;
+
+	public int whereGreaterThanEqualTo(String anAttrName, String anInputString) throws
NdbApiException;
+
+	public int whereGreaterThanEqualTo(long anAttrId, String anInputString) throws
NdbApiException; 
 }
\ No newline at end of file

=== modified file 'swig/NdbIndexScanOperation.i'
--- a/swig/NdbIndexScanOperation.i	2007-09-30 02:39:45 +0000
+++ b/swig/NdbIndexScanOperation.i	2007-10-01 19:17:29 +0000
@@ -126,6 +126,14 @@
     float value = (float)val;
     return self->setBound(anAttrId,type,(void *) &value);
   };
+  int setBoundDecimal(const char* anAttrName, BoundType type,Int64 anInputDecimal) { 
+    Int64 value = (Int64)anInputDecimal;
+    return self->setBound(anAttrName,type,(void *) &value);
+  };
+  int setBoundDecimal(Uint32 anAttrId, BoundType type, Int64 anInputDecimal) { 
+    Int64 value = (Int64)anInputDecimal;
+    return self->setBound(anAttrId,type,(void *) &value);
+  };
   int setBoundTimestamp(const char* anAttrName, BoundType type, NdbTimestamp
anInputTimestamp) { 
     Uint32 value = (Uint32)anInputTimestamp;
     return self->setBound(anAttrName,type,(void *) &value);
@@ -187,4 +195,273 @@
     return retval;
   };
 
+  int whereGreaterThan(const char * columnName, Int32 val) { 
+    Int32 value = (Int32)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundLT,(void *)
&value);
+  }
+  int whereGreaterThan(Uint32 columnId, Int32 val) { 
+    Int32 value = (Int32)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundLT,(void *)
&value);
+  }
+  int whereGreaterThan(const char * columnName, Int64 val) { 
+    Int64 value = (Int64)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundLT,(void *)
&value);
+  }
+  int whereGreaterThan(Uint32 columnId, Int64 val) { 
+    Int64 value = (Int64)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundLT,(void *)
&value);
+  }
+  int whereGreaterThan(const char * columnName, Uint64 val) { 
+    Uint64 value = (Uint64)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundLT,(void *)
&value);
+  }
+  int whereGreaterThan(Uint32 columnId, Uint64 val) { 
+    Uint64 value = (Uint64)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundLT,(void *)
&value);
+  }
+  int whereGreaterThan(const char * columnName, double val) { 
+    double value = (double)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundLT,(void *)
&value);
+  }
+  int whereGreaterThan(Uint32 columnId, double val) { 
+    double value = (double)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundLT,(void *)
&value);
+  }
+  int whereGreaterThan(const char * columnName, float val) { 
+    float value = (float)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundLT,(void *)
&value);
+  }
+  int whereGreaterThan(Uint32 columnId, float val) { 
+    float value = (float)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundLT,(void *)
&value);
+  }
+  int whereGreaterThan(const char * columnName, Int64 anInputDecimal) { 
+    Int64 value = (Int64)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundLT,(void *)
&value);
+  }
+  int whereGreaterThan(Uint32 columnId, Int64 anInputDecimal) { 
+    Int64 value = (Int64)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundLT,(void *)
&value);
+  }
+  int whereGreaterThan(const char* anAttrName, const char * anInputString, size_t len) { 
+    const NdbDictionary::Column * theColumn =
self->getTable()->getColumn(anAttrName);
+    char * stringVal = ndbFormatString(theColumn,anInputString,len);
+    if (stringVal == NULL) 
+      return -1;
+    int retval = self->setBound(anAttrName,NdbIndexScanOperation::BoundLT,(void
*)stringVal);
+    free(stringVal);
+    return retval;
+  };
+  int whereGreaterThan(Uint32 anAttrId, const char * anInputString, size_t len ) { 
+    const NdbDictionary::Column * theColumn =
self->getTable()->getColumn(anAttrId);
+    char * stringVal = ndbFormatString(theColumn,anInputString,len);
+    if (stringVal == NULL) 
+      return -1;
+    int retval = self->setBound(anAttrId,NdbIndexScanOperation::BoundLT,(void
*)stringVal);
+    free(stringVal);
+    return retval;
+  };
+
+
+  int whereGreaterThanEqualTo(const char * columnName, Int32 val) { 
+    Int32 value = (Int32)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundLE,(void *)
&value);
+  }
+  int whereGreaterThanEqualTo(Uint32 columnId, Int32 val) { 
+    Int32 value = (Int32)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundLE,(void *)
&value);
+  }
+  int whereGreaterThanEqualTo(const char * columnName, Int64 val) { 
+    Int64 value = (Int64)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundLE,(void *)
&value);
+  }
+  int whereGreaterThanEqualTo(Uint32 columnId, Int64 val) { 
+    Int64 value = (Int64)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundLE,(void *)
&value);
+  }
+  int whereGreaterThanEqualTo(const char * columnName, Uint64 val) { 
+    Uint64 value = (Uint64)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundLE,(void *)
&value);
+  }
+  int whereGreaterThanEqualTo(Uint32 columnId, Uint64 val) { 
+    Uint64 value = (Uint64)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundLE,(void *)
&value);
+  }
+  int whereGreaterThanEqualTo(const char * columnName, double val) { 
+    double value = (double)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundLE,(void *)
&value);
+  }
+  int whereGreaterThanEqualTo(Uint32 columnId, double val) { 
+    double value = (double)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundLE,(void *)
&value);
+  }
+  int whereGreaterThanEqualTo(const char * columnName, float val) { 
+    float value = (float)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundLE,(void *)
&value);
+  }
+  int whereGreaterThanEqualTo(Uint32 columnId, float val) { 
+    float value = (float)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundLE,(void *)
&value);
+  }
+  int whereGreaterThanEqualTo(const char * columnName, Int64 anInputDecimal) { 
+    Int64 value = (Int64)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundLE,(void *)
&value);
+  }
+  int whereGreaterThanEqualTo(Uint32 columnId, Int64 anInputDecimal) { 
+    Int64 value = (Int64)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundLE,(void *)
&value);
+  }
+  int whereGreaterThanEqualTo(const char* anAttrName, const char * anInputString, size_t
len) { 
+    const NdbDictionary::Column * theColumn =
self->getTable()->getColumn(anAttrName);
+    char * stringVal = ndbFormatString(theColumn,anInputString,len);
+    if (stringVal == NULL) 
+      return -1;
+    int retval = self->setBound(anAttrName,NdbIndexScanOperation::BoundLE,(void
*)stringVal);
+    free(stringVal);
+    return retval;
+  };
+  int whereGreaterThanEqualTo(Uint32 anAttrId, const char * anInputString, size_t len ) {

+    const NdbDictionary::Column * theColumn =
self->getTable()->getColumn(anAttrId);
+    char * stringVal = ndbFormatString(theColumn,anInputString,len);
+    if (stringVal == NULL) 
+      return -1;
+    int retval = self->setBound(anAttrId,NdbIndexScanOperation::BoundLE,(void
*)stringVal);
+    free(stringVal);
+    return retval;
+  };
+
+  int whereLessThan(const char * columnName, Int32 val) { 
+    Int32 value = (Int32)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundGT,(void *)
&value);
+  }
+  int whereLessThan(Uint32 columnId, Int32 val) { 
+    Int32 value = (Int32)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundGT,(void *)
&value);
+  }
+  int whereLessThan(const char * columnName, Int64 val) { 
+    Int64 value = (Int64)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundGT,(void *)
&value);
+  }
+  int whereLessThan(Uint32 columnId, Int64 val) { 
+    Int64 value = (Int64)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundGT,(void *)
&value);
+  }
+  int whereLessThan(const char * columnName, Uint64 val) { 
+    Uint64 value = (Uint64)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundGT,(void *)
&value);
+  }
+  int whereLessThan(Uint32 columnId, Uint64 val) { 
+    Uint64 value = (Uint64)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundGT,(void *)
&value);
+  }
+  int whereLessThan(const char * columnName, double val) { 
+    double value = (double)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundGT,(void *)
&value);
+  }
+  int whereLessThan(Uint32 columnId, double val) { 
+    double value = (double)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundGT,(void *)
&value);
+  }
+  int whereLessThan(const char * columnName, float val) { 
+    float value = (float)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundGT,(void *)
&value);
+  }
+  int whereLessThan(Uint32 columnId, float val) { 
+    float value = (float)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundGT,(void *)
&value);
+  }
+  int whereLessThan(const char * columnName, Int64 anInputDecimal) { 
+    Int64 value = (Int64)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundGT,(void *)
&value);
+  }
+  int whereLessThan(Uint32 columnId, Int64 anInputDecimal) { 
+    Int64 value = (Int64)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundGT,(void *)
&value);
+  }
+  int whereLessThan(const char* anAttrName, const char * anInputString, size_t len) { 
+    const NdbDictionary::Column * theColumn =
self->getTable()->getColumn(anAttrName);
+    char * stringVal = ndbFormatString(theColumn,anInputString,len);
+    if (stringVal == NULL) 
+      return -1;
+    int retval = self->setBound(anAttrName,NdbIndexScanOperation::BoundGT,(void
*)stringVal);
+    free(stringVal);
+    return retval;
+  };
+  int whereLessThan(Uint32 anAttrId, const char * anInputString, size_t len ) { 
+    const NdbDictionary::Column * theColumn =
self->getTable()->getColumn(anAttrId);
+    char * stringVal = ndbFormatString(theColumn,anInputString,len);
+    if (stringVal == NULL) 
+      return -1;
+    int retval = self->setBound(anAttrId,NdbIndexScanOperation::BoundGT,(void
*)stringVal);
+    free(stringVal);
+    return retval;
+  };
+
+  int whereLessThanEqualTo(const char * columnName, Int32 val) { 
+    Int32 value = (Int32)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundGE,(void *)
&value);
+  }
+  int whereLessThanEqualTo(Uint32 columnId, Int32 val) { 
+    Int32 value = (Int32)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundGE,(void *)
&value);
+  }
+  int whereLessThanEqualTo(const char * columnName, Int64 val) { 
+    Int64 value = (Int64)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundGE,(void *)
&value);
+  }
+  int whereLessThanEqualTo(Uint32 columnId, Int64 val) { 
+    Int64 value = (Int64)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundGE,(void *)
&value);
+  }
+  int whereLessThanEqualTo(const char * columnName, Uint64 val) { 
+    Uint64 value = (Uint64)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundGE,(void *)
&value);
+  }
+  int whereLessThanEqualTo(Uint32 columnId, Uint64 val) { 
+    Uint64 value = (Uint64)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundGE,(void *)
&value);
+  }
+  int whereLessThanEqualTo(const char * columnName, double val) { 
+    double value = (double)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundGE,(void *)
&value);
+  }
+  int whereLessThanEqualTo(Uint32 columnId, double val) { 
+    double value = (double)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundGE,(void *)
&value);
+  }
+  int whereLessThanEqualTo(const char * columnName, float val) { 
+    float value = (float)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundGE,(void *)
&value);
+  }
+  int whereLessThanEqualTo(Uint32 columnId, float val) { 
+    float value = (float)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundGE,(void *)
&value);
+  }
+  int whereLessThanEqualTo(const char * columnName, Int64 anInputDecimal) { 
+    Int64 value = (Int64)val;
+    return self->setBound(columnName,NdbIndexScanOperation::BoundGE,(void *)
&value);
+  }
+  int whereLessThanEqualTo(Uint32 columnId, Int64 anInputDecimal) { 
+    Int64 value = (Int64)val;
+    return self->setBound(columnId,NdbIndexScanOperation::BoundGE,(void *)
&value);
+  }
+  int whereLessThanEqualTo(const char* anAttrName, const char * anInputString, size_t
len) { 
+    const NdbDictionary::Column * theColumn =
self->getTable()->getColumn(anAttrName);
+    char * stringVal = ndbFormatString(theColumn,anInputString,len);
+    if (stringVal == NULL) 
+      return -1;
+    int retval = self->setBound(anAttrName,NdbIndexScanOperation::BoundGE,(void
*)stringVal);
+    free(stringVal);
+    return retval;
+  };
+  int whereLessThanEqualTo(Uint32 anAttrId, const char * anInputString, size_t len ) { 
+    const NdbDictionary::Column * theColumn =
self->getTable()->getColumn(anAttrId);
+    char * stringVal = ndbFormatString(theColumn,anInputString,len);
+    if (stringVal == NULL) 
+      return -1;
+    int retval = self->setBound(anAttrId,NdbIndexScanOperation::BoundGE,(void
*)stringVal);
+    free(stringVal);
+    return retval;
+  };
+
 }

Thread
Rev 167: Added where{Greater,Less}Than* convenience methods. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmergeMonty Taylor1 Oct