Results 1 to 3 of 3

Thread: Adding where clauses dinamically from database with AOP and myBatis

  1. #1
    Join Date
    Jul 2011
    Posts
    2

    Default 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. #2
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,796

    Default

    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?
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

  3. #3
    Join Date
    Jul 2011
    Posts
    2

    Default

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •