I just installed Grails 3.2.0.M2 and created a new domain class named Group
. I then ran the generate-all *
command and attempted to browsed to the GroupController
, but was greeted with this error:
URI: /group/index
Class: org.h2.jdbc.JdbcSQLException
Message: null
Caused by: Syntax error in SQL statement "SELECT COUNT(*) AS Y0_ FROM GROUP[*] THIS_ "; expected "identifier"; SQL statement: select count(*) as y0_ from group this_ [42001-192]
Which is happening here:
def index(Integer max) {
params.max = Math.min(max ?: 10, 100)
respond Group.list(params), model:[groupCount: Group.count()] // Error occurs here
}
The weird thing is that the problem goes away if I rename the domain class and controller to Groupz
and GroupzController
respectively. Why can't I name my domain class group? What other names are illegal for domain classes?