LoginSignup
2
1

More than 5 years have passed since last update.

MyBatis の文字列比較

Last updated at Posted at 2018-06-04

MyBatis を使ってて xml で動的SQLの記載で情報が発散していたので実際にどうすればよいか確認中
シングルコーテーション使えるのか?

他のメンバーが確認してダメだったと報告あり...
どんな Exception 発生したかは確認できず...
いったんは char 型だけど業務仕様として数字しか入らないからシングルコーテーションなしでクリア
また必要になったときに確認予定

   <!-- Exception発生 -->
    select * from table
    <if test="args != '9'">
        where colum = #{args}
    </if> 

   <!-- いったんの対応 -->
    select * from table
    <if test="args != 9">
        where colum = #{args}
    </if> 

2
1
3

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
2
1