Class ArtistDao
java.lang.Object
org.eclipse.rdf4j.spring.dao.RDF4JDao
org.eclipse.rdf4j.spring.dao.RDF4JCRUDDao<Artist,Artist,IRI>
org.eclipse.rdf4j.spring.dao.SimpleRDF4JCRUDDao<Artist,IRI>
org.eclipse.rdf4j.spring.demo.dao.ArtistDao
Class responsible for repository access for managing
Artist entities.
The class extends the SimpleRDF4JCRUDDao, providing capabilities for inserting and reading entities.
- Since:
- 4.0.0
- Author:
- Florian Kleedorfer
-
Nested Class Summary
Nested classes/interfaces inherited from class RDF4JDao
RDF4JDao.NamedSparqlSupplierFinishBuilder, RDF4JDao.NamedSparqlSupplierPreparerModifier and TypeClassDescriptionclassclass -
Field Summary
Fields inherited from class RDF4JCRUDDao
KEY_PREFIX_INSERT, KEY_PREFIX_UPDATE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected IRIgetInputId(Artist artist) Obtains the id of the input instance or null if it is new (or a partially populated composite key).protected NamedSparqlSuppliergetInsertSparql(Artist artist) Returns the SPARQL string used to write an instance of T to the database.protected StringReturns the SPARQL string used to read an instance of T from the database.protected ArtistmapSolution(BindingSet querySolution) Map one solution of the readQuery to the type of this DAO.protected voidpopulateBindingsForUpdate(MutableBindings bindingsBuilder, Artist artist) Sets the non-id bindings on for the write query such that the instance of type I is written to the database.protected voidpopulateIdBindings(MutableBindings bindingsBuilder, IRI iri) Binds the instance id to query variable(s).protected RDF4JDao.NamedSparqlSupplierPreparerMethods inherited from class RDF4JCRUDDao
convertIdToIri, delete, deleteForUpdate, generateNewId, getById, getByIdOptional, getUpdateSparql, list, newBindingsBuilder, postProcessMappedSolution, postProcessUpdate, save, saveAndReturnId, saveAndReturnIdModifier and TypeMethodDescriptionprotected IRIconvertIdToIri(IRI id) Converts the provided id to an IRI.voidNaive implementation usingRDF4JTemplate.delete(IRI).protected voiddeleteForUpdate(IRI id) When updating an entity viaRDF4JCRUDDao.save(Object), its triples are removed first using this method.protected IRIgenerateNewId(IRI providedId) Generates a new id for an entity.final ArtistObtains the entity with the specified id, throwing an exception if none is found.getByIdOptional(IRI id) Obtains an optional entity with the specified id.protected NamedSparqlSuppliergetUpdateSparql(Artist input) Returns the SPARQL string used to update an instance of T in the database.list()protected static BindingsBuilderReturns a new BindingsBuilder for your convenience.protected ArtistpostProcessMappedSolution(Artist entity) Callback invoked after mapping a solution to an entity, allowing subclasses to modify the entity before returning it to the client.protected voidpostProcessUpdate(Artist input, Map<String, Value> bindings) Callback invoked after a successful insert/update.final ArtistSaves the entity, loads it again and returns it.saveAndReturnId(Artist input) saveAndReturnId(Artist input, IRI id) Saves the entity and returns its (possibly newly generated) ID.Methods inherited from class RDF4JDao
getNamedGraphQuery, getNamedSparqlString, getNamedSparqlSupplier, getNamedTupleQuery, getNamedUpdate, getRdf4JTemplateModifier and TypeMethodDescriptionprotected GraphQueryEvaluationBuildergetNamedGraphQuery(String key) protected Stringprotected NamedSparqlSupplierObtains theNamedSparqlSupplierwith the specified key for use in, e.g.,RDF4JTemplate.tupleQuery(Class, NamedSparqlSupplier).protected TupleQueryEvaluationBuildergetNamedTupleQuery(String key) protected UpdateExecutionBuildergetNamedUpdate(String key) protected RDF4JTemplate
-
Constructor Details
-
ArtistDao
-
-
Method Details
-
populateIdBindings
Description copied from class:RDF4JCRUDDaoBinds the instance id to query variable(s).- Specified by:
populateIdBindingsin classRDF4JCRUDDao<Artist,Artist, IRI>
-
populateBindingsForUpdate
Description copied from class:RDF4JCRUDDaoSets the non-id bindings on for the write query such that the instance of type I is written to the database. ID bindings are set through populateIdBindings()- Overrides:
populateBindingsForUpdatein classRDF4JCRUDDao<Artist,Artist, IRI>
-
mapSolution
Description copied from class:RDF4JCRUDDaoMap one solution of the readQuery to the type of this DAO.- Overrides:
mapSolutionin classRDF4JCRUDDao<Artist,Artist, IRI>
-
getReadQuery
Description copied from class:RDF4JCRUDDaoReturns the SPARQL string used to read an instance of T from the database. The base implementation will cache the query string, so implementations should not try to cache the query.- Overrides:
getReadQueryin classRDF4JCRUDDao<Artist,Artist, IRI>
-
getInsertSparql
Description copied from class:RDF4JCRUDDaoReturns the SPARQL string used to write an instance of T to the database. The instance to be inserted is passed to the function so implementations can decide which query to use based on the instance.- Overrides:
getInsertSparqlin classRDF4JCRUDDao<Artist,Artist, IRI>
-
getInputId
Description copied from class:RDF4JCRUDDaoObtains the id of the input instance or null if it is new (or a partially populated composite key).- Overrides:
getInputIdin classRDF4JCRUDDao<Artist,Artist, IRI>
-
prepareNamedSparqlSuppliers
protected RDF4JDao.NamedSparqlSupplierPreparer prepareNamedSparqlSuppliers(RDF4JDao.NamedSparqlSupplierPreparer preparer) - Specified by:
prepareNamedSparqlSuppliersin classRDF4JDao
-
getArtistsWithoutPaintings
-