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 ODataDataHandler
DataColumn
public List<String> getTableList()
getTableList
in interface ODataDataHandler
public Map<String,List<String>> getPrimaryKeys()
getPrimaryKeys
in interface ODataDataHandler
public List<ODataEntry> readTable(String tableName)
readTable
in interface ODataDataHandler
tableName
- Name of the tableDataEntry
public List<ODataEntry> readTableWithKeys(String tableName, ODataEntry keys) throws ODataServiceFault
readTableWithKeys
in interface ODataDataHandler
tableName
- Name of the tablekeys
- Keys to checkODataServiceFault
DataEntry
public ODataEntry insertEntityToTable(String tableName, ODataEntry entity)
insertEntityToTable
in interface ODataDataHandler
tableName
- Name of the tableentity
- EntityODataServiceFault
public boolean deleteEntityInTable(String tableName, ODataEntry entity) throws ODataServiceFault
deleteEntityInTable
in interface ODataDataHandler
tableName
- Name of the tableentity
- EntityODataServiceFault
public boolean updateEntityInTable(String tableName, ODataEntry newProperties) throws ODataServiceFault
updateEntityInTable
in interface ODataDataHandler
tableName
- Name of the tablenewProperties
- New PropertiesODataServiceFault
public boolean updateEntityInTableTransactional(String tableName, ODataEntry oldProperties, ODataEntry newProperties) throws ODataServiceFault
updateEntityInTableTransactional
in interface ODataDataHandler
tableName
- Table NameoldProperties
- Old PropertiesnewProperties
- New PropertiesODataServiceFault
public Map<String,NavigationTable> getNavigationProperties()
ODataDataHandler
getNavigationProperties
in interface ODataDataHandler
public void openTransaction()
openTransaction
in interface ODataDataHandler
public void commitTransaction()
commitTransaction
in interface ODataDataHandler
public void rollbackTransaction()
rollbackTransaction
in interface ODataDataHandler
public void updateReference(String rootTableName, ODataEntry rootTableKeys, String navigationTable, ODataEntry navigationTableKeys) throws ODataServiceFault
updateReference
in interface ODataDataHandler
rootTableName
- Root - Table NamerootTableKeys
- Root - Entity keys (Primary Keys)navigationTable
- Navigation - Table NamenavigationTableKeys
- Navigation - Entity Name (Primary Keys)ODataServiceFault
public void deleteReference(String rootTableName, ODataEntry rootTableKeys, String navigationTable, ODataEntry navigationTableKeys) throws ODataServiceFault
deleteReference
in interface ODataDataHandler
rootTableName
- Root - Table NamerootTableKeys
- Root - Entity keys (Primary Keys)navigationTable
- Navigation - Table NamenavigationTableKeys
- Navigation - Entity Name (Primary Keys)ODataServiceFault
Copyright © 2019 WSO2. All rights reserved.