This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CommandConsoleHandler extends AbstractMessageHandler { | |
@Override | |
protected void handleMessageInternal(Message<?> message) throws Exception { | |
// do something.... | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* imports... */ | |
@Repository | |
public interface MyRepository extends PagingAndSortingRepository<MyEntity, UUID> { | |
@Query(value = "select * from my_entity where \n--#pageable\n", nativeQuery = true) | |
Page<MyEntity> findExamplePageWithPageable(Pageable pageable); | |
@Query(value = "select * from (select rownum() as RN, me.* from my_entity me) where RN between ?#{#pageable.offset - 1} and ?#{#pageable.offset + #pageable.pageSize}", | |
countQuery = "select count(me.id) from my_entity me", nativeQuery = true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Controller | |
public class GreetingController { | |
@RequestMapping("/greeting") | |
public String greeting(@RequestParam(value="name", required=false, defaultValue="World") String name, Model model) { | |
model.addAttribute("name", name); | |
model.addAttribute("strings", Arrays.asList("one", "two", "ten")); | |
return "greeting"; | |
} | |
} |