Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ul> <li><p>To add to Chris King's suggestion on save, I wrote a reusable closure: </p> <pre><code> Closure saveClosure = { domainObj -&gt; if(domainObj.save()) println "Domain Object $domainObj Saved" else { println "Errors Found During Save of $domainObj!" println domainObj.errors.allErrors.each { println it.defaultMessage } } } </code></pre></li> </ul> <p>Then you can just use it everywhere and it will take care of error reporting: </p> <pre><code> def book = new Book(authorName:"Mark Twain") saveClosure(book) </code></pre> <ul> <li><p>Additionally, I use the <a href="http://www.grails.org/Debug+Plugin" rel="noreferrer">debug plugin</a> - it allows extra logging, and I added tag to the bottom of my main - that gives me a view of all the variables in session / request. </p></li> <li><p><a href="http://www.grails.org/Runtime+Logging+Plugin" rel="noreferrer">Runtime Logging plugin</a> allows to enable logging at runtime. </p></li> <li><p>While writing this answer, <a href="http://www.grails.org/p6spy+plugin" rel="noreferrer">P6SPY plugin</a> also seems like it could be useful - it logs all statements your app makes against the database by acting as a proxy. </p></li> <li><p>Grails Console is also useful. I use it to interactively poke around and experiment with some code, which also comes in handy during debugging. </p></li> <li><p>And of course, being able to step through Debugger is sweet. I switched to IntelliJ IDEA since it has the best Grails / Groovy support.</p></li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload