Announcement Announcement Module
Collapse
No announcement yet.
Adding where clauses dinamically from database with AOP and myBatis Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding where clauses dinamically from database with AOP and myBatis

    Hello,

    We are using MyBatis 3.0.3 & Spring 3.0.5 in our project.

    We are trying to implement data level security through a table which stores where clauses (userid < 200, active == true, ...).

    So, the problem comes when we want to add a clause to a select query dinamically in execution time.

    We are thinking about the possibility of using Spring AOP but we are not sure if it is possible or not, if it is a good solution and appart from that we don't know how to implement it.

    Please share your thoughts.

    Thanks in advance,

    Silvia.

  • #2
    What do you mean with

    So, the problem comes when we want to add a clause to a select query dinamically in execution time.
    Could you post your code? how are your trying to get and send these dynamic values to MyBatis?

    Comment


    • #3
      Thank you very much for your interest.

      I am going to try to explain the problem in more detail:

      I am developing a security application where admin users can define clauses in a table so as to some users can't access to certain information.

      For example, the application can send this query to the database:

      SELECT * FROM OBJECTS WHERE ACTIVE = 'TRUE'

      And, on the other hand, the user who is logged in the application, can have a restrictive clause in the table OBJECTS like this:

      WHERE APPLICATION != SECURITY_APP.

      So, the big issue is that we will have to add more conditions to the SELECT query we are processing.

      I don't know if I could use aspects to add the additional clause to the SELECT query.

      Thanks in advance,

      Silvia.

      Comment

      Working...
      X