Class BaseRepository<T,ID>
java.lang.Object
com.serinity.accesscontrol.repository.base.BaseRepository<T,ID>
- Type Parameters:
T- entity type managed by the repositoryID- primary key type of the entity
- Direct Known Subclasses:
AuditLogRepository, AuthSessionRepository, ProfileRepository, UserFaceRepository, UserRepository
A base repository that support the common crud actions
- Since:
- 2026-02-04 BaseRepository.java
- Version:
- 1.0
- Author:
- @ZouariOmar (zouariomar20@gmail.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.zouarioss.skinnedratorm.core.EntityManagerEntity manager used for persistence operations.Runtime class of the managed entity. -
Constructor Summary
ConstructorsConstructorDescriptionBaseRepository(org.zouarioss.skinnedratorm.core.EntityManager em, Class<T> entityClass) Constructs a repository for the given entity class. -
Method Summary
Modifier and TypeMethodDescriptionvoidDeletes an entity from the database.voiddeleteById(ID id) Deletes an entity identified by its primary key, if it exists.findAll()Returns all entities of this type from the database.Finds an entity by its primary key.voidPersists a new entity to the database.voidUpdates an existing entity in the database.
-
Field Details
-
em
protected final org.zouarioss.skinnedratorm.core.EntityManager emEntity manager used for persistence operations. -
entityClass
-
-
Constructor Details
-
BaseRepository
-
-
Method Details
-
save
Persists a new entity to the database.- Parameters:
entity- the entity to save
-
update
Updates an existing entity in the database.- Parameters:
entity- the entity with updated field values
-
findById
-
delete
Deletes an entity from the database.- Parameters:
entity- the entity instance to remove
-
deleteById
Deletes an entity identified by its primary key, if it exists.- Parameters:
id- the primary key of the entity to delete
-
findAll
-