LoginSignup
0
0

More than 3 years have passed since last update.

【Java Spring】 mybatisのSpring bootでの設定

Posted at

mybatisのSpring bootでの設定

application.ymlへの設定の記述

mybatisを使用して、Javaのオブジェクトと、DBの項目の紐付け(マッピング)を行うために、
Javaではキャメルケース(objectExampleのような書き方)で記述をし、
DBの項目はスネークケースを使用している場合に、下記の設定を行う事で、
自動的にmybatis側で変換を行い、マッピングをしてくれる。

application.yml
mybatis:
    mapper-locations: classpath*:/mapper/**/*.xml
    type-aliases-package:
      紐付けを行うJavaオブジェクトのパス
    configuration:
      map-underscore-to-camel-case: true

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0