public class BTable extends Object implements BRefType<Object>, BCollection
BTable
represents a data set in Ballerina.Modifier and Type | Field and Description |
---|---|
protected BStructureType |
constraintType |
protected DataIterator |
iterator |
Constructor and Description |
---|
BTable() |
BTable(BType type,
BStringArray indexColumns,
BStringArray keyColumns,
BRefValueArray dataRows) |
BTable(String tableName,
BStructureType constraintType) |
BTable(String query,
BTable fromTable,
BTable joinTable,
BStructureType constraintType,
BRefValueArray params) |
Modifier and Type | Method and Description |
---|---|
void |
addData(BMap<String,BValue> data) |
void |
addData(BMap<String,BValue> data,
Context context) |
void |
close(boolean isInTransaction) |
BValue |
copy()
Deep copy
BValue . |
protected void |
finalize() |
protected void |
generateIterator() |
Object[] |
getArray(int columnIndex) |
String |
getBlob(int columnIndex) |
boolean |
getBoolean(int columnIndex) |
List<ColumnDefinition> |
getColumnDefs() |
double |
getFloat(int columnIndex) |
long |
getInt(int columnIndex) |
BMap<String,BValue> |
getNext() |
String |
getString(int columnIndex) |
Object[] |
getStruct(int columnIndex) |
BStructureType |
getStructType() |
BType |
getType() |
boolean |
hasNext(boolean isInTransaction) |
protected boolean |
isIteratorGenerationConditionMet() |
void |
moveToNext() |
BIterator |
newIterator()
Create new Iterator for this collection.
|
void |
performAddOperation(BMap<String,BValue> data,
Context context)
Performs addition of a record to the database.
|
void |
performRemoveOperation(Context context,
BFunctionPointer lambdaFunction)
Performs Removal of records matching the condition defined by the provided lambda function.
|
void |
reset(boolean isInTransaction) |
protected void |
resetIterationHelperAttributes() |
String |
stringValue() |
Object |
value() |
protected DataIterator iterator
protected BStructureType constraintType
public BTable()
public BTable(String tableName, BStructureType constraintType)
public BTable(String query, BTable fromTable, BTable joinTable, BStructureType constraintType, BRefValueArray params)
public BTable(BType type, BStringArray indexColumns, BStringArray keyColumns, BRefValueArray dataRows)
public String stringValue()
stringValue
in interface BValue
public boolean hasNext(boolean isInTransaction)
public void moveToNext()
public void close(boolean isInTransaction)
public void reset(boolean isInTransaction)
public void performAddOperation(BMap<String,BValue> data, Context context)
data
- The record to be insertedcontext
- The context which represents the runtime state of the program that called "table.add"public void performRemoveOperation(Context context, BFunctionPointer lambdaFunction)
context
- The context which represents the runtime state of the program that called "table.remove"lambdaFunction
- The function that decides the condition of data removalpublic String getString(int columnIndex)
public long getInt(int columnIndex)
public double getFloat(int columnIndex)
public boolean getBoolean(int columnIndex)
public String getBlob(int columnIndex)
public Object[] getStruct(int columnIndex)
public Object[] getArray(int columnIndex)
public List<ColumnDefinition> getColumnDefs()
public BStructureType getStructType()
public BIterator newIterator()
BCollection
newIterator
in interface BCollection
protected void generateIterator()
protected boolean isIteratorGenerationConditionMet()
protected void resetIterationHelperAttributes()
Copyright © 2018 WSO2. All rights reserved.