1 Reply Latest reply on Jun 25, 2015 2:54 PM by Arthur Gregório

    Strange behavior on query for roles

    Arthur Gregório Newbie

      I'm initializing my security model with this class: web-budget/SecurityInitializer.java at experimental · arthurgregorio/web-budget · GitHub

       

      But when i query for roles on line #78 if is the first cycle of the "for", the role is inserted, because the database is empty. The problema is when the second interaction on for is executed, the "hasRole" method return false, because "query.getResultList()" on line #184 has a not empty list.

       

      Firts time for runs, empty database, no roles saved:

      for1.png

      Second time of for running

      for2.png

      in this time, database still empty, the role that i query for is different from the first role, and the role that PL gave to me has a empty name...

       

      any idea why this happening?

       

      Another resources:

       

      Role entity: web-budget/RoleTypeEntity.java at experimental · arthurgregorio/web-budget · GitHub

      Role model: web-budget/Role.java at experimental · arthurgregorio/web-budget · GitHub

      PL configuration: web-budget/SecurityConfiguration.java at experimental · arthurgregorio/web-budget · GitHub

       

      Btw, this is a open source project, if anyone want to fix this and pull request, i'm glad to accept!