I am trying to avoid having an additional xml to define the mapper in mybatis3. Annotation fits right in.
I am a bit confused by the usage of @SelectProvider/@InsertProvider/etc. Don't think there are many resources online guiding me through this.
Basically, I will like to find the annotation version of alternative for in mybatis3.
For example, I have a xml mapper and I wanna convert it to use annotation
Could anyone provide a concrete answer/solution including the code?
Thanks in advance!
解决方案
An alternative solution for you
you can add at the beginning of your @annotation
@Update("""
update Author
username=#{username},
password=#{password},
email=#{email},
bio=#{bio}
where id=#{id}
""")
In additional, we compile .groovy to .class in our projects, thus, we can write SQL in @annotation like above