public class Transaction extends Object implements TransactionCommands
| Constructor and Description |
|---|
Transaction(ObjectRepository objectRepository,
LDPathEvaluatorConfiguration evaluatorConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
void |
begin() |
void |
clearContext(String context)
Removes all triples from the given context.
|
void |
clearContext(org.openrdf.model.URI context)
Removes all triples from the given context.
|
void |
close() |
void |
commit()
Commits the active transaction.
|
<T> T |
createObject(Class<T> clazz) |
<T> T |
createObject(Class<T> clazz,
org.openrdf.model.Resource id) |
QueryService |
createQueryService()
Create query service
|
<T extends ResourceObject> |
findAll(Class<T> type)
Queries for all instances of the RDF class connected with the given class
|
<T extends ResourceObject> |
findByID(Class<T> type,
String id) |
<T extends ResourceObject> |
findByID(Class<T> type,
org.openrdf.model.URI id) |
ObjectConnection |
getConnection() |
org.openrdf.model.URI |
getInsertContext() |
org.openrdf.model.URI[] |
getReadContexts() |
org.openrdf.model.URI[] |
getRemoveContexts() |
boolean |
isActive()
Indicates if a transaction is currently active on the connection.
|
void |
persist(ResourceObject resource)
Writes the resource object to the configured SPARQL endpoint with a corresponding INSERT query.
|
void |
rollback()
Rolls back all updates in the active transaction.
|
void |
setAllContexts(org.openrdf.model.URI context) |
void |
setInsertContext(org.openrdf.model.URI context) |
void |
setReadContexts(org.openrdf.model.URI... contexts) |
void |
setRemoveContexts(org.openrdf.model.URI... contexts) |
public Transaction(ObjectRepository objectRepository, LDPathEvaluatorConfiguration evaluatorConfiguration) throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryExceptionpublic boolean isActive()
throws org.openrdf.repository.RepositoryException
begin() has been called, and becomes
inactive after commit() or rollback() has been called.true iff a transaction is active, false iff no transaction is active.org.openrdf.repository.RepositoryExceptionpublic void begin()
throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryExceptionpublic void commit()
throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryExceptionpublic void rollback()
throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryExceptionpublic void setReadContexts(org.openrdf.model.URI... contexts)
public void setInsertContext(org.openrdf.model.URI context)
public void setRemoveContexts(org.openrdf.model.URI... contexts)
public void setAllContexts(org.openrdf.model.URI context)
public org.openrdf.model.URI[] getReadContexts()
public org.openrdf.model.URI getInsertContext()
public org.openrdf.model.URI[] getRemoveContexts()
public void persist(ResourceObject resource) throws org.openrdf.repository.RepositoryException
persist in interface TransactionCommandsresource - resource object to write to the SPARQL endpointorg.openrdf.repository.RepositoryExceptionpublic <T extends ResourceObject> T findByID(Class<T> type, String id) throws org.openrdf.repository.RepositoryException
findByID in interface TransactionCommandsorg.openrdf.repository.RepositoryExceptionpublic <T extends ResourceObject> T findByID(Class<T> type, org.openrdf.model.URI id) throws org.openrdf.repository.RepositoryException
findByID in interface TransactionCommandsorg.openrdf.repository.RepositoryExceptionpublic void clearContext(org.openrdf.model.URI context)
throws org.openrdf.repository.RepositoryException
clearContext in interface TransactionCommandscontext - context to clearorg.openrdf.repository.RepositoryExceptionpublic void clearContext(String context) throws org.openrdf.repository.RepositoryException
clearContext in interface TransactionCommandscontext - context to clearorg.openrdf.repository.RepositoryExceptionpublic <T extends ResourceObject> List<T> findAll(Class<T> type) throws org.openrdf.repository.RepositoryException
findAll in interface TransactionCommandstype - Class with connected RDF typeorg.openrdf.repository.RepositoryExceptionpublic QueryService createQueryService()
createQueryService in interface TransactionCommandspublic <T> T createObject(Class<T> clazz) throws org.openrdf.repository.RepositoryException, IllegalAccessException, InstantiationException
createObject in interface TransactionCommandsorg.openrdf.repository.RepositoryExceptionIllegalAccessExceptionInstantiationExceptionpublic <T> T createObject(Class<T> clazz, org.openrdf.model.Resource id) throws org.openrdf.repository.RepositoryException, IllegalAccessException, InstantiationException
createObject in interface TransactionCommandsorg.openrdf.repository.RepositoryExceptionIllegalAccessExceptionInstantiationExceptionpublic void close()
throws org.openrdf.repository.RepositoryException
org.openrdf.repository.RepositoryExceptionpublic ObjectConnection getConnection()
Copyright © 2016 Chair of Distributed Information Systems - University of Passau. All rights reserved.