How to manage the mappedStatements of configuration, such as remove a statement with designative key

13 views
Skip to first unread message

何震东

unread,
Jun 6, 2019, 5:14:04 AM6/6/19
to mybatis-user
How to manage the mappedStatements of configuration, such as remove a statement with designative key.







ApplicationContext ctx = ApplicationContextUtil.getContext();
SqlSessionFactory sqlSessionFactory = (SqlSessionFactory) ctx.getBean("sqlSessionFactory");
Configuration configuration = sqlSessionFactory.getConfiguration();
C
ollection<MappedStatement> mappedStatements = configuration.getMappedStatements();

I want to remove a statement from original mappedStatements and update configuration

Iwao AVE!

unread,
Jun 11, 2019, 12:20:20 PM6/11/19
to mybatis-user
Hi,

It is not possible.
What do you want to achieve?

Regards,
Iwao


--
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/be010390-14c1-49b8-8946-fccaff9ca5d4%40googlegroups.com.

何震东

unread,
Jul 17, 2019, 11:35:53 AM7/17/19
to mybatis-user
hi
i want to write sql in the request and execute it by mybatis.so I push them to mapperstatement,but it bring
a big problem which result in mapperstatement keep more complexing and larger unless I restart the application

Iwao AVE!

unread,
Jul 18, 2019, 2:12:26 PM7/18/19
to mybatis-user
It sounds like a typical XY Problem.
https://en.wikipedia.org/wiki/XY_problem

You should explain the initial requirement.
Why can't you define SQLs in XML or annotation mappers?
Have you considered using SQL provider annotation? If it doesn't satisfy your requirement, how?

Regards,
Iwao

--
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.
Reply all
Reply to author
Forward
0 new messages