Interface UserRepository<D>
-
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<D,String>
,CustomizedUserRepository<D>
,com.broadleafcommerce.common.extension.DomainTypeAware
,org.springframework.data.repository.Repository<D,String>
- All Known Subinterfaces:
JpaUserRepository<D>
@NoRepositoryBean public interface UserRepository<D> extends org.springframework.data.repository.CrudRepository<D,String>, CustomizedUserRepository<D>
- Author:
- Jeff Fischer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.springframework.data.domain.Page<D>
findAllByArchivedFalse(org.springframework.data.domain.Pageable page)
Finds and returns all entities that are notUser.archived
.Optional<D>
findByEmailIgnoreCaseAndServerId(String email, String serverId)
Finds and returns the entity with the givenUser.email
andUser.serverId
.Optional<D>
findByIdAndArchivedFalse(String id)
Finds and returns the entity with the given ID if notUser.archived
.Optional<D>
findByServiceIdAndType(String serviceId, String type)
Finds the unique record whoseUser.serviceId
andUser.type
match the given values.Optional<D>
findByUsernameAndServerId(String username, String serverId)
Finds and returns the entity with the givenUser.username
andUser.serverId
.Optional<D>
findByUsernameAndServerIdAndArchivedFalse(String username, String serverId)
Optional<D>
findByUsernameIgnoreCaseAndServerId(String username, String serverId)
Optional<D>
findByUsernameIgnoreCaseAndServerIdAndArchivedFalse(String username, String serverId)
Case-insensitive find method that returns theUser
with the givenUser.username
andUser.serverId
if notUser.archived
.-
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteById, existsById, findAll, findAllById, findById, save, saveAll
-
Methods inherited from interface com.broadleafcommerce.auth.user.repository.CustomizedUserRepository
replaceOnlyIfLastUpdatedBefore
-
-
-
-
Method Detail
-
findByIdAndArchivedFalse
Optional<D> findByIdAndArchivedFalse(String id)
Finds and returns the entity with the given ID if notUser.archived
.- Parameters:
id
- the id of the entity to find- Returns:
- an
Optional
containing the entity if found,Optional.empty()
otherwise
-
findAllByArchivedFalse
org.springframework.data.domain.Page<D> findAllByArchivedFalse(org.springframework.data.domain.Pageable page)
Finds and returns all entities that are notUser.archived
.- Parameters:
page
- information about which page of results to return from the database- Returns:
- all entities that are not archived
-
findByEmailIgnoreCaseAndServerId
Optional<D> findByEmailIgnoreCaseAndServerId(String email, String serverId)
Finds and returns the entity with the givenUser.email
andUser.serverId
.- Parameters:
email
- the email to match againstUser.email
serverId
- the server ID to match againstUser.serverId
- Returns:
- an
Optional
containing the entity if found,Optional.empty()
otherwise
-
findByUsernameAndServerId
Optional<D> findByUsernameAndServerId(String username, String serverId)
Finds and returns the entity with the givenUser.username
andUser.serverId
.- Parameters:
username
- the username to match againstUser.username
serverId
- the server ID to match againstUser.serverId
- Returns:
- an
Optional
containing the entity if found,Optional.empty()
otherwise
-
findByUsernameIgnoreCaseAndServerId
Optional<D> findByUsernameIgnoreCaseAndServerId(String username, String serverId)
- Parameters:
username
- the username to match againstUser.username
serverId
- the server ID to match againstUser.serverId
- Returns:
- an
Optional
containing the entity if found,Optional.empty()
otherwise
-
findByUsernameAndServerIdAndArchivedFalse
Optional<D> findByUsernameAndServerIdAndArchivedFalse(String username, String serverId)
- Parameters:
username
- the username to match againstUser.username
serverId
- the server ID to match againstUser.serverId
- Returns:
- an
Optional
containing the entity if found,Optional.empty()
otherwise
-
findByUsernameIgnoreCaseAndServerIdAndArchivedFalse
Optional<D> findByUsernameIgnoreCaseAndServerIdAndArchivedFalse(String username, String serverId)
Case-insensitive find method that returns theUser
with the givenUser.username
andUser.serverId
if notUser.archived
.- Parameters:
username
- the username to match againstUser.username
serverId
- the server ID to match againstUser.serverId
- Returns:
- an
Optional
containing the entity if found,Optional.empty()
otherwise
-
findByServiceIdAndType
Optional<D> findByServiceIdAndType(String serviceId, String type)
Finds the unique record whoseUser.serviceId
andUser.type
match the given values. Since records are only guaranteed unique if bothUser.serviceId
andUser.type
are present, this method does not accept null values for either argument.- Parameters:
serviceId
- the service id to match against. Must not be null.type
- the type to match against. Must not be null.- Returns:
- the record whose
User.serviceId
andUser.type
match the given values
-
-