File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
src/main/java/org/jnosql/demoee Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,11 @@ public class CameraResource {
2525 CameraService service ;
2626
2727 @ GET
28- public List <Camera > listAll (@ QueryParam ("name " ) String name ) {
29- if (name == null ) {
28+ public List <Camera > listAll (@ QueryParam ("brand " ) String brand ) {
29+ if (brand == null || brand . isBlank () ) {
3030 return service .findAll ();
3131 }
32- return service .findAll ( );
32+ return service .findByBrand ( brand );
3333 }
3434
3535
Original file line number Diff line number Diff line change @@ -21,11 +21,11 @@ public List<Camera> findAll() {
2121 return template .select (Camera .class ).result ();
2222 }
2323
24- public List <Camera > findByName (String name ) {
25- LOGGER .info ("Selecting cameras by name : " + name );
24+ public List <Camera > findByBrand (String brand ) {
25+ LOGGER .info ("Selecting cameras by brand : " + brand );
2626 return template .select (Camera .class )
27- .where ("name " )
28- .like (name )
27+ .where ("brand " )
28+ .like (brand )
2929 .result ();
3030 }
3131
You can’t perform that action at this time.
0 commit comments