public class CassandraDataHandler extends Object implements ODataDataHandler
ODataDataHandler
Constructor and Description |
---|
CassandraDataHandler(String configID,
com.datastax.driver.core.Session session,
String keyspace) |
Modifier and Type | Method and Description |
---|---|
void |
commitTransaction()
This method commits the transaction.
|
boolean |
deleteEntityInTable(String tableName,
ODataEntry entity)
This method deletes entity from table.
|
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 all the primary keys in the database tables.
|
List<String> |
getTableList()
This method return names of all the tables in the database.
|
Map<String,Map<String,DataColumn>> |
getTableMetadata()
This method return database table metadata.
|
ODataEntry |
insertEntityToTable(String tableName,
ODataEntry entity)
This method inserts entity to table.
|
void |
openTransaction()
This method opens the transaction.
|
List<ODataEntry> |
readTable(String tableName)
This method read the table data and return.
|
List<ODataEntry> |
readTableWithKeys(String tableName,
ODataEntry keys)
This method read the table with Keys and return.
|
void |
rollbackTransaction()
This method rollbacks the transaction.
|
boolean |
updateEntityInTable(String tableName,
ODataEntry newProperties)
This method updates entity in table.
|
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 List<ODataEntry> readTable(String tableName) throws ODataServiceFault
ODataDataHandler
readTable
in interface ODataDataHandler
tableName
- Name of the tableODataServiceFault
DataEntry
public List<ODataEntry> readTableWithKeys(String tableName, ODataEntry keys) throws ODataServiceFault
ODataDataHandler
readTableWithKeys
in interface ODataDataHandler
tableName
- Name of the tablekeys
- Keys to checkODataServiceFault
DataEntry
public ODataEntry insertEntityToTable(String tableName, ODataEntry entity) throws ODataServiceFault
ODataDataHandler
insertEntityToTable
in interface ODataDataHandler
tableName
- Name of the tableentity
- EntityODataServiceFault
public boolean deleteEntityInTable(String tableName, ODataEntry entity) throws ODataServiceFault
ODataDataHandler
deleteEntityInTable
in interface ODataDataHandler
tableName
- Name of the tableentity
- EntityODataServiceFault
public boolean updateEntityInTable(String tableName, ODataEntry newProperties) throws ODataServiceFault
ODataDataHandler
updateEntityInTable
in interface ODataDataHandler
tableName
- Name of the tablenewProperties
- New PropertiesODataServiceFault
public boolean updateEntityInTableTransactional(String tableName, ODataEntry oldProperties, ODataEntry newProperties) throws ODataServiceFault
ODataDataHandler
updateEntityInTableTransactional
in interface ODataDataHandler
tableName
- Table NameoldProperties
- Old PropertiesnewProperties
- New PropertiesODataServiceFault
public Map<String,Map<String,DataColumn>> getTableMetadata()
ODataDataHandler
getTableMetadata
in interface ODataDataHandler
DataColumn
public List<String> getTableList()
ODataDataHandler
getTableList
in interface ODataDataHandler
public Map<String,List<String>> getPrimaryKeys()
ODataDataHandler
getPrimaryKeys
in interface ODataDataHandler
public Map<String,NavigationTable> getNavigationProperties()
ODataDataHandler
getNavigationProperties
in interface ODataDataHandler
public void openTransaction() throws ODataServiceFault
ODataDataHandler
openTransaction
in interface ODataDataHandler
ODataServiceFault
public void commitTransaction()
ODataDataHandler
commitTransaction
in interface ODataDataHandler
public void rollbackTransaction() throws ODataServiceFault
ODataDataHandler
rollbackTransaction
in interface ODataDataHandler
ODataServiceFault
public void updateReference(String rootTableName, ODataEntry rootTableKeys, String navigationTable, ODataEntry navigationTableKeys) throws ODataServiceFault
ODataDataHandler
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
ODataDataHandler
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.