Where should Grails Command objects be placed in the project structure?
Asked Answered
P

1

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.

Prerecord answered 15/4, 2013 at 20:26 Comment(0)
H
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.

Harrar answered 15/4, 2013 at 20:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.