<?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/"
	>

<channel>
	<title>devblog @ x-sphere.com &#187; code</title>
	<atom:link href="http://devblog.x-sphere.com/index.php/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://devblog.x-sphere.com</link>
	<description>random babblings of a product manager and coder</description>
	<lastBuildDate>Fri, 22 Jan 2010 19:07:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>WebSphere + JNDI + Spring Framework + Hibernate</title>
		<link>http://devblog.x-sphere.com/index.php/2008/01/23/websphere-jndi-spring-framework-hibernate/</link>
		<comments>http://devblog.x-sphere.com/index.php/2008/01/23/websphere-jndi-spring-framework-hibernate/#comments</comments>
		<pubDate>Wed, 23 Jan 2008 20:50:43 +0000</pubDate>
		<dc:creator>Matt Brotherson</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[websphere]]></category>

		<guid isPermaLink="false">http://devblog.x-sphere.com/?p=39</guid>
		<description><![CDATA[Thought I&#8217;d post a snippet of applicationContext.xml for all the people out there trying a JNDI data source wired up in IBM&#8217;s WebSphere Application Server through Spring Framework and Hibernate. I couldn&#8217;t find this information as a whole anywhere out there so hopefully it helps someone. Hit the jump for the xml. &#60;beans&#62; &#60;bean id=&#34;dataSource&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>Thought I&#8217;d post a snippet of applicationContext.xml for all the people out there trying a JNDI data source wired up in IBM&#8217;s WebSphere Application Server through Spring Framework and Hibernate.  I couldn&#8217;t find this information as a whole anywhere out there so hopefully it helps someone.</p>
<p>Hit the jump for the xml.<span id="more-39"></span></p>
<pre class="brush: xml;">
&lt;beans&gt;
	&lt;bean id=&quot;dataSource&quot; class=&quot;org.springframework.jndi.JndiObjectFactoryBean&quot;&gt;
        &lt;property name=&quot;jndiName&quot; value=&quot;jdbc/DB2&quot;/&gt;
        &lt;property name=&quot;lookupOnStartup&quot; value=&quot;false&quot;/&gt;
        &lt;property name=&quot;cache&quot; value=&quot;true&quot; /&gt;
        &lt;property name=&quot;proxyInterface&quot;	value=&quot;javax.sql.DataSource&quot; /&gt;
    &lt;/bean&gt;

    &lt;!-- Hibernate SessionFactory --&gt;
	&lt;bean id=&quot;sessionFactory&quot; class=&quot;org.springframework.orm.hibernate3.LocalSessionFactoryBean&quot;&gt;
		&lt;property name=&quot;dataSource&quot; ref=&quot;dataSource&quot;/&gt;
		&lt;property name=&quot;mappingResources&quot;&gt;
			&lt;list&gt;
				&lt;value&gt;User.hbm.xml&lt;/value&gt;
			&lt;/list&gt;
		&lt;/property&gt;
		&lt;property name=&quot;hibernateProperties&quot;&gt;
		    &lt;props&gt;
		      &lt;prop key=&quot;hibernate.dialect&quot;&gt;org.hibernate.dialect.DB2Dialect&lt;/prop&gt;
		      &lt;prop key=&quot;hibernate.show_sql&quot;&gt;true&lt;/prop&gt;
		      &lt;!-- 			IBM WAS SPECIFIC			 --&gt;
		      &lt;prop key=&quot;hibernate.connection.datasource&quot;&gt;jdbc/DB2&lt;/prop&gt;
		      &lt;prop key=&quot;hibernate.transaction.factory_class&quot;&gt;org.hibernate.transaction.CMTTransactionFactory&lt;/prop&gt;
			  &lt;prop key=&quot;hibernate.transaction.manager_lookup_class&quot;&gt;org.hibernate.transaction.WebSphereExtendedJTATransactionLookup&lt;/prop&gt;
			  &lt;!-- 			/END IBM WAS SPECIFIC		 --&gt;
		    &lt;/props&gt;
		&lt;/property&gt;
	&lt;/bean&gt;

	&lt;bean id=&quot;transactionManager&quot;
		class=&quot;org.springframework.transaction.jta.JtaTransactionManager&quot;&gt;
			&lt;property name=&quot;autodetectTransactionManager&quot; value=&quot;false&quot; /&gt;
	&lt;/bean&gt;
&lt;/beans&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://devblog.x-sphere.com/index.php/2008/01/23/websphere-jndi-spring-framework-hibernate/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>google analytics plugin</title>
		<link>http://devblog.x-sphere.com/index.php/2007/03/06/google-analytics-plugin/</link>
		<comments>http://devblog.x-sphere.com/index.php/2007/03/06/google-analytics-plugin/#comments</comments>
		<pubDate>Tue, 06 Mar 2007 15:47:12 +0000</pubDate>
		<dc:creator>Matt Brotherson</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://devblog.x-sphere.com/index.php/2007/03/06/google-analytics-plugin/</guid>
		<description><![CDATA[I&#8217;ve released another plugin for wordpress. The details can be found here.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve released another plugin for wordpress.  The details can be found <a href="http://devblog.x-sphere.com/index.php/projects/wordpress/google-analytics-js">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.x-sphere.com/index.php/2007/03/06/google-analytics-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wp-weather widget</title>
		<link>http://devblog.x-sphere.com/index.php/2007/03/01/wp-weather-widget/</link>
		<comments>http://devblog.x-sphere.com/index.php/2007/03/01/wp-weather-widget/#comments</comments>
		<pubDate>Fri, 02 Mar 2007 01:39:35 +0000</pubDate>
		<dc:creator>Matt Brotherson</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[weather]]></category>
		<category><![CDATA[widget]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://devblog.x-sphere.com/index.php/2007/03/01/wp-weather-widget/</guid>
		<description><![CDATA[I&#8217;ve released a new plugin/sidebar widget for wordpress. Details are here: wp-weather widget.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve released a new plugin/sidebar widget for wordpress.  Details are here: <a href="http://devblog.x-sphere.com/index.php/projects/wordpress/wp-weather" title="wp-weather widget">wp-weather widget</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.x-sphere.com/index.php/2007/03/01/wp-weather-widget/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>hibernate and subclasses</title>
		<link>http://devblog.x-sphere.com/index.php/2006/11/02/hibernate-and-subclasses/</link>
		<comments>http://devblog.x-sphere.com/index.php/2006/11/02/hibernate-and-subclasses/#comments</comments>
		<pubDate>Thu, 02 Nov 2006 15:56:26 +0000</pubDate>
		<dc:creator>Matt Brotherson</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[data access objects]]></category>
		<category><![CDATA[discriminator]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[subclasses]]></category>

		<guid isPermaLink="false">http://devblog.x-sphere.com/index.php/2006/11/02/hibernate-and-subclasses/</guid>
		<description><![CDATA[Another challenge that presented us in developing our current product was persistence. Upon the recommendation of our architect, we chose Hibernate. Hibernate is a great tool for persisting model objects to nearly any data source you could imagine. The base implementation with our Data Access Objects (DAO&#8217;s) was straight forward. We didn&#8217;t want to create [...]]]></description>
			<content:encoded><![CDATA[<p>Another challenge that presented us in developing our current product was persistence.  Upon the recommendation of our architect, we chose Hibernate.  Hibernate is a great tool for persisting model objects to nearly any data source you could imagine.  The base implementation with our Data Access Objects (DAO&#8217;s) was straight forward.</p>
<p>We didn&#8217;t want to create an overly large schema for storing objects so when we started getting into subclasses we looked for a solution to handle subclasses and store them in the same table as the superclass.  Luckily Hibernate can handle this as well.  The only downside to our approach was that we ended up with a table that has columns for all the properties of each subclass with not-null set to false.  This means your data integrity will have to reside in your manager objects.</p>
<p><span id="more-6"></span></p>
<p>An example hibernate mapping for a super/subclass relationship looks like this:</p>
<pre class="brush: xml;">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE hibernate-mapping PUBLIC
&quot;-//Hibernate/Hibernate Mapping DTD 3.0//EN&quot;
&quot;http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd&quot;&gt;

&lt;hibernate-mapping&gt;
&lt;class name=&quot;somepackage.model.DataItem&quot; table=&quot;DATA_ITEM&quot; polymorphism=&quot;implicit&quot;&gt;
&lt;id name=&quot;id&quot; column=&quot;DATA_ITEM_ID&quot; unsaved-value=&quot;0&quot;&gt;
&lt;!-- The &quot;increment&quot; generator would hose us in a clustered environment. --&gt;
&lt;generator class=&quot;increment&quot; /&gt;
&lt;/id&gt;
&lt;discriminator column=&quot;DISCRIMINATOR&quot; type=&quot;string&quot; /&gt;

&lt;subclass name=&quot;somepackage.model.ReportDataItem&quot; discriminator-value=&quot;Report&quot; /&gt;

&lt;subclass name=&quot;somepackage.model.KpiDataItem&quot; discriminator-value=&quot;KPI&quot;&gt;
&lt;property name=&quot;symbolID&quot; column=&quot;SYMBOL_ID&quot; not-null=&quot;false&quot; /&gt;
&lt;/subclass&gt;

&lt;/class&gt;
&lt;/hibernate-mapping&gt;</pre>
<p>As you can see &#8211; set the polymorphism attribute to implicit and use the  tags to create the mapping.  You also need to define the discriminator to tell Hibernate what class to instantiate.  In your DAO&#8217;s, pull back a list collection and you will have a collection of instances of classes based on your mapping.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.x-sphere.com/index.php/2006/11/02/hibernate-and-subclasses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>truelicense licensing framework</title>
		<link>http://devblog.x-sphere.com/index.php/2006/11/01/truelicense-licensing-framework/</link>
		<comments>http://devblog.x-sphere.com/index.php/2006/11/01/truelicense-licensing-framework/#comments</comments>
		<pubDate>Thu, 02 Nov 2006 01:17:48 +0000</pubDate>
		<dc:creator>Matt Brotherson</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[licensing framework]]></category>
		<category><![CDATA[true license]]></category>

		<guid isPermaLink="false">http://devblog.x-sphere.com/index.php/2006/11/01/truelicense-licensing-framework/</guid>
		<description><![CDATA[One of the things a commercial application needs to protect intellectual property as well as avert piracy is a licensing component. As the application I&#8217;m managing is a java based web product we naturally needed a java based licensing framework. Our answer was found in TLC &#8211; an open source licensing framework that offers everything [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things a commercial application needs to protect intellectual property as well as avert piracy is a licensing component.  As the application I&#8217;m managing is a java based web product we naturally needed a java based licensing framework.  Our answer was found in <a title="true license component" href="https://truelicense.dev.java.net/">TLC</a> &#8211; an open source licensing framework that offers everything from license creation to license verification.</p>
<p>The tutorial(s) leave a little to be desired from a custom implementation perspective, but after several emails to the creator (note: send emails to the mailing list, not him directly!) we were able to get past the issues left unclear by the tutorial.  The framework makes it so simple to use a private key store to generate a license and then distribute your application with the public key store for verification of the license.</p>
<p>Our implementation in a web application utilizes a servlet filter to read the license file, verify it and then install it.  It&#8217;s really quite simple and we ended up with only four class files to implement.  A SWT client was created to generate the licenses for our purchasing and trial customers.</p>
<p>Another note: the framework also included support for a &#8216;free trial period&#8217;.  We chose not to use this as we wanted to keep a strong grasp on where our application was installed, but the &#8216;ftp&#8217; option looks promising.</p>
<p>Anyone in need of a licensing framework for java, check <a title="tlc" href="https://truelicense.dev.java.net/">TLC</a> out!</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.x-sphere.com/index.php/2006/11/01/truelicense-licensing-framework/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
