Package com.vaadin.hilla.crud
Class CrudRepositoryService<T,ID,R extends org.springframework.data.repository.CrudRepository<T,ID> & org.springframework.data.jpa.repository.JpaSpecificationExecutor<T>>
java.lang.Object
com.vaadin.hilla.crud.ListRepositoryService<T,ID,R>
com.vaadin.hilla.crud.CrudRepositoryService<T,ID,R>
- All Implemented Interfaces:
CountService,CrudService<T,,ID> FormService<T,,ID> GetService<T,,ID> ListService<T>
public class CrudRepositoryService<T,ID,R extends org.springframework.data.repository.CrudRepository<T,ID> & org.springframework.data.jpa.repository.JpaSpecificationExecutor<T>>
extends ListRepositoryService<T,ID,R>
implements CrudService<T,ID>
A browser-callable service that delegates crud operations to a JPA
repository.
-
Constructor Summary
ConstructorsConstructorDescriptionCrudRepositoryService(R repository) Creates the service using the given repository. -
Method Summary
Modifier and TypeMethodDescriptionvoidDeletes the object with the given id.voidDeletes the objects with the given ids.@Nullable TSaves the given object and returns the (potentially) updated object.Saves the given objects and returns the (potentially) updated objects.Methods inherited from class com.vaadin.hilla.crud.ListRepositoryService
count, exists, get, getRepository, list, resolveEntityClass, toSpecMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.hilla.crud.ListService
list
-
Constructor Details
-
CrudRepositoryService
public CrudRepositoryService() -
CrudRepositoryService
Creates the service using the given repository.- Parameters:
repository- the JPA repository
-
-
Method Details
-
save
Description copied from interface:FormServiceSaves the given object and returns the (potentially) updated object.If you store the object in a SQL database, the returned object might have a new id or updated consistency version.
- Specified by:
savein interfaceFormService<T,ID> - Parameters:
value- the object to save- Returns:
- the fresh object or
nullif no object was found to update
-
saveAll
Saves the given objects and returns the (potentially) updated objects.The returned objects might have new ids or updated consistency versions.
- Parameters:
values- the objects to save- Returns:
- the fresh objects
-
delete
Description copied from interface:FormServiceDeletes the object with the given id.- Specified by:
deletein interfaceFormService<T,ID> - Parameters:
id- the id of the object to delete
-
deleteAll
Deletes the objects with the given ids.- Parameters:
ids- the ids of the objects to delete
-