XWhere Class |
Namespace: Biolomics.SharedClasses
The XWhere type exposes the following members.
Name | Description | |
---|---|---|
FieldName |
Gets the name of the field.
| |
Operation |
Gets the operation.
| |
PreOperation |
Gets the pre operation.
| |
PreValue |
Gets the pre value.
| |
Value |
Gets the value.
| |
WhereX |
Gets the X xwhere.
| |
WhereY |
Gets the Y xwhere.
|
Name | Description | |
---|---|---|
All |
return a where clause doing nothing: Operation = none to return all records
| |
And_(XWhere) |
Concats given XWhere statement with current XWhere using AND operator.
| |
And_(XWhere, XWhere) |
Created new XWhere using AND operator between given XWhere statements.
| |
And_(String, XWhereOperationEnum, BsonValue) |
Created new XWhere with And operator to add new xwhere statement based on field name and operation and value to current xwhere statement.
| |
And_(XWherePreOperationEnum, String, XWhereOperationEnum, BsonValue) |
Created new XWhere with And operator to add new xwhere statement based on field name ,preoperation, operation and value to current xwhere statement.
| |
And_(XWherePreOperationEnum, BsonValue, String, XWhereOperationEnum, BsonValue) |
Created new XWhere with And operator to add new xwhere statement based on field name ,preoperation,prevalue, operation and value to current xwhere statement.
| |
AndIsNotNull(String, BsonValue) |
Created new XWhere to check if field and value is not null using AndIsNotNull operation .
| |
AndIsNotNull(String, String, BsonValue) | ||
AndIsNull(String, BsonValue) |
Created new XWhere to check if field and value is null using AndIsNull operation .
| |
AndIsNull(String, String, BsonValue) | ||
Clear |
Resets the xwhere. See the default constructor
| |
Contains(String, BsonArray) |
Created new XWhere with Contains operation to check if field name contains any value from the bson array.
| |
Contains(String, BsonValue) |
Created new XWhere with Contains operation to check if field contains the value.
| |
Contains(XWherePreOperationEnum, String, BsonValue) |
Created new XWhere with Contains operation to check if field contains the value with preoperation.
| |
Empty |
Returns an Empty dataset.
| |
EndWith |
Created new XWhere with EndsWith operation to check if field ends with the value.
| |
Eq(String, BsonValue) |
Created new XWhere with Equal operation .
| |
Eq(XWherePreOperationEnum, String, BsonValue) |
Created new XWhere with Equal operation using preoperation.
| |
Eq(XWherePreOperationEnum, BsonValue, String, BsonValue) |
Created new XWhere with Equal operation using preoperation and prevalue.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Gt(String, BsonValue) |
Created new XWhere with Greater operation .
| |
Gt(XWherePreOperationEnum, String, BsonValue) |
Created new XWhere with Greater operation using preoperation .
| |
Gte(String, BsonValue) |
Created new XWhere with Greater or Equal operation .
| |
Gte(XWherePreOperationEnum, String, BsonValue) |
Created new XWhere with Greater or Equal operation using preoperation.
| |
In_(String, BsonArray) |
Created new XWhere with In operation to check if the field value is in an array.
| |
In_(XWherePreOperationEnum, String, BsonArray) |
Created new XWhere with In operation to check if the field value is in an array using preoperation.
| |
InRange |
Created new XWhere with InRange operation to check if the field value is in an array .
| |
IsAll |
Determines whether this instance contains xwhere.All.
| |
IsEmpty |
Determines whether this xwhere contains an Empty xwher.
| |
IsEmptyLink |
Created new XWhere to check if the link is Empty.
| |
IsNotEmptyLink |
Created new XWhere to check if the link is not Empty.
| |
IsNotNull |
Created new XWhere with INotsNull operation to check if field is not null.
| |
IsNotNullArray |
Created new XWhere with IsNotNullArray operation to check if field is not a null array.
| |
IsNull |
Created new XWhere with IsNull operation to check if field is null.
| |
IsNullArray |
Created new XWhere with IsNullArray operation to check if field is a null array.
| |
Lt(String, BsonValue) |
Created new XWhere with Less than operation .
| |
Lt(XWherePreOperationEnum, String, BsonValue) |
Created new XWhere with Less than operation using preoperation .
| |
Lte(String, BsonValue) |
Created new XWhere with Less than or Equal operation .
| |
Lte(XWherePreOperationEnum, String, BsonValue) |
Created new XWhere with Less than or Equal operation using preoperation.
| |
MaxId |
Get the maximum id.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
MinId |
Get the minimum id.
| |
Modulo |
Created new XWhere with Modulo operation .
| |
NE(String, BsonValue) |
Created new XWhere with Not Equal operation .
| |
NE(XWherePreOperationEnum, String, BsonValue) |
Created new XWhere with Not Equal operation using preoperation .
| |
NE(XWherePreOperationEnum, BsonValue, String, BsonValue) |
Created new XWhere with Not Equal operation using preoperation and prevalue .
| |
Not_ |
Create new Xwhere statement with Not opration from given xwhere statement.
| |
OperationFromString |
Return OperationEnum from Operation name.
| |
Or_(XWhere) |
Join xwhere statement with current xwhere statement with OR operator
| |
Or_(String, XWhereOperationEnum) |
Create a new xwhere statement from fieldname and operation and join it with current xwhere statement using OR operator.
| |
Or_(XWhere, XWhere) |
Joins two xwhere statements with OR operator
| |
Or_(String, XWhereOperationEnum, BsonValue) |
Create a new xwhere statement from fieldname and operation and value and join it with current xwhere statement using OR operator.
| |
Or_(XWherePreOperationEnum, String, XWhereOperationEnum, BsonValue) |
Create a new xwhere statement from fieldname and preoperation and operation and value and join it with current xwhere statement using OR operator.
| |
Or_(XWherePreOperationEnum, BsonValue, String, XWhereOperationEnum, BsonValue) |
Create a new xwhere statement from fieldname ,preoperation,prevalue, operation and value and join it with current xwhere statement
using OR operator.
| |
RegExp(String, String) |
Created new XWhere with RegExp operation .
| |
RegExp(XWherePreOperationEnum, String, String) |
Created new XWhere with RegExp operation using preoperation.
| |
Simplify |
used to simplify the OR queries and avoid 500 imbricated XWhere instances
| |
Sql |
Returns an xwhere with sql query.
| |
StartWith |
Created new XWhere with StartsWith operation.
| |
Title |
build a title for the given Where clause, something that is understandable by most users
| |
ToString |
Returns a String that represents this xwhere.
(Overrides ObjectToString.) |
Name | Description | |
---|---|---|
Equality |
Check if X xwhere is equal to Y xwhere.
| |
Inequality |
Check if X xwhere is not equal to Y xwhere.
|
Imports System Imports System.Collections Imports Biolomics.BioCallback Imports Biolomics.SharedClasses Imports Biolomics.Utility.Constants Public Class MyNewClass ' This function is called when running this script Shared Sub Main() ' Create an instance of class MyNewClass and call its functions Dim c As New MyNewClass c.RunQuery() End Sub Public Sub RunQuery() ' ***** Run a query in the current SearchPage ***** Dim Where As XWhere = XWhere.GT(StaticFields.id, 2).And_(StaticFields.id, XWhere.OperationEnum.LT, 8).Or_(StaticFields.name, XWhere.OperationEnum.EndWith, "877") ' ***** Numerical queries ***** Where = XWhere.Eq(StaticFields.id, 5) ' WHERE Id = 5 Where = XWhere.NE(StaticFields.id, 5) ' WHERE Id != 5 Where = XWhere.GT(StaticFields.id, 5) ' WHERE Id > 5 Where = XWhere.GTE(StaticFields.id, 5) ' WHERE Id >= 5 Where = XWhere.LT(StaticFields.id, 5) ' WHERE Id < 5 Where = XWhere.LTE(StaticFields.id, 5) ' WHERE Id <= 5 ' ***** String queries ***** Where = XWhere.Eq(StaticFields.name, "CBS 14") ' WHERE Name = 'CBS 14' Where = XWhere.NE("name", "CBS 14") ' WHERE Name != 'CBS 14' Where = XWhere.StartWith("name", "Apis") ' WHERE Name LIKE 'Apis%' Where = XWhere.Contains("name", "mell") ' WHERE Name LIKE '%mell%' Where = XWhere.EndWith("name", "mellifera") ' WHERE Name LIKE '%mellifera' ' ***** Numerical list queries ***** Dim NumArray As Integer() = {1, 3, 5, 7, 9} Dim NumList As New BsonArray(NumArray) ' from an array of values NumList.Add(11) ' add a value Where = XWhere.In_(StaticFields.id, NumList) ' WHERE Id IN(1, 3, 5, 7, 9, 11) ' ***** String list queries ***** Dim StrArray As String() = {"John", "Bryan", "Bob"} Dim StrList As New BsonArray(StrArray) ' from an array of values Where = XWhere.In_(StaticFields.name, StrList) ' WHERE Name IN("John", "Bryan", "Bob") ' ***** Combining queries ***** Where = XWhere.GTE(StaticFields.id, 5).And_(StaticFields.id, XWhere.OperationEnum.LT, 20) ' WHERE Id >= 5 AND Id < 20 ' the operation given as the second parameter has the same name as ' the static functions above: Ep, LT, LTE, GT, etc. ' There is no limit in the combinations, executed from left to right Where = XWhere.GTE(StaticFields.id, 5).And_(StaticFields.name, XWhere.OperationEnum.StartWith, "Vespa"). And_("comment", XWhere.OperationEnum.Contains, "invasive") ' ***** Checking for NULL ***** Where = XWhere.IsNull("name") ' WHERE Name is null Where = XWhere.IsNotNull("name") ' WHERE Name is not null ' ***** Complex queries with bitwise pre-processing ' checking for bit #3 (= 4) in a value Where = XWhere.NE(XWhere.PreOperationEnum.BitAnd, 4, "read_group", 0) ' WHERE (ReadGroup AND 4) <> 0 ' checking for even values: bit #0 is not set Where = XWhere.Eq(XWhere.PreOperationEnum.BitAnd, 1, "read_group", 0) ' WHERE (ReadGroup AND 1) = 0 ' ***** Regular expressions ***** Where = XWhere.RegExp("name", "[[:<:]]invasive[[:>:]]") ' WHERE Name REGEXP '[[:<:]]invasive[[:>:]]' ' ***** Loading everything or nothing ***** Where = XWhere.All Where = XWhere.Empty ' ***** Check for the content of a Where Clause ***** If Where.IsEmpty OrElse Where.IsAll Then ' ... End If End Sub End Class