LoginSignup
0
1

More than 3 years have passed since last update.

DBFluteとSpring および DBFluteの記法

Posted at

DBFluteがSpring上でどのように動くのか公式の記載を抜粋する。

公式リンク

DIコンテナへの登録

DBFluteで自動生成されたクラスのDIについての設定が定義されたクラス。
自動生成クラスをConfigurationの対象としている。
自動生成されるパッケージのうちDIされるのはexbhvのみ。

DBFluteBeansJavaConfig
@Configuration
@ComponentScan(value="com.xxx.dbflute.exbhv", lazyInit=true)
public class DBFluteBeansJavaConfig {

データソースの利用

デフォルトはdataSourceというコンポーネント名で利用(Autowired?)される。
そうでない場合、プロパティ名「dbfluteBeansDataSourceName」を変更する。

dependencyInjectionMap.dfprop
    # /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # o dbfluteBeansDataSourceName: (NotRequired - Default 'dataSource')
    #  The data source name that DBFlute(Behaviors) uses.
    #
    # @SpringOnly
    #; dbfluteBeansDataSourceName = exampleDataSource ★ここをいじる。
    # - - - - - - - - - -/
0
1
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
1