views:

102

answers:

3

To get around this I have to move such classes to src/groovy. It would be nice to have all of my domain model classes in the domains directory rather than split them up.

Update 1: This is a popular (look for GRAILS-2515) requested feature on the Grails Jira page. If anyone is interested in this feature you can vote and track it here.

Update on GRAILS-2515: static mapWith = "none" should do the trick in 1.3.5.

+2  A: 

No. It is not.

diamandiev
Yes it is. It works with Grails 1.3.5
mfloryan
when i answered it was not.
diamandiev
A: 

It is only possible to mark certain properties on the domain object as 'transient' so that they are not persisted to the database. Otherwise, all domain objects are persisted.

UPDATE

With the most recent release of Grails 1.3.5 (released Oct 4 2010) it is now possible to disable persistence of a domain class. Add the following to the domain class:

static mapWith = "none"

There is a JIRA ticket with further details.

mfloryan
+3  A: 

If I might add 2 words to your question: against convention! Grails is all about convention over configuration and doing what you'd like to do is against it.

Matthias Hryniszak
convention works 95% of time. but sometimes a few brave ones have to break away from it :)
numes
Yeah... and then there comes the new developer, hoping someone knew what they were doing and faces the imminent disappointment...
Matthias Hryniszak
The concept is "convention over [preferred to] configuration", not "convention no configuration possible".
Fletch
You're right... but still conforming to the convention makes life easier for everybody, don't you think?
Matthias Hryniszak