1
|
package vldc.aswi.dao;
|
2
|
|
3
|
import org.springframework.data.repository.CrudRepository;
|
4
|
import org.springframework.stereotype.Repository;
|
5
|
import vldc.aswi.domain.Assembly;
|
6
|
import vldc.aswi.domain.Role;
|
7
|
|
8
|
import java.util.List;
|
9
|
|
10
|
/**
|
11
|
* Repository for domain Assembly.
|
12
|
*/
|
13
|
@Repository
|
14
|
public interface AssemblyRepository extends CrudRepository<Assembly, Long> {
|
15
|
|
16
|
/**
|
17
|
* Find Assembly by its ID.
|
18
|
* @param Id - Assembly Id.
|
19
|
* @return Assembly if ID is present in database.
|
20
|
*/
|
21
|
Assembly getById(Long Id);
|
22
|
|
23
|
|
24
|
/**
|
25
|
* Find record with highest order.
|
26
|
* @return Assembly with highest order.
|
27
|
*/
|
28
|
Assembly findFirst1ByOrderByAssemblyOrder();
|
29
|
|
30
|
/**
|
31
|
* Find assemblies, order by order
|
32
|
* @return ordered assemblies
|
33
|
*/
|
34
|
List<Assembly> getByOrderByAssemblyOrderAsc();
|
35
|
|
36
|
/**
|
37
|
* Find assemblies with role, order by order
|
38
|
* @param role role of the user
|
39
|
* @param isPublic value of the isPublic attribute
|
40
|
* @return ordered assemblies
|
41
|
*/
|
42
|
List<Assembly> getByRolesContainingAndIsPublicOrderByAssemblyOrderAsc(Role role, int isPublic);
|
43
|
}
|