Dean Hiller
Dean Hiller

Reputation: 20190

mybatis - how to get rid of mapping file and just use annotations

I was looking at this wonderful mybatis example

http://mybatis.co.uk/index.php/2010/09/mybatis-simple-and-complete-example.html

that uses mostly annotations but was hoping for an @MyBatisDao annotation so I don't need to ever go back to some mapping file and add a line for each dao that I add to the system. I obviously will just use mapping for now but was just curious if there was a way???

Upvotes: 0

Views: 1976

Answers (1)

Diego Lopez
Diego Lopez

Reputation: 594

You can use the package element to let it scan for your mappers (since 3.1)

MyBatis 3.1 Reference Guide

Upvotes: 3

Related Questions