okinawa

IT勉強メモ

Spring

React・Spring Boot・MySQL・VSCode環境構築

前提 Spring Boot MySQL React ReactからSpring Bootに接続(CORS設定) Redux 前提 Java node.js VsCode はインストール済み。 Spring Boot ・参考 qiita.com 1,拡張機能のインストール Java Extension Pack Spring Boot Extension Pack 2,Spring Boot…

Spring Boot基礎&リンク集

Spring Boot全体の参考サイト Dependency Injection(依存性の注入)の参考サイト アノテーション DIコンテナから呼び出すには? Beanとは Dependency Injection(依存性の注入)とは 基礎記事を書こうと思ったけど、すでに素晴らしい記事があったのでリンク集…

Spring Boot起動時エラー field in required a bean of type that could not be found

現象 状況 原因 同じ状況での解決方法が、ネット上に見つからなかったのでメモ。 現象 Spring Boot起動時に出たエラー。 ************************* APPLICATION FAILED START ************************* Description: Field 'MapperInterface名' in 'Servic…

thymeleafで使えるページングのメソッド一覧

PageImplクラスのメソッドが使えるようです。 spring.pleiades.io こんな感じでメソッド名そのままで使えるんです。 知らなかったなあ。 どういう仕組みなんだろ。 <p th:text="${page.getSize}"></p> <p th:text="${page.getNumber}"></p> <p th:text="${page.NumberOfElements}"></p> <p th:text="${page.getContent}"></p> <p th:text="${page.hasContent}"></p>

@PageableDefaultでページのソートやサイズ指定など

spring.pleiades.io @PageableDefaultでページのソート、サイズ指定、開始ページ指定ができるよ。 かんたんだよ。 @Controller public class AccountController { @Autowired private Service service; @GetMapping("/hello") public String getHello( @Page…

JPAでの複数ワード検索(動的クエリ・動的SQL・ページング・照合順序)

参考 注意点 ポイント ソース Googleみたいにスペース区切りでAND検索したくて作ったやつ。 なおかつページングと照合順序(collate)も入れたかった。 例:「東京 銭湯」 参考 ・setPrameterの参考 qiita.com ・ページスライスの参考 hibernate - Implementi…

SpringBootでページング

SpringBootでページング ・概要 Page<T>のTにコンテンツをぶち込むと、コンテンツ量に応じてページ分割してくれる。 TはEntityクラスとかFormクラス。 参考 https://qiita.com/tanibuchi12/items/6c8fedbc19bdb277d6f2 https://qiita.com/KevinFQ/items/ca…

SpringでJPAメモ

SpringでJPA JPAはDBとのやりとりを簡単にしてくれる。 クエリメソッドでSQLを自動生成。 SpringBoot + JPA + Thymeleafで簡単なCRUDを作る②~画面と機能作成まで~ https://qiita.com/ozaki25/items/3b348874b6db5ab4f04f DB側で必要な設定は↓ 参考:@Gener…