I am using Spring JPA for database access. I am able to find examples such as findByName and countByName, for which I dont have to write any method implementation. I am hoping to find examples for delete a group of records based on some condition. Does Spring JPA support deleteByName-like delete? Any pointer is appreciated. Regards and thanks.
[Java][Spring Boot] @Transactionalでトランザクション処理してロールバックする。 はじめに データベースに対して日常的に行っている処理で、複数のクエリを実行し、どこかでエラーが発生したらなかった事にしたいという事が有ります。 トランザクションを使ってロールバックするという事ですね。 これはSpringの@Transactionalをアノテートする事で実現できるという事で試してみました。 環境 Mac OSX 10.10.5 Yosemite Java 1.8.0_91 Spring Boot 1.3.7 PostgreSQL 9.5.1 Eclipse Mars テーブル CREATE TABLE public.fruit ( id VARCHAR(2) NOT NULL, name VARCHAR(10), price integer, PRIMARY K
最近、Spring Frameworkを使用したプロジェクトで便利なBeanマッピングライブラリを使用したので紹介します。 1. 概要 Beanマッピングとは、一つのBeanを他のBeanにフィールド値をコピーすることで、アプリケーション層とドメイン層で、データの受け渡しをする場合に使用することが多いです。 MVCにおける例としては、コントローラで受け取ったFormオブジェクトと、Entityオブジェクトを相互に変換するケースがよくあります。 今回はConvention(規約)ベースを謳っているModelMapperを使用してみました。 2. 利用するメリット ModelMapperを使用した場合と使用しない場合のコード例を挙げます。 2.1. 煩雑になり、プログラムの見通しが悪くなる例 User user = userService.findById(userId); XxxOutput
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く