public class MongoDataHandler extends Object implements ODataDataHandler
| Constructor and Description |
|---|
MongoDataHandler(String configId,
org.jongo.Jongo jongo) |
| Modifier and Type | Method and Description |
|---|---|
void |
commitTransaction()
This method commits the transaction.
|
boolean |
deleteEntityInTable(String tableName,
ODataEntry entity)
This method deletes the entity from the collection for a given key.
|
void |
deleteReference(String rootTableName,
ODataEntry rootTableKeys,
String navigationTable,
ODataEntry navigationTableKeys)
This method deletes the references of the table where the keys were imported.
|
Map<String,NavigationTable> |
getNavigationProperties()
This method returns the navigation property map, which contains the Navigation table which contains the all the navigation paths from the table,
|
Map<String,List<String>> |
getPrimaryKeys()
This method returns the primary keys of all the collections in the database.
|
List<String> |
getTableList()
This method creates a list of collections available in the DB.
|
Map<String,Map<String,DataColumn>> |
getTableMetadata()
This method returns database collection metadata.
|
ODataEntry |
insertEntityToTable(String tableName,
ODataEntry entity)
This method inserts a given entity to the given collection.
|
void |
openTransaction()
This method opens the transaction.
|
List<ODataEntry> |
readTable(String tableName)
This method reads the data for a given collection.
|
List<ODataEntry> |
readTableWithKeys(String tableName,
ODataEntry keys)
This method reads the collection data for a given key(i.e.
|
void |
rollbackTransaction()
This method rollbacks the transaction.
|
boolean |
updateEntityInTable(String tableName,
ODataEntry newProperties)
This method updates the given entity in the given collection.
|
boolean |
updateEntityInTableTransactional(String tableName,
ODataEntry oldProperties,
ODataEntry newProperties)
This method updates the entity in table when transactional update is necessary.
|
void |
updateReference(String rootTableName,
ODataEntry rootTableKeys,
String navigationTable,
ODataEntry navigationTableKeys)
This method updates the references of the table where the keys were imported.
|
public MongoDataHandler(String configId, org.jongo.Jongo jongo)
public Map<String,Map<String,DataColumn>> getTableMetadata()
getTableMetadata in interface ODataDataHandlerDataColumnpublic List<String> getTableList()
getTableList in interface ODataDataHandlerpublic Map<String,List<String>> getPrimaryKeys()
getPrimaryKeys in interface ODataDataHandlerpublic List<ODataEntry> readTable(String tableName)
readTable in interface ODataDataHandlertableName - Name of the tableDataEntrypublic List<ODataEntry> readTableWithKeys(String tableName, ODataEntry keys) throws ODataServiceFault
readTableWithKeys in interface ODataDataHandlertableName - Name of the tablekeys - Keys to checkODataServiceFaultDataEntrypublic ODataEntry insertEntityToTable(String tableName, ODataEntry entity)
insertEntityToTable in interface ODataDataHandlertableName - Name of the tableentity - EntityODataServiceFaultpublic boolean deleteEntityInTable(String tableName, ODataEntry entity) throws ODataServiceFault
deleteEntityInTable in interface ODataDataHandlertableName - Name of the tableentity - EntityODataServiceFaultpublic boolean updateEntityInTable(String tableName, ODataEntry newProperties) throws ODataServiceFault
updateEntityInTable in interface ODataDataHandlertableName - Name of the tablenewProperties - New PropertiesODataServiceFaultpublic boolean updateEntityInTableTransactional(String tableName, ODataEntry oldProperties, ODataEntry newProperties) throws ODataServiceFault
updateEntityInTableTransactional in interface ODataDataHandlertableName - Table NameoldProperties - Old PropertiesnewProperties - New PropertiesODataServiceFaultpublic Map<String,NavigationTable> getNavigationProperties()
ODataDataHandlergetNavigationProperties in interface ODataDataHandlerpublic void openTransaction()
openTransaction in interface ODataDataHandlerpublic void commitTransaction()
commitTransaction in interface ODataDataHandlerpublic void rollbackTransaction()
rollbackTransaction in interface ODataDataHandlerpublic void updateReference(String rootTableName, ODataEntry rootTableKeys, String navigationTable, ODataEntry navigationTableKeys) throws ODataServiceFault
updateReference in interface ODataDataHandlerrootTableName - Root - Table NamerootTableKeys - Root - Entity keys (Primary Keys)navigationTable - Navigation - Table NamenavigationTableKeys - Navigation - Entity Name (Primary Keys)ODataServiceFaultpublic void deleteReference(String rootTableName, ODataEntry rootTableKeys, String navigationTable, ODataEntry navigationTableKeys) throws ODataServiceFault
deleteReference in interface ODataDataHandlerrootTableName - Root - Table NamerootTableKeys - Root - Entity keys (Primary Keys)navigationTable - Navigation - Table NamenavigationTableKeys - Navigation - Entity Name (Primary Keys)ODataServiceFaultCopyright © 2019 WSO2. All rights reserved.