Hello All
my task looks pretty trivial I'm usign spring security pllugin and I want to find all users that have specific role
I have SpringSecurity instances
BtvUserBtvRole {
BtvUser btvUser
BtvRole btvRole
}
What I'm tring to do
BtvUserBtvRole.withCriteria {
btvRole{
eq 'authority', Role.Manager.authority
}
projections{
property 'btvUser'
}
}
I have very strange exception
2012-01-02 17:16:08,548 ["http-bio-8080"-exec-7] DEBUG hibernate.SQL - select this_.userid as y0_ from UserRole this_ where (btvrole_al1_.authority=?)
| Error 2012-01-02 17:16:08,550 ["http-bio-8080"-exec-7] ERROR util.JDBCExceptionReporter - ERROR: missing FROM-clause entry for table "btvrole_al1_"
Position: 55
| Error 2012-01-02 17:16:08,567 ["http-bio-8080"-exec-7] ERROR errors.GrailsExceptionResolver - PSQLException occurred when processing request: [GET] /order/list
ERROR: missing FROM-clause entry for table "btvrole_al1_"
Position: 55. Stacktrace follows:
Message: ERROR: missing FROM-clause entry for table "btvrole_al1_"
Position: 55
Line | Method
It looks like Grails don't generate all tables in SQL query. There is no Role table in from cause.
Thanks!
Grygoriy Mykhalyuno
Thanks
Grygoriy Mykhalyuno
www.grygoriy.com