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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

ip d
     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.
 

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/d4883cd5-6438-4513-9bd5-1873d33618bd%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

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

Jeff Butler
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


On Wed, Apr 15, 2020 at 11:12 AM ip d <[hidden email]> wrote:
     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.
 

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/d4883cd5-6438-4513-9bd5-1873d33618bd%40googlegroups.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/CAKpaNj7eH0bcJSnORXqKPT0VLz2YPG%3DYL0YOO714ibr8pfuL9w%40mail.gmail.com.