<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: GORM :: override a setter on a Grails Domain</title>
	<atom:link href="http://colinharrington.net/blog/2009/01/gorm-override-a-setter-on-a-grails-domain/feed/" rel="self" type="application/rss+xml" />
	<link>http://colinharrington.net/blog/2009/01/gorm-override-a-setter-on-a-grails-domain/</link>
	<description>Technologist, Consultant, Software Engineer, Entrepreneur and Musician</description>
	<lastBuildDate>Fri, 11 May 2012 12:50:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Sobreescrevendo Get em Grails &#171; AQIL&#8217;s Blog</title>
		<link>http://colinharrington.net/blog/2009/01/gorm-override-a-setter-on-a-grails-domain/comment-page-1/#comment-4374</link>
		<dc:creator>Sobreescrevendo Get em Grails &#171; AQIL&#8217;s Blog</dc:creator>
		<pubDate>Tue, 17 Jan 2012 04:46:57 +0000</pubDate>
		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2009/01/08/gorm-override-a-setter-on-a-grails-domain/#comment-4374</guid>
		<description>[...] o método não estava sendo invocado. Após algumas pesquisas descobri (http://colinharrington.net/blog/2009/01/gorm-override-a-setter-on-a-grails-domain/) que a assinatura do método deve ser a mesma do correspondente JavaBean, ou seja, o código [...]</description>
		<content:encoded><![CDATA[<p>[...] o método não estava sendo invocado. Após algumas pesquisas descobri (<a href="http://colinharrington.net/blog/2009/01/gorm-override-a-setter-on-a-grails-domain/" rel="nofollow">http://colinharrington.net/blog/2009/01/gorm-override-a-setter-on-a-grails-domain/</a>) que a assinatura do método deve ser a mesma do correspondente JavaBean, ou seja, o código [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: matt</title>
		<link>http://colinharrington.net/blog/2009/01/gorm-override-a-setter-on-a-grails-domain/comment-page-1/#comment-3961</link>
		<dc:creator>matt</dc:creator>
		<pubDate>Thu, 30 Sep 2010 20:37:41 +0000</pubDate>
		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2009/01/08/gorm-override-a-setter-on-a-grails-domain/#comment-3961</guid>
		<description>Ditto danny&#039;s comment. Thanks for saving me a big headache.</description>
		<content:encoded><![CDATA[<p>Ditto danny&#8217;s comment. Thanks for saving me a big headache.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: danny</title>
		<link>http://colinharrington.net/blog/2009/01/gorm-override-a-setter-on-a-grails-domain/comment-page-1/#comment-3907</link>
		<dc:creator>danny</dc:creator>
		<pubDate>Tue, 04 May 2010 08:34:59 +0000</pubDate>
		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2009/01/08/gorm-override-a-setter-on-a-grails-domain/#comment-3907</guid>
		<description>Thanks! This just saved me time.  I, like you, tried def setIsbn(i){ ... } to find nothing doing.</description>
		<content:encoded><![CDATA[<p>Thanks! This just saved me time.  I, like you, tried def setIsbn(i){ &#8230; } to find nothing doing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marc</title>
		<link>http://colinharrington.net/blog/2009/01/gorm-override-a-setter-on-a-grails-domain/comment-page-1/#comment-3838</link>
		<dc:creator>Marc</dc:creator>
		<pubDate>Fri, 29 Jan 2010 21:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2009/01/08/gorm-override-a-setter-on-a-grails-domain/#comment-3838</guid>
		<description>I&#039;m curious, does GORM use the property set when retrieving from the database?

on a credential domain class I wanting to guard against a password field being set to a non-hashed valueâ€¦ So my initial thinking was to create:

    String password
    void setPassword(String pw) {
        password = getHash(pw,salt)
    }

but if the hashed password was retrieved from the database wouldn&#039;t it end up going through another cycle of hashing?</description>
		<content:encoded><![CDATA[<p>I&#8217;m curious, does GORM use the property set when retrieving from the database?</p>
<p>on a credential domain class I wanting to guard against a password field being set to a non-hashed valueâ€¦ So my initial thinking was to create:</p>
<p>    String password<br />
    void setPassword(String pw) {<br />
        password = getHash(pw,salt)<br />
    }</p>
<p>but if the hashed password was retrieved from the database wouldn&#8217;t it end up going through another cycle of hashing?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paras Jain</title>
		<link>http://colinharrington.net/blog/2009/01/gorm-override-a-setter-on-a-grails-domain/comment-page-1/#comment-3762</link>
		<dc:creator>Paras Jain</dc:creator>
		<pubDate>Tue, 18 Aug 2009 15:24:57 +0000</pubDate>
		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2009/01/08/gorm-override-a-setter-on-a-grails-domain/#comment-3762</guid>
		<description>That certainly helps. Thanks for your suggestion. Thanks to Mike too for his insight</description>
		<content:encoded><![CDATA[<p>That certainly helps. Thanks for your suggestion. Thanks to Mike too for his insight</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adwin</title>
		<link>http://colinharrington.net/blog/2009/01/gorm-override-a-setter-on-a-grails-domain/comment-page-1/#comment-2820</link>
		<dc:creator>adwin</dc:creator>
		<pubDate>Sat, 10 Jan 2009 06:27:50 +0000</pubDate>
		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2009/01/08/gorm-override-a-setter-on-a-grails-domain/#comment-2820</guid>
		<description>oh great. i just know that we can override the setter in GORM. THAT&#039;s really usefull since I need to format the date from String to java.util.date (i am not using g:datepicker, but using my own javascript date picker).

thank you for sharing your knowledge...</description>
		<content:encoded><![CDATA[<p>oh great. i just know that we can override the setter in GORM. THAT&#8217;s really usefull since I need to format the date from String to java.util.date (i am not using g:datepicker, but using my own javascript date picker).</p>
<p>thank you for sharing your knowledge&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://colinharrington.net/blog/2009/01/gorm-override-a-setter-on-a-grails-domain/comment-page-1/#comment-2819</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Fri, 09 Jan 2009 13:46:01 +0000</pubDate>
		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2009/01/08/gorm-override-a-setter-on-a-grails-domain/#comment-2819</guid>
		<description>Colin,
Great post - I&#039;ve struggled with the same thing in the past.  One way you can make sure you get the correct method signature is to run javap on a compiled groovy class (before you override the method, of course):

groovyc Book.groovy
javap Book
Compiled from &quot;Book.groovy&quot;
public class Book extends java.lang.Object implements groovy.lang.GroovyObject{
    ...
    public void setIsbn(java.lang.String);
    ....
}

You can then copy that method signature directly into your code to and override it to your hearts content.

(hat tip to http://naleid.com/blog/2008/12/24/groovy-spread-operator-optional-for-properties-plus-a-peek-into-the-sausage-factory/ for getting me interested in javap)</description>
		<content:encoded><![CDATA[<p>Colin,<br />
Great post &#8211; I&#8217;ve struggled with the same thing in the past.  One way you can make sure you get the correct method signature is to run javap on a compiled groovy class (before you override the method, of course):</p>
<p>groovyc Book.groovy<br />
javap Book<br />
Compiled from &#8220;Book.groovy&#8221;<br />
public class Book extends java.lang.Object implements groovy.lang.GroovyObject{<br />
    &#8230;<br />
    public void setIsbn(java.lang.String);<br />
    &#8230;.<br />
}</p>
<p>You can then copy that method signature directly into your code to and override it to your hearts content.</p>
<p>(hat tip to <a href="http://naleid.com/blog/2008/12/24/groovy-spread-operator-optional-for-properties-plus-a-peek-into-the-sausage-factory/" rel="nofollow">http://naleid.com/blog/2008/12/24/groovy-spread-operator-optional-for-properties-plus-a-peek-into-the-sausage-factory/</a> for getting me interested in javap)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

