<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Strictly Programming</title>
	<atom:link href="http://sqllyw.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sqllyw.wordpress.com</link>
	<description>A programmer parks his thoughts...</description>
	<lastBuildDate>Sun, 22 Nov 2009 12:10:44 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='sqllyw.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/98d8c94549f8b5cb51e8a07968493561?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Strictly Programming</title>
		<link>http://sqllyw.wordpress.com</link>
	</image>
			<item>
		<title>Adding Unit Test to Objective C application in XCode 3.2</title>
		<link>http://sqllyw.wordpress.com/2009/11/22/adding-unit-test-to-objective-c-application-in-xcode-3-2/</link>
		<comments>http://sqllyw.wordpress.com/2009/11/22/adding-unit-test-to-objective-c-application-in-xcode-3-2/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 10:53:01 +0000</pubDate>
		<dc:creator>sqllyw</dc:creator>
				<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Unit Tests]]></category>
		<category><![CDATA[XCode 3.2]]></category>

		<guid isPermaLink="false">http://sqllyw.wordpress.com/?p=308</guid>
		<description><![CDATA[Adding Unit Test to Objective C application.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=308&subd=sqllyw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Adding Unit Test in XCode 3.2.<br />
<span id="more-308"></span><br />
Some Objective C links:</p>
<p><a href="http://cocoadevcentral.com/d/learn_objectivec/">Learning Objective C</a><br />
<a href="http://chanson.livejournal.com/tag/unit+testing">About Unit Tests</a></p>
<p>Adding Unit Test in XCode 3.2 is very easy,  here is a simple note on this:</p>
<ol>
<li>Create an objective C application, name it &#8216;MyApp&#8217;,  build and run, you see an empty window pops up.</li>
<li> Right click &#8216;Targets&#8217;,  Add/New Target, choose &#8216;Unit Test Bundle&#8217;, set Target name to &#8216;Unit Tests&#8217;</li>
<li> When Target &#8220;unit Tests&#8221; info pops up, under &#8216;General&#8217;, &#8216;Direct Dependencies&#8217;, add &#8216;MyApp&#8217;.</li>
<li> Right click &#8216;Unit Tests&#8217; under &#8216;Targets&#8217;,  build &#8216;Unit Tests&#8217;.</li>
<li> You see following error, because there is no test yet.</li>
<pre class="brush: cpp;">
&quot;Command /bin/sh failed with exit code 1&quot;
</pre>
<li> Add a new group, name it &#8216;Tests&#8217;.</li>
<li> Right click, add file, choose &#8216;Objective C test case class&#8217;, name it &#8216;MyTest&#8217;, be sure target is: &#8216;Unit Tests&#8217;, uncheck &#8216;MyApp&#8217; if it is checked. do the step 4 again, passed? if yes, proceed to next step.</li>
<li> Add a test to MyTest.m</li>
<pre class="brush: cpp;">
-(void)testCase1;
{
	STAssertEquals(10, 20, @&quot;equal?&quot;);
}
</pre>
<p>build &#8216;Unit Tests&#8217; again, you will see an error reported:</p>
<pre class="brush: cpp;">
testCase1] : '10' should be equal to '20': equal?
</pre>
<p>that means our test is working, set the statement above to:</p>
<pre class="brush: cpp;">
STAssertEquals(10, 10, @&quot;equal?&quot;);
</pre>
<p><b>build &#8216;Unit Tests&#8217; again, passed!</b>
</ol>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqllyw.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqllyw.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqllyw.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqllyw.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqllyw.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqllyw.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqllyw.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqllyw.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqllyw.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqllyw.wordpress.com/308/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=308&subd=sqllyw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sqllyw.wordpress.com/2009/11/22/adding-unit-test-to-objective-c-application-in-xcode-3-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/305ee45039a07276a58fc65add8ccba7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sqllyw</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing manually saa7134 in Ubuntu 9.04 kernel 9.26.31rc6</title>
		<link>http://sqllyw.wordpress.com/2009/08/15/installing-manually-saa7134-in-ubuntu-9-04-kernel-9-26-31rc6/</link>
		<comments>http://sqllyw.wordpress.com/2009/08/15/installing-manually-saa7134-in-ubuntu-9-04-kernel-9-26-31rc6/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 08:31:53 +0000</pubDate>
		<dc:creator>sqllyw</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sqllyw.wordpress.com/2009/08/15/installing-manually-saa7134-in-ubuntu-9-04-kernel-9-26-31rc6/</guid>
		<description><![CDATA[As subject says:)

To fix slow connection problem with my realtek usb wireless card, I upgraded to 9.26.31rc6, the connection is perfect, but saa7134 module is not loaded by default any more, for that I have to manually compile and install it, since this is my first time installing a module, it&#8217;s quite basic, here are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=305&subd=sqllyw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>As subject says:)</p>
<p><span id="more-305"></span><br />
To fix slow connection problem with my realtek usb wireless card, I upgraded to 9.26.31rc6, the connection is perfect, but saa7134 module is not loaded by default any more, for that I have to manually compile and install it, since this is my first time installing a module, it&#8217;s quite basic, here are steps:</p>
<p>1)sudo apt-get install mercurial<br />
hg clone http://linuxtv.org/hg/v4l-dvb</p>
<p>2) make -C /home/sqllyw/v4l-dvb/v4l<br />
3) cd /home/sqllyw/v4l-dvb/v4l<br />
sudo make install<br />
sudo reboot</p>
<p>saa7134 is back.</p>
<p>Updated on Aug 31, 2009: upgraded to Kernel 2.6.31 rc7, saa7134 is part of that.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqllyw.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqllyw.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqllyw.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqllyw.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqllyw.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqllyw.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqllyw.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqllyw.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqllyw.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqllyw.wordpress.com/305/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=305&subd=sqllyw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sqllyw.wordpress.com/2009/08/15/installing-manually-saa7134-in-ubuntu-9-04-kernel-9-26-31rc6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/305ee45039a07276a58fc65add8ccba7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sqllyw</media:title>
		</media:content>
	</item>
		<item>
		<title>Upgrading kernel in ubuntu 9.04</title>
		<link>http://sqllyw.wordpress.com/2009/08/14/upgrading-kernel-in-ubuntu-9-04/</link>
		<comments>http://sqllyw.wordpress.com/2009/08/14/upgrading-kernel-in-ubuntu-9-04/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 01:18:56 +0000</pubDate>
		<dc:creator>sqllyw</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sqllyw.wordpress.com/2009/08/14/upgrading-kernel-in-ubuntu-9-04/</guid>
		<description><![CDATA[This is about 9.04 but should be applicable to other versions as well.

1) get your kernel version from http://kernel.ubuntu.com/~kernel-ppa/mainline/
   I downloaded following filels:
	linux-headers-2.6.30-020630_2.6.30-020630_all.deb
	linux-headers-2.6.30-020630-generic_2.6.30-020630_i386.deb
	linux-image-2.6.30-020630-generic_2.6.30-020630_i386.deb
2) put the files under one directory, cd to that directory
3) sudo dpkg -i *.deb
4) sudo reboot, choose the kernel version from boot menu, that&#8217;s it.
      [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=303&subd=sqllyw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This is about 9.04 but should be applicable to other versions as well.</p>
<p><span id="more-303"></span><br />
1) get your kernel version from http://kernel.ubuntu.com/~kernel-ppa/mainline/<br />
   I downloaded following filels:<br />
	linux-headers-2.6.30-020630_2.6.30-020630_all.deb<br />
	linux-headers-2.6.30-020630-generic_2.6.30-020630_i386.deb<br />
	linux-image-2.6.30-020630-generic_2.6.30-020630_i386.deb</p>
<p>2) put the files under one directory, cd to that directory<br />
3) sudo dpkg -i *.deb<br />
4) sudo reboot, choose the kernel version from boot menu, that&#8217;s it.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqllyw.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqllyw.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqllyw.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqllyw.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqllyw.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqllyw.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqllyw.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqllyw.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqllyw.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqllyw.wordpress.com/303/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=303&subd=sqllyw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sqllyw.wordpress.com/2009/08/14/upgrading-kernel-in-ubuntu-9-04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/305ee45039a07276a58fc65add8ccba7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sqllyw</media:title>
		</media:content>
	</item>
		<item>
		<title>Setting up MythTV with Kworld&#8217;s PVR-TV 7134SE</title>
		<link>http://sqllyw.wordpress.com/2009/08/09/setting-up-mythtv-with-kworlds-pvr-tv-7134se/</link>
		<comments>http://sqllyw.wordpress.com/2009/08/09/setting-up-mythtv-with-kworlds-pvr-tv-7134se/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 01:53:55 +0000</pubDate>
		<dc:creator>sqllyw</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sqllyw.wordpress.com/2009/08/09/setting-up-mythtv-with-kworlds-pvr-tv-7134se/</guid>
		<description><![CDATA[My personal experience in the setting up of mythtv, tested PCI Card
KWorld  Plus TV Analog Lite PCI(PVR 7134E) and ITO23 REV:4E(a 7135 based card)

Got a need lately to view TV from a laptop computer and decided to set up Mythtv for that, it took a while to be able to do this, the main [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=299&subd=sqllyw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>My personal experience in the setting up of mythtv, tested PCI Card<br />
KWorld  Plus TV Analog Lite PCI(PVR 7134E) and ITO23 REV:4E(a 7135 based card)</p>
<p><span id="more-299"></span><br />
Got a need lately to view TV from a laptop computer and decided to set up Mythtv for that, it took a while to be able to do this, the main problem is the TV tuner card, the tip I can give is, find a card fully supported by Mythtv before starting, this will save a lot of time. anyway, I finally got my box up and running almost 99%, still have 1% that I&#8217;ll figure out later, steps to setup:</p>
<p>0) hardware part, I use a simple approach, connect the video out and audio out of my set top box to the video in and audio in of the tuner card, this make it the composite input(the card has RF and S-Video inputs, but I&#8217;m not using it), for the audio, since my set top box uses RCA, so I have to use a RCA to mini 3.5 jack adaptor. optionally you can connect from the audio out of tv tuner to the line in port of your pc&#8217;s sound card, this is not really necessary if you want to use only mythtv for TV viewing.</p>
<p>1) install first Ubuntu 9.04 desktop</p>
<p>2) sudo apt-get update</p>
<p>3) dmesg | grep saa<br />
   you should see your card there, but type of card is set to UNKNOWN or GENERIC(can&#8217;t remember exactly), if you find the card there, proceed to #4 otherwise Google:)</p>
<p>4) sudo pico /etc/modprobe.d/alsa-base.conf<br />
   look for the line: install saa7134 /sbin/modprobe &#8211;ignore -install saa7134 $CMDLINE_OPTS{&#8230;.}<br />
   change the $CMDLINE_OPTS to card=59 tuner=56, save and reboot</p>
<p>5) dmesg |grep Kworld</p>
<p>[   12.104209] saa7134[0]: subsystem: 17de:7128, board: Kworld/Tevion V-Stream Xpert TV PVR7134 [card=59,insmod option]<br />
[   12.108898] input: saa7134 IR (Kworld/Tevion V-Str as /devices/pci0000:00/0000:00:1e.0/0000:02:04.0/input/input5<br />
[   13.104060] saa7134 IR (Kworld/Tevion V-Str: unknown key: key=0&#215;03 raw=0&#215;03 down=1</p>
<p>ok, you card is found and identified, let&#8217;s do some testing without mythtv for the meantime</p>
<p>6) sudo apt-get install xawtv<br />
   this installs the tv program, click /Applications/Sound &amp; Video/XawTV, you see the xawtv screen, right click and set video source to &#8216;composite1&#8242;, you should see the TV live, if you connect an audio cable from the card&#8217;s audio out port to your pc&#8217;s audio in, you should hear the sound, if no sound, play with the volume control, look for PCM/line in, do some tinkering there until you heard the sound, however we are not going to use this sound from line in port of pc for mythtv.</p>
<p>up to this point, our hardware/software for the TV is up, let&#8217;s install mythtv:</p>
<p>7) sudo apt-get install mythtv<br />
 <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> click System/Adminstration/MythTV Backend Setup<br />
   basically the audio has to be set to dsp1<br />
9) click Applications/Sound &amp; Video/MythTV FrontEnd<br />
   audio has to be set to dsp<br />
10) let&#8217;s try a remote FrontEnd<br />
    as long as the password for the mythtv is correct, this does not require too much setup, audio is different from #9</p>
<p>more on 8 to 10 when I&#8217;m free.</p>
<p>Note: just tried a new PCI TV board, it is very similar to this one:</p>
<p>http://www.pacificgeek.com/product.asp?id=49178</p>
<p>At back of the card, it says ITO23 REV:4E<br />
took a while to figure out: card=79 tuner=43</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqllyw.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqllyw.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqllyw.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqllyw.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqllyw.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqllyw.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqllyw.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqllyw.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqllyw.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqllyw.wordpress.com/299/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=299&subd=sqllyw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sqllyw.wordpress.com/2009/08/09/setting-up-mythtv-with-kworlds-pvr-tv-7134se/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/305ee45039a07276a58fc65add8ccba7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sqllyw</media:title>
		</media:content>
	</item>
		<item>
		<title>Hibernate Annotations and Entity relations</title>
		<link>http://sqllyw.wordpress.com/2009/05/27/hibernate-annotations-and-entity-relations/</link>
		<comments>http://sqllyw.wordpress.com/2009/05/27/hibernate-annotations-and-entity-relations/#comments</comments>
		<pubDate>Wed, 27 May 2009 06:52:55 +0000</pubDate>
		<dc:creator>sqllyw</dc:creator>
				<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://sqllyw.wordpress.com/?p=291</guid>
		<description><![CDATA[Entity relations

@SecondaryTables
One to Many relationship

@Entity
public class Publisher {

 	private Long id;

	@Id @GeneratedValue
    public Long getId() { return id; }
}

@Entity
public class Book {
	private Long id;
	private Publisher publisher;

	@Id @GeneratedValue
	public Long getId() {return id;}

	public Publisher getPublisher();
}

Publisher has many books, so publisher is in the ONE side while book in the MANY SIDE.
To have a unidirectional [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=291&subd=sqllyw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Entity relations<br />
<span id="more-291"></span><br />
@SecondaryTables</p>
<p><b>One to Many relationship</b></p>
<pre class="brush: java;">
@Entity
public class Publisher {

 	private Long id;

	@Id @GeneratedValue
    public Long getId() { return id; }
}

@Entity
public class Book {
	private Long id;
	private Publisher publisher;

	@Id @GeneratedValue
	public Long getId() {return id;}

	public Publisher getPublisher();
}
</pre>
<p>Publisher has many books, so publisher is in the ONE side while book in the MANY SIDE.<br />
To have a unidirectional relation we can annotate the Book class as:</p>
<pre class="brush: java;">
	@ManyToOne
	public Publisher getPublisher();
</pre>
<p>	or</p>
<pre class="brush: java;">
	@ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name=&quot;publisher_id&quot;)		// this will use publisher_id as attribute in the table, otherwise it will be publisher
	public Publisher getPublisher();
</pre>
<p>Notice there is no need to have MappedBy as it is optional in the unidirectional ManyToOne relation.</p>
<p>with this approach, we can find the publisher from the Book, but finding books from an instance of Publisher object is not possible unless you use some queries. to be able to do that, we need to make the relationship bidirectional, just add this annotation in the Publisher side(ONE side):</p>
<pre class="brush: java;">
@Entity
public class Publisher {

 	private Long id;
 	private List&lt;Book&gt; books;

	@Id @GeneratedValue
    public Long getId() { return id; }

	@OneToMany
	@OneToMany(mappedBy=&quot;publiser&quot;)
	public List&lt;Book&gt; getBooks() { return books;}
}
</pre>
<p>It is mandatory to have mappedBy annotation in a bidirectional relationship and it has to be in the ONE side(maybe I&#8217;m wrong?), the &#8216;publisher&#8217; here refer to the &#8216;publisher&#8217; property in the MANY side. you can specify other attributes in the OneToMany annotation:</p>
<pre class="brush: java;">
	@OneToMany(cascade= CascadeType.ALL, mappedBy=&quot;publisher&quot;)
    @OrderBy(&quot;Area desc&quot;)
</pre>
<p>Note: delete orphan to be added.</p>
<p><b>One to One relationship</b></p>
<pre class="brush: java;">
@Entity
public class Door {
    private Long id;
    @Id
    public Long getId() {return id;}
    public void setId(Long id) { this.id = id;}
}

@Entity
public class Key {
    private Long id;
    @Id
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id;}
}
</pre>
<p>their generated sql:</p>
<pre class="brush: sql;">
create table Door (
      id bigint not null,
      primary key (id)
  );

create table Key (
      id bigint not null,
      primary key (id)
);
</pre>
<p>The only thing required to setup a one to one relationship is: to annotate in the one side of the relationship, let&#8217;s do it in the Door:</p>
<pre class="brush: java;">
@Entity
public class Door {

    private Long id;
    private Key key;
    @Id

    public Long getId() { return id; }
    public void setId(Long id) { this.id = id;}

    @OneToOne
    public Key getKey() { return key; }
    public void setKey(Key key) { this.key = key;}
}
</pre>
<p>This change will trigger a change in the SQL as well:</p>
<pre class="brush: sql;">
create table Door (
      id bigint not null,
      key_id bigint,
      primary key (id)
  );

alter table Door
      add index FK2097CE549DF154 (key_id),
      add constraint FK2097CE549DF154
      foreign key (key_id)
      references Key (id);
</pre>
<p>Door owns the relationship in this case, and it is unidirectional, you can access Key from the Door, but not vice versa. to make it bi-directional you can annotate the other end:</p>
<pre class="brush: java;">
@Entity
public class Key {
    private Long id;
    private Door door;

    @Id
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @OneToOne
    public Door getDoor() {
        return door;
    }

    public void setDoor(Door door) {
        this.door = door;
    }
}
</pre>
<p>and you got the new sql:</p>
<pre class="brush: sql;">
create table Key (
      id bigint not null,
      door_id bigint,
      primary key (id)
  );
</pre>
<p>You will notice Key now has door_id as a foreign key, both end owns the relation, this isn&#8217;t too good. A preferable way is, one end is the owning entity while the other end is a owned entity, in example above we can make the Key a owned entity while Door is a owning entity, to make this happen, add a mappedBy in the Key class:</p>
<pre class="brush: java;">
@OneToOne(mappedBy = &quot;key&quot;)
</pre>
<p>the &#8220;key&#8221; field is referring to the key field in the Door class, this will generate a new SQL:</p>
<pre class="brush: sql;">
create table Key (
 	id bigint not null,
    primary key (id)
);
</pre>
<p>We don&#8217;t have the door_id in this case as Key is only owned by Door, the relationship is maintained by Door with key_id as foreign key stored in the Door class. this allows us to travel from Key to Class as well.</p>
<p>If we want some operations cascaded from the owning class to the owned class, we can do:</p>
<pre class="brush: java;">
  @OneToOne(cascade = CascadeType.REMOVE, fetch = FetchType.LAZY)
  public Key getKey() {
      return key;
  }
</pre>
<p>If you delete the Door, then the related Key object will be deleted as well. however this cascade operation does not happen when you do a batch delete on Door. If I understand correctly, the cascade and fetch type should always be specified in the owning entity side, thus it should be in the class that does not have a &#8216;mappedBy=&#8217; clause, might not be correct. class with &#8216;mappedBy=&#8217; annotation does not maintain the foreign key, it is in the other class.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqllyw.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqllyw.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqllyw.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqllyw.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqllyw.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqllyw.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqllyw.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqllyw.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqllyw.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqllyw.wordpress.com/291/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=291&subd=sqllyw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sqllyw.wordpress.com/2009/05/27/hibernate-annotations-and-entity-relations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/305ee45039a07276a58fc65add8ccba7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sqllyw</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing jai into local Maven repository</title>
		<link>http://sqllyw.wordpress.com/2009/03/27/installing-jai-into-local-maven-repository/</link>
		<comments>http://sqllyw.wordpress.com/2009/03/27/installing-jai-into-local-maven-repository/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 04:08:00 +0000</pubDate>
		<dc:creator>sqllyw</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sqllyw.wordpress.com/2009/03/27/installing-jai-into-local-maven-repository/</guid>
		<description><![CDATA[Main entry text

mvn install:install-file -Dfile=jai_core.jar  -DgroupId=javax.media  -DartifactId=jai-core  -Dversion=1.3.3 -Dpackaging=jar -DgeneratePom=true
mvn install:install-file -Dfile=jai_codec.jar  -DgroupId=javax.media  -DartifactId=jai-codec  -Dversion=1.3.3 -Dpackaging=jar -DgeneratePom=true
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=289&subd=sqllyw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Main entry text</p>
<p><span id="more-289"></span><br />
mvn install:install-file -Dfile=jai_core.jar  -DgroupId=javax.media  -DartifactId=jai-core  -Dversion=1.3.3 -Dpackaging=jar -DgeneratePom=true<br />
mvn install:install-file -Dfile=jai_codec.jar  -DgroupId=javax.media  -DartifactId=jai-codec  -Dversion=1.3.3 -Dpackaging=jar -DgeneratePom=true</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqllyw.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqllyw.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqllyw.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqllyw.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqllyw.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqllyw.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqllyw.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqllyw.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqllyw.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqllyw.wordpress.com/289/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=289&subd=sqllyw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sqllyw.wordpress.com/2009/03/27/installing-jai-into-local-maven-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/305ee45039a07276a58fc65add8ccba7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sqllyw</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting Started with Maven Tomcat Plug in</title>
		<link>http://sqllyw.wordpress.com/2009/02/10/getting-started-with-maven-tomcat-plug-in/</link>
		<comments>http://sqllyw.wordpress.com/2009/02/10/getting-started-with-maven-tomcat-plug-in/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 01:23:00 +0000</pubDate>
		<dc:creator>sqllyw</dc:creator>
				<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://sqllyw.wordpress.com/?p=261</guid>
		<description><![CDATA[
to check if tomcat is running:
ps -ef &#124; grep java
getting mysql schema:
mysqldump &#8211;no-data  -u user -ppassword dbname &#62;schema.sql
Tomcat Plugin Home Page
Tomcat plugin is good for the deployment of servlet applications into a Tomcat server, it has three major functions:

Deployment
		This is the functions I used often, I&#8217;d consider this as the most important functions of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=261&subd=sqllyw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span id="more-261"></span><br />
to check if tomcat is running:</p>
<p>ps -ef | grep java</p>
<p>getting mysql schema:</p>
<p>mysqldump &#8211;no-data  -u user -ppassword dbname &gt;schema.sql</p>
<p><a href='http://mojo.codehaus.org/tomcat-maven-plugin/introduction.html'>Tomcat Plugin Home Page</a></p>
<p>Tomcat plugin is good for the deployment of servlet applications into a Tomcat server, it has three major functions:</p>
<ol>
<li><b>Deployment</b></li>
<p>		This is the functions I used often, I&#8217;d consider this as the most important functions of this plug in</p>
<li><b>Container related goals</b></li>
<p>		Using this group of goals you can query the status of a running Tomcat server.</p>
<li><b>Running an app in an embedded Tomcat Server</b></li>
<p>	This is very handy in development, you can run your app even you do not have a tomcat server installed, the embedded server is version 5.5.25 at the time of this writing
</ol>
<p>To get started you should have a servelet application based on Maven 2 running first, go to the directory of the application where pom.xml is located then try:</p>
<p><b>maven tomcat:run</b></p>
<p>pointing your browser at http://localhost:8080/myproject</p>
<p>You should see the program running. that&#8217;s the #3 feature listed above.</p>
<p>The easiest way to get started with Plugin is, have a tomcat running at port 8080, add a user &#8216;admin&#8217; without password to $CATALINA_HOME/conf/tomcat_users.xml：</p>
<pre class="brush: xml;">
  &lt;user username=&quot;admin&quot; password=&quot;&quot; roles=&quot;standard,manager&quot;/&gt;
</pre>
<p>try following container related goals:</p>
<p><b>mvn tomcat:info</b></p>
<p><b>mvn tomcat:list</b></p>
<p>To deploy your app:</p>
<p><b>mvn tomcat:deploy</b></p>
<p><b>mvn tomcat:redeploy</b></p>
<p><b>mvn tomcat:undeploy</b></p>
<p>Now the plug in is running, let&#8217;s do something more, I&#8217;d prefer to have a installed Tomcat Server running at port 80 and the embedded server at its default port 8080, with that, I can test my app first in the embedded server at port 8080 and deploy it later into the installed Tomcat server and test it in the port 80, of course you can choose whatever port number you like as long as the installed Tomcat server&#8217;s port is different from the embedded Tomcat&#8217;s port.</p>
<ol>
<li>update ./m2/settings.xml</li>
<pre class="brush: xml;">
&lt;servers&gt;
    &lt;server&gt;
      &lt;id&gt;local_tomcat&lt;/id&gt;
      &lt;username&gt;admin&lt;/username&gt;
      &lt;password&gt;&lt;/password&gt;
    &lt;/server&gt;
&lt;/servers&gt;
</pre>
<li>Add this blog to pom.xml</li>
<pre class="brush: xml;">
		&lt;plugin&gt;
		        &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
		        &lt;artifactId&gt;tomcat-maven-plugin&lt;/artifactId&gt;
		        &lt;version&gt;1.0-beta-1&lt;/version&gt;
		        &lt;configuration&gt;
		          &lt;server&gt;local_tomcat&lt;/server&gt;
		          &lt;url&gt;http://localhost:80/manager&lt;/url&gt;
		        &lt;/configuration&gt;
		 	&lt;/plugin&gt;
</pre>
<p>the entry in the settings.xml is actually to specify the user name and password while the port number is specified in the pom.xml&#8217;s url part.
</ol>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqllyw.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqllyw.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqllyw.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqllyw.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqllyw.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqllyw.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqllyw.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqllyw.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqllyw.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqllyw.wordpress.com/261/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=261&subd=sqllyw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sqllyw.wordpress.com/2009/02/10/getting-started-with-maven-tomcat-plug-in/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/305ee45039a07276a58fc65add8ccba7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sqllyw</media:title>
		</media:content>
	</item>
		<item>
		<title>Mini FAQ for OS X</title>
		<link>http://sqllyw.wordpress.com/2009/02/09/mini-faq-for-os-x/</link>
		<comments>http://sqllyw.wordpress.com/2009/02/09/mini-faq-for-os-x/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 02:41:15 +0000</pubDate>
		<dc:creator>sqllyw</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sqllyw.wordpress.com/2009/02/09/mini-faq-for-os-x/</guid>
		<description><![CDATA[

To set global environment variables
		One way is, update /etc/bashrc
		for local user, you can ~/.MacOSX/environment.plist
To install tomcat 6

       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=259&subd=sqllyw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span id="more-259"></span></p>
<ul>
<li>To set global environment variables</li>
<p>		One way is, update /etc/bashrc<br />
		for local user, you can ~/.MacOSX/environment.plist</p>
<li>To install tomcat 6</li>
</ul>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqllyw.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqllyw.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqllyw.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqllyw.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqllyw.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqllyw.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqllyw.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqllyw.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqllyw.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqllyw.wordpress.com/259/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=259&subd=sqllyw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sqllyw.wordpress.com/2009/02/09/mini-faq-for-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/305ee45039a07276a58fc65add8ccba7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sqllyw</media:title>
		</media:content>
	</item>
		<item>
		<title>Setting Up Exim4 in Ubuntu 8.10.x</title>
		<link>http://sqllyw.wordpress.com/2009/02/08/setting-up-exim4-in-ubuntu-810x/</link>
		<comments>http://sqllyw.wordpress.com/2009/02/08/setting-up-exim4-in-ubuntu-810x/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 02:41:13 +0000</pubDate>
		<dc:creator>sqllyw</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sqllyw.wordpress.com/?p=251</guid>
		<description><![CDATA[Some simple steps in setting up Exim4 in Ubuntu 8.10.x, might be applicable to other distributions too.

Some related Links:
Setting up Exim SMTP Auth
SMTP Relaying Via a Smarthost
Gmail POP3 with Fetchmail

apt-get install mailx
apt-get install exim4

Note: this will remove the postfix if it is installed
To configure:
dpkg-reconfigure exim4-config
restart exim4:
invoke-rc.d exim4 restart
To relay with a smarthost, you need to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=251&subd=sqllyw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Some simple steps in setting up Exim4 in Ubuntu 8.10.x, might be applicable to other distributions too.</p>
<p><span id="more-251"></span><br />
Some related Links:</p>
<p><a href="http://www.wlug.org.nz/EximSmtpAuth">Setting up Exim SMTP Auth</a><br />
<a href="http://www.lexspoon.org/linux/smtp-relay.html">SMTP Relaying Via a Smarthost</a><br />
<a href="http://www.axllent.org/docs/networking/gmail_pop3_with_fetchmail">Gmail POP3 with Fetchmail</a></p>
<p><b><br />
apt-get install mailx<br />
apt-get install exim4<br />
</b></p>
<p>Note: this will remove the postfix if it is installed</p>
<p>To configure:</p>
<p><b>dpkg-reconfigure exim4-config</b></p>
<p>restart exim4:</p>
<p><b>invoke-rc.d exim4 restart</b></p>
<p>To relay with a smarthost, you need to update:<br />
/etc/exim4/passwd.client, put something like this in the file:<br />
example.com:abc@example.com:mypassword</p>
<p>restart the exim4 and do a test sending:</p>
<p><b>echo &#8220;my test&#8221; |mail -s &#8220;testing exim4&#8243; abc@abc.com</b></p>
<p>check /var/log/exim4/mainlog and you should see some messages in the log about this test mail.</p>
<p>So far the exim was setup without smtp authorization, you need to enable SMTP Auth if you want to use RoundCube web mail in the same server.</p>
<p><a href="http://www.debian-administration.org/articles/280">Here</a> is a guide about setting up the SMTP Auth. </p>
<p>Create a password for smtp and save it in /etc/exim4/passwd(create if not exists)</p>
<p><b>htpasswd -nd usernameforsmtp</b></p>
<p>copy and paste it to /etc/exim4/passwd (this has to be done when a new user is added, you do not have to restart exim4)</p>
<p>Update /etc/exim4/exim4.conf.template:</p>
<p><b>AUTH_SERVER_ALLOW_NOTLS_PASSWORDS=1</b><br />
uncomment <b>plain_server</b><br />
<b>sudo update-exim4.conf</b></p>
<p>restart exim4, this time the basic auth is on at least in the server side.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqllyw.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqllyw.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqllyw.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqllyw.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqllyw.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqllyw.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqllyw.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqllyw.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqllyw.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqllyw.wordpress.com/251/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=251&subd=sqllyw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sqllyw.wordpress.com/2009/02/08/setting-up-exim4-in-ubuntu-810x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/305ee45039a07276a58fc65add8ccba7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sqllyw</media:title>
		</media:content>
	</item>
		<item>
		<title>Really Setting up Apache Continuum in 10 min</title>
		<link>http://sqllyw.wordpress.com/2009/02/06/really-setting-up-apache-continuum-in-10-min/</link>
		<comments>http://sqllyw.wordpress.com/2009/02/06/really-setting-up-apache-continuum-in-10-min/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 06:41:31 +0000</pubDate>
		<dc:creator>sqllyw</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Apache Continuum]]></category>

		<guid isPermaLink="false">http://sqllyw.wordpress.com/2009/02/06/really-setting-up-apache-continuum-in-10-min/</guid>
		<description><![CDATA[The title is not misleading, everybody said it will take a few min to setup Apache Continuum, but I spent more than two days to have it up and running, looking back, I&#8217;d like to document steps of how to really set it up in 10 minutes.

First, take a look at the Apache Continuum&#8217;s home [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=242&subd=sqllyw&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The title is not misleading, everybody said it will take a few min to setup Apache Continuum, but I spent more than two days to have it up and running, looking back, I&#8217;d like to document steps of how to really set it up in 10 minutes.</p>
<p><span id="more-242"></span><br />
First, take a look at the <a href="http://continuum.apache.org/">Apache Continuum&#8217;s home page</a>, then forget about it, follow the steps below, if you get it up and running, then you go back to the link above:</p>
<p><b>Download Apache Continuun</b> </p>
<p>make sure it is 1.3.1, unzip it to a directory.</p>
<p><b>Configure and run Continuum:</b></p>
<p>you need to update two files only:</p>
<p>update the application.xml(/path_to_continuum/apps/continuum/WEB-INF/classes/META-INF/plexus/)</p>
<p>uncomment this line:</p>
<pre class="brush: xml;">
&lt;allowedScheme&gt;file&lt;/allowedScheme&gt;
</pre>
<p>update this two lines:</p>
<pre class="brush: xml;">
&lt;from-mailbox&gt;developer@gmail.com&lt;/from-mailbox&gt;
&lt;from-name&gt;Developer&lt;/from-name&gt;
</pre>
<p>update jetty.xml(/path_to_continuum/apps/continuum/conf):</p>
<pre class="brush: xml;">
 &lt;New class=&quot;org.mortbay.naming.factories.MailSessionReference&quot;&gt;
    &lt;Set name=&quot;user&quot;&gt;sample@sample.com&lt;/Set&gt;
    &lt;Set name=&quot;password&quot;&gt;password&lt;/Set&gt;
    &lt;Set name=&quot;properties&quot;&gt;
      &lt;New class=&quot;java.util.Properties&quot;&gt;
        &lt;Put name=&quot;mail.smtp.host&quot;&gt;smtp.sample.com&lt;/Put&gt;
      &lt;/New&gt;
    &lt;/Set&gt;
  &lt;/New&gt;
</pre>
<p>start Continuum, ./continuum start</p>
<p>point browser at http://localhost:8080/continuum, if everything ok, you should see the Continuum&#8217;s page.</p>
<p><b>Add a Maven 2 project:</b><br />
the POM url is kind of confusing, newbie will think this is actually the pom.xml in the svn repository and end up using this:</p>
<p>svn+ssh://myname@myserverserver/var/svn/repos/project1/pom.xml</p>
<p>this is wrong, the POM url here refers to an actual pom.xml file and the svn path should be specified in the pom.xml. to add a Maven 2 project, you need to have a project imported already into svn, you can check out the pom.xml, and make sure you have following entry:</p>
<pre class="brush: xml;">
&lt;scm&gt;
 	&lt;connection&gt;
   	scm:svn:file:///Users/guest/svn_dir/repos/project1
   &lt;/connection&gt;
 &lt;/scm&gt;
</pre>
<p>if you do not have this entry, add it, and make sure you commit the change back before proceeding.</p>
<p>the path to svn repoistory here is only a sample, you have to use whatever applicable to you. now put this file in a place that you can access, it can be in a web site or can be in the hard disk, if it is in the hard disk, then you specify POM url as follow when adding a Maven 2 project:</p>
<p>file:/Users/guest/test789/pom.xml</p>
<p>then click add, if you do not see any error, it&#8217;s already up and running, hope it is within 10 minutes.</p>
<p>You can find the Continuum forum <a href="http://www.nabble.com/Continuum---Users-f32241.html">here</a></p>
<p><b>Additioal Tips:</b></p>
<p>To change port number used by Continuum for its web interface, update jetty.xml, look for:</p>
<pre class="brush: xml;">
&lt;Set name=&quot;port&quot;&gt;&lt;SystemProperty name=&quot;jetty.port&quot; default=&quot;8000&quot;/&gt;&lt;/Set&gt;
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqllyw.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqllyw.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqllyw.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqllyw.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqllyw.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqllyw.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqllyw.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqllyw.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqllyw.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqllyw.wordpress.com/242/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sqllyw.wordpress.com&blog=3165981&post=242&subd=sqllyw&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sqllyw.wordpress.com/2009/02/06/really-setting-up-apache-continuum-in-10-min/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/305ee45039a07276a58fc65add8ccba7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sqllyw</media:title>
		</media:content>
	</item>
	</channel>
</rss>