Last change
on this file since 5549 was
5549,
checked in by olhsha@mpi.nl, 10 years ago
|
Added group service. Tested via the tomcat on loclahots (test URI and postman), old unit tests are adjusted and work well. Todo: retest on localhost tomcat, look at run-time exceptions, add new unit tests, adjust front-end
|
-
Property svn:mime-type set to
text/plain
|
File size:
979 bytes
|
Rev | Line | |
---|
[3785] | 1 | package clarin.cmdi.componentregistry.persistence.jpa; |
---|
[3449] | 2 | |
---|
| 3 | import java.util.List; |
---|
| 4 | |
---|
| 5 | import org.springframework.dao.DataAccessException; |
---|
[3785] | 6 | import org.springframework.data.jpa.repository.JpaRepository; |
---|
| 7 | import org.springframework.data.jpa.repository.Query; |
---|
[3449] | 8 | |
---|
| 9 | import clarin.cmdi.componentregistry.model.RegistryUser; |
---|
| 10 | |
---|
| 11 | /** |
---|
| 12 | * |
---|
| 13 | * @author george.georgovassilis@mpi.nl |
---|
| 14 | * |
---|
| 15 | */ |
---|
[3785] | 16 | public interface UserDao extends JpaRepository<RegistryUser, Long>{ |
---|
[3449] | 17 | |
---|
[3785] | 18 | @Query("select u from RegistryUser u order by id") |
---|
[3449] | 19 | List<RegistryUser> getAllUsers() throws DataAccessException; |
---|
| 20 | |
---|
| 21 | /** |
---|
| 22 | * |
---|
| 23 | * @param principalName User's principal name |
---|
| 24 | * @return User, if it exists |
---|
| 25 | * @throws DataAccessException |
---|
| 26 | */ |
---|
[3785] | 27 | @Query("select u from RegistryUser u where u.principalName = ?1") |
---|
[3449] | 28 | RegistryUser getByPrincipalName(String principalName) |
---|
| 29 | throws DataAccessException; |
---|
[5549] | 30 | |
---|
| 31 | @Query("select u from RegistryUser u where u.id = ?1") |
---|
| 32 | RegistryUser getPrincipalNameById(Number id) throws DataAccessException; |
---|
[3449] | 33 | |
---|
| 34 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.