Add method to find id by URI
... to avoid loading the entity if we only want to link it to another
entity with entityManager.getReference(id)
@@ -26,6 +26,9 @@ import won.protocol.model.DatasetHolder;
* Repository for jena datasets (wrapped in DatasetHolders)
*/
public interface DatasetHolderRepository extends CrudRepository<DatasetHolder, URI> {
+ @Query("select id from DatasetHolder d where d.uri = :uri")
+ Optional<Long> findIdByUri(URI uri);
+
Optional<DatasetHolder> findOneByUriAndVersionNot(URI uri, Integer version);
Optional<DatasetHolder> findOneByUri(URI uri);
