File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
src/main/java/org/jnosql/demoee Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ package org .jnosql .demoee ;
2
+
3
+ import jakarta .enterprise .context .ApplicationScoped ;
4
+ import jakarta .inject .Inject ;
5
+ import org .eclipse .jnosql .mapping .document .DocumentTemplate ;
6
+
7
+ import java .util .List ;
8
+ import java .util .Optional ;
9
+ import java .util .logging .Logger ;
10
+
11
+ @ ApplicationScoped
12
+ public class CameraService {
13
+
14
+ private static final Logger LOGGER = Logger .getLogger (CameraService .class .getName ());
15
+
16
+ @ Inject
17
+ DocumentTemplate template ;
18
+
19
+ public List <Camera > findAll () {
20
+ return template .select (Camera .class ).result ();
21
+ }
22
+
23
+ public List <Camera > findByName (String name ) {
24
+ return template .select (Camera .class )
25
+ .where ("name" )
26
+ .like (name )
27
+ .result ();
28
+ }
29
+
30
+ public Optional <Camera > findById (String id ) {
31
+ return template .find (Camera .class , id );
32
+ }
33
+
34
+ public void deleteById (String id ) {
35
+ template .delete (Camera .class , id );
36
+ }
37
+
38
+
39
+
40
+ }
You can’t perform that action at this time.
0 commit comments