You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly thank you very much to build such useful framework. I am using it in my project. I have a use case for data privilege, for the same statement different user role would take different data privilege strategies. eg:
select a, b, c from ta
if current use a normal user then the return result of column c should be maksed as "xxxx", in our project (sass, multi-tenancy), there are many cases.
if the framework supports hooks, then we can handle the logic in one place. right now we mix such logic every where. it's not a good practice.
thank you!
The text was updated successfully, but these errors were encountered:
I'm going to add hooks to the library that will allow you to modify the generated SQL. I'm not sure that's what you are asking about however.
This library does not execute SQL - we defer that to either MyBatis or Spring. So if you need execution hooks, you will need to do it in those libraries. In MyBatis that would probably mean writing a plugin or interceptor - you can read about MyBatis plugins on this page: https://mybatis.org/mybatis-3/configuration.html
I'm going to add hooks to the library that will allow you to modify the generated SQL. I'm not sure that's what you are asking about however.
This library does not execute SQL - we defer that to either MyBatis or Spring. So if you need execution hooks, you will need to do it in those libraries. In MyBatis that would probably mean writing a plugin or interceptor - you can read about MyBatis plugins on this page: https://mybatis.org/mybatis-3/configuration.html
yeath, that what I wanted for BeforeHook. , back to AfterHook (my case) is to modify the result.(eg encrypt).
in order to control the BeforeHook and AfterHook precisely, there should be a context I can pass a flag/variable in it. for example If set a variable/flag in context in BeforeHook for a sql, in the following AfterHook I can tell that's the very sql I am caring about by checking(and using) the flag/variable (eg, using it to encrypt the value)
generally speaking: our use case can fall into two categories
1: simply using BeforeHook to modify the sql
2: Using BeforeHook and AfterHook together to modify the returned the result.
Firstly thank you very much to build such useful framework. I am using it in my project. I have a use case for data privilege, for the same statement different user role would take different data privilege strategies. eg:
select a, b, c from ta
if current use a normal user then the return result of column c should be maksed as "xxxx", in our project (sass, multi-tenancy), there are many cases.
if the framework supports hooks, then we can handle the logic in one place. right now we mix such logic every where. it's not a good practice.
thank you!
The text was updated successfully, but these errors were encountered: