11

I have a class called LoginCommand in domain/my/package/name

class LoginCommand {

    String emailAddress
    String password

}

My question is why is a table be auto generated in my database for a ***Command object in grails? Are these command objects supposed to be placed ouside of /domain to avoid auto generation of a table by hibernate/orm.

benstpierre
  • 32,833
  • 51
  • 177
  • 288

1 Answers1

12

They should not go in grails-app/domain; they are not domain classes. Place them in src/groovy. Alternatively, a common convention is to put the command class in the same file as the controller that uses it.

Take a look at the Convention Over Configuration section in the grails manual to get an idea of what goes where.

ataylor
  • 64,891
  • 24
  • 161
  • 189