-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi,
My Grails app has a User class and a Role class. The User class has an authorities property which holds the roles assigned to that user, e.g.
class User {
static hasMany = [authorities: Role]
// This method is called automatically after a user is inserted
def afterInsert() {
…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hello,
I'm trying to do the below sql statement in GORM
select * from table1 where table1.x not in
(select x from table 2 where y='something');
so, I have two tables, and needs to find the entries from table 1 which are not in table 2. In Grails
def xx= table2.findByY('something')
…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi, any quick tip to implement findAllByGreaterThan so I can filter those records which date field is today (from 00:00 up to present).
Thanks in advance
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi, can anybody tell me why this works
<g:each var="n" in="${com.pp.News.list()}">
<h2>${n.t}</h2>
<p>${n.tx}</p>
</g:each>
but this doesn't ?
<g:set var="news" value="${com.pp.News.findAllByShow(true,[sort:'prio', order:'desc',max:5])}" />
<g:each…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I want to map the result of a native SQL query to a simple bean in grails, similar to what the @SqlResultSetMapping annotation does.
For example, given a query
select x.foo, y.bar, z.baz from //etc...
map the result to
class FooBarBaz {
String foo
String bar
String baz
}
Can anyone provide…
>>> More