How do I add custom methods to the mapper file via the elipse MGB plugin(1.4.0)

19 views
Skip to first unread message

ip d

unread,
Apr 15, 2020, 11:12:28 AM4/15/20
to mybatis-user
     Recently, I found in my project that there are too few methods for plug-in generation. How can I add methods for plug-in generation.
     such as
   
        @SelectProvider(type=SqlProviderAdapter.class, method="select")
        List<Integer> selectColByCondition(SelectStatementProvider selectStatement);
int countByCondition(T condition);
List<Integer> selectKeyColByCondition(T condition);
Optional<T> selectOneByCondition(T condition);
List<T> selectByCondition(T condition);
List<T> selectPageByCondition(T condition, int pageSize, int offset);
int updateByCondition(T sets, T condition);
int deleteByCondition(T condition);
 
      I always have to manually add these methods to the generated file. How do I configure automatic generation.
 

Jeff Butler

unread,
Apr 15, 2020, 3:32:16 PM4/15/20
to mybati...@googlegroups.com
MBG doesn't create methods like this. You could write an MBG plugin to add more methods to the generated code. If you see them in other parts of your codebase, then perhaps someone else has already created such a plugin.

Jeff Butler


--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/d4883cd5-6438-4513-9bd5-1873d33618bd%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages