1
|
package vldc.aswi.dao;
|
2
|
|
3
|
import vldc.aswi.domain.User;
|
4
|
import org.springframework.data.repository.CrudRepository;
|
5
|
import org.springframework.stereotype.Repository;
|
6
|
|
7
|
/**
|
8
|
* Repository for domain User.
|
9
|
*/
|
10
|
@Repository
|
11
|
public interface UserRepository extends CrudRepository<User, Long> {
|
12
|
|
13
|
/**
|
14
|
* Find User by his ID.
|
15
|
* @param Id - User Id.
|
16
|
* @return User if ID is present in database.
|
17
|
*/
|
18
|
User getById(Long Id);
|
19
|
|
20
|
/**
|
21
|
* Find User by his username.
|
22
|
* @param username user's username.
|
23
|
* @return User if username is presented in database.
|
24
|
*/
|
25
|
User findByUsername(String username);
|
26
|
}
|