<?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: Testing Hibernate mappings: Setting up test data</title>
	<atom:link href="http://www.markhneedham.com/blog/2008/10/30/testing-hibernate-mappings-setting-up-test-data/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markhneedham.com/blog/2008/10/30/testing-hibernate-mappings-setting-up-test-data/</link>
	<description>Thoughts on Software Development</description>
	<lastBuildDate>Tue, 16 Mar 2010 16:49:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Anders S</title>
		<link>http://www.markhneedham.com/blog/2008/10/30/testing-hibernate-mappings-setting-up-test-data/comment-page-1/#comment-1155</link>
		<dc:creator>Anders S</dc:creator>
		<pubDate>Thu, 06 Nov 2008 13:14:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=561#comment-1155</guid>
		<description>I agree with Kris. I would prefer doing it with Hibernate over SQL. I have experienced severe pain after refactorings on a project where too much was set up with SQL.</description>
		<content:encoded><![CDATA[<p>I agree with Kris. I would prefer doing it with Hibernate over SQL. I have experienced severe pain after refactorings on a project where too much was set up with SQL.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris Kemper</title>
		<link>http://www.markhneedham.com/blog/2008/10/30/testing-hibernate-mappings-setting-up-test-data/comment-page-1/#comment-1063</link>
		<dc:creator>Kris Kemper</dc:creator>
		<pubDate>Sat, 01 Nov 2008 22:32:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=561#comment-1063</guid>
		<description>I prefer the approach of using Hibernate to setup test data. Injecting data using sql quickly results in hard to maintain test code, and it won&#039;t tell you when you violate validation logic that happens on the domain object (if you validate before save).

Using sql to inject data is best used when you need to test some condition that you can can&#039;t get to via hibernate.

In practice, I&#039;m not too bothered by the fact that you test a save and a load, you can always write test helpers when the application save logic differs from what you want to do.

In the end, when you are using SQL to inject, you are really testing that the SQL works as well, but that check provides less value since it (probably) isn&#039;t used by the production code.</description>
		<content:encoded><![CDATA[<p>I prefer the approach of using Hibernate to setup test data. Injecting data using sql quickly results in hard to maintain test code, and it won't tell you when you violate validation logic that happens on the domain object (if you validate before save).</p>
<p>Using sql to inject data is best used when you need to test some condition that you can can't get to via hibernate.</p>
<p>In practice, I'm not too bothered by the fact that you test a save and a load, you can always write test helpers when the application save logic differs from what you want to do.</p>
<p>In the end, when you are using SQL to inject, you are really testing that the SQL works as well, but that check provides less value since it (probably) isn't used by the production code.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
