<?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>Snackycracky Techblog&#187; Snackycracky Blog</title>
	<atom:link href="http://blog.srvme.de/tag/hibernate/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.srvme.de</link>
	<description></description>
	<lastBuildDate>Mon, 14 Jun 2010 21:33:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>xml for mysql for radius for coovachilli because hibernates 2nd datasource was weak :(</title>
		<link>http://blog.srvme.de/2008/08/18/xml-for-mysql-for-radius-for-coovachilli-because-hibernates-2nd-datasource-was-weak/</link>
		<comments>http://blog.srvme.de/2008/08/18/xml-for-mysql-for-radius-for-coovachilli-because-hibernates-2nd-datasource-was-weak/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 18:33:58 +0000</pubDate>
		<dc:creator>nils</dc:creator>
				<category><![CDATA[algorithms]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cgi]]></category>
		<category><![CDATA[coova chilli]]></category>
		<category><![CDATA[datasource]]></category>
		<category><![CDATA[decode url]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[radcheck]]></category>
		<category><![CDATA[radius]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[stored procedure]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xml service mysql]]></category>

		<guid isPermaLink="false">http://snackycracky.wordpress.com/?p=64</guid>
		<description><![CDATA[when i tried to add another datasource to the hibernate environment i ran into problems (connection timed out)&#8230; i now use the xml way which i talk about earlier &#8230; well i didn&#8217;t want to install mysql 6 because its just in the alpha release. so i wrote this little cgi script. later when mysql [...]]]></description>
			<content:encoded><![CDATA[<p>when i tried to add another datasource to the hibernate environment i ran into problems (connection timed out)&#8230; i now use the xml way which i talk about earlier &#8230; well i didn&#8217;t want to install mysql 6 because its just in the alpha release. so i wrote this little cgi script. later when mysql 6 is stable I will use the LOAD XML function. This has the big benefit that i don&#8217;t have to open the 3306 &#8230; which was dirty but fast anyway.</p>
<p>the privileges: &#8220;insert, update, select, <tt>ALTER ROUTINE,</tt> <tt>CREATE ROUTINE, </tt> <tt>EXECUTE, File</tt>&#8221; are needed.</p>
<p>This script <a href="http://srvme.de/trac/snackycracky_techblog/browser/snackycrack_techblog/xmlServiceForMySql/update.cgi" target="_blank">here </a>can insert and update data in the tables via xml:</p>
<p>here is the format of the xml files for input:</p>
<p>&lt;updates&gt;<br />
&lt;update&gt;<br />
&lt;field name=&#8221;UserName&#8221;&gt;some new name&lt;/field&gt;<br />
&lt;condition name=&#8221;id&#8221;&gt;7&lt;/condition&gt;<br />
&lt;/update&gt;<br />
&#8230;.<br />
&lt;/updates&gt;</p>
<p>&lt;inserts&gt;<br />
&lt;insert&gt;<br />
&lt;field name=&#8221;UserName&#8221;&gt;tttttttttttt&lt;/field&gt;<br />
&lt;field name=&#8221;Value&#8221;&gt;tttttt&lt;/field&gt;<br />
&#8230;<br />
&lt;/insert&gt;<br />
&#8230;<br />
&lt;/inserts&gt;</p>
<p>for getting data this here is possible:</p>
<p>for getting the rows when somebody was online, put the parameters &#8216;actTime&#8217; with the condition Value yyyy-mm-dd hh:mm and for the &#8216;type&#8217; put the Value &#8216;getActionsInTime&#8217;, than you get something like this:</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;resultset&gt;
&lt;row&gt;
&lt;field&gt;
&lt;WlanUserActions&gt;
&lt;Action&gt;
&lt;AcctStartTime&gt;2008-09-01 19:34:01&lt;/AcctStartTime&gt;
&lt;UserName&gt;username&lt;/UserName&gt;
&lt;FramedIPAddress&gt;10.1.0.114&lt;/FramedIPAddress&gt;
&lt;AcctTerminateCause&gt;User-Request&lt;/AcctTerminateCause&gt;
&lt;AcctSessionTime&gt;16731&lt;/AcctSessionTime&gt;
&lt;AcctStopTime&gt;2008-09-02 00:12:52&lt;/AcctStopTime&gt;
&lt;/Action&gt;
....
&lt;/WlanUserActions &gt;
&lt;/field&gt;
&lt;/row&gt;
&lt;/resultset&gt;</pre>
<p>i haven&#8217;t figured out how to get rid of the row and field tags&#8230;from a mysql command.<br />
To get Rows from the radacct table for a specific user put &#8216;getActions&#8217; as type and set the Value<br />
for the parameter &#8216;UserName&#8217;.</p>
<p><span style="color:#ff0000;">BE WARNED THERE SOME HIGH SECURITY RISKS BY IMPLEMENTING THIS SCRIPT, I CAN NOT BE MADE RESPONSIBLE FOR ANYTHING HAPPENING BECAUSE OF THIS SCRIPT.<br />
</span><br />
<a href="http://srvme.de/trac/snackycracky_techblog/browser/snackycrack_techblog/xmlServiceForMySql/update.cgi" target="_blank">here</a></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d64').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d64" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F18%2Fxml-for-mysql-for-radius-for-coovachilli-because-hibernates-2nd-datasource-was-weak%2F&amp;submitHeadline=xml+for+mysql+for+radius+for+coovachilli+because+hibernates+2nd+datasource+was+weak+%3A%28&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F18%2Fxml-for-mysql-for-radius-for-coovachilli-because-hibernates-2nd-datasource-was-weak%2F&amp;title=xml+for+mysql+for+radius+for+coovachilli+because+hibernates+2nd+datasource+was+weak+%3A%28" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F18%2Fxml-for-mysql-for-radius-for-coovachilli-because-hibernates-2nd-datasource-was-weak%2F&amp;title=xml+for+mysql+for+radius+for+coovachilli+because+hibernates+2nd+datasource+was+weak+%3A%28" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F18%2Fxml-for-mysql-for-radius-for-coovachilli-because-hibernates-2nd-datasource-was-weak%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F18%2Fxml-for-mysql-for-radius-for-coovachilli-because-hibernates-2nd-datasource-was-weak%2F&amp;title=xml+for+mysql+for+radius+for+coovachilli+because+hibernates+2nd+datasource+was+weak+%3A%28" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F18%2Fxml-for-mysql-for-radius-for-coovachilli-because-hibernates-2nd-datasource-was-weak%2F&amp;bm_description=xml+for+mysql+for+radius+for+coovachilli+because+hibernates+2nd+datasource+was+weak+%3A%28" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F18%2Fxml-for-mysql-for-radius-for-coovachilli-because-hibernates-2nd-datasource-was-weak%2F&amp;T=xml+for+mysql+for+radius+for+coovachilli+because+hibernates+2nd+datasource+was+weak+%3A%28" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F18%2Fxml-for-mysql-for-radius-for-coovachilli-because-hibernates-2nd-datasource-was-weak%2F&amp;title=xml+for+mysql+for+radius+for+coovachilli+because+hibernates+2nd+datasource+was+weak+%3A%28" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F18%2Fxml-for-mysql-for-radius-for-coovachilli-because-hibernates-2nd-datasource-was-weak%2F&amp;title=xml+for+mysql+for+radius+for+coovachilli+because+hibernates+2nd+datasource+was+weak+%3A%28" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F18%2Fxml-for-mysql-for-radius-for-coovachilli-because-hibernates-2nd-datasource-was-weak%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F18%2Fxml-for-mysql-for-radius-for-coovachilli-because-hibernates-2nd-datasource-was-weak%2F" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+xml+for+mysql+for+radius+for+coovachilli+because+hibernates+2nd+datasource+was+weak+%3A%28+@+http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F18%2Fxml-for-mysql-for-radius-for-coovachilli-because-hibernates-2nd-datasource-was-weak%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F18%2Fxml-for-mysql-for-radius-for-coovachilli-because-hibernates-2nd-datasource-was-weak%2F&amp;t=xml+for+mysql+for+radius+for+coovachilli+because+hibernates+2nd+datasource+was+weak+%3A%28" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d64').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d64').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://blog.srvme.de/2008/08/18/xml-for-mysql-for-radius-for-coovachilli-because-hibernates-2nd-datasource-was-weak/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://blog.srvme.de/2008/08/07/52/</link>
		<comments>http://blog.srvme.de/2008/08/07/52/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 11:01:48 +0000</pubDate>
		<dc:creator>nils</dc:creator>
				<category><![CDATA[hibernate]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[choova chilli]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[hotspotlogin.cgi]]></category>
		<category><![CDATA[logoff]]></category>
		<category><![CDATA[logout]]></category>
		<category><![CDATA[radius]]></category>
		<category><![CDATA[simultaneously]]></category>

		<guid isPermaLink="false">http://snackycracky.wordpress.com/?p=52</guid>
		<description><![CDATA[well its not that spectacular but for me it couldn&#8217;t be better: In my Application which i&#8217;m developing over a year now i need to access the radius database for user modifications. say simple: in my app i want to control who can access the internet. I opend the database port 3306 by uncommenting the [...]]]></description>
			<content:encoded><![CDATA[<p>well its not that spectacular but for me it couldn&#8217;t be better:</p>
<p>In my Application which i&#8217;m developing over a year now i need to access the radius database for user modifications. say simple: in my app i want to control who can access the internet.<br />
I opend the database port 3306 by uncommenting the bindto=127.0.0.1 in /etc/mysql/my.cnf or similar, which is not very clean. A xml connection for simple crud would be better but i am under time pressure &#8230;.<br />
With hibernate i was able to connect to the radius db besides the app database by defining another &#8220;dataSource&#8221; like this:<br />
<code><br />
&lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;<br />
</code></p>
<pre style="padding-left:30px;"><code> &lt;property name="driverClassName" value="@DB-DRIVERNAME@"/&gt;</code></pre>
<pre style="padding-left:30px;"><code> &lt;property name="url" value="@DB-URL@"/&gt;</code></pre>
<pre style="padding-left:30px;"><code> &lt;property name="username" value="@DB-USERNAME@"/&gt;</code></pre>
<pre style="padding-left:30px;"><code> &lt;property name="password" value="@DB-PASSWORD@"/&gt;</code></pre>
<pre style="padding-left:30px;"><code> &lt;property name="maxActive" value="100"/&gt;</code></pre>
<pre style="padding-left:30px;"><code> &lt;property name="maxIdle" value="30"/&gt;</code></pre>
<pre style="padding-left:30px;"><code> &lt;property name="maxWait" value="1000"/&gt;</code></pre>
<pre style="padding-left:30px;"><code> &lt;property name="defaultAutoCommit" value="true"/&gt;</code></pre>
<pre style="padding-left:30px;"><code> &lt;property name="removeAbandoned" value="true"/&gt;</code></pre>
<pre style="padding-left:30px;"><code> &lt;property name="removeAbandonedTimeout" value="60"/&gt;</code></pre>
<p><code> &lt;/bean&gt;<br />
&lt;bean id="dataSourceRadius" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;<br />
</code></p>
<pre style="padding-left:30px;"><code> &lt;property name="driverClassName" value="com.mysql.jdbc.Driver"/&gt;</code></pre>
<pre style="padding-left:30px;"><code> &lt;property name="url" value="jdbc:mysql://x.x.x.x/radius?zeroDateTimeBehavior=convertToNull"/&gt;</code></pre>
<pre style="padding-left:30px;"><code> &lt;property name="username" value="radius"/&gt;</code></pre>
<pre style="padding-left:30px;"><code> &lt;property name="password" value="somepwd"/&gt;</code></pre>
<pre style="padding-left:30px;"><code> &lt;property name="maxActive" value="100"/&gt;</code></pre>
<pre style="padding-left:30px;"><code> &lt;property name="maxIdle" value="30"/&gt;</code></pre>
<pre style="padding-left:30px;"><code> &lt;property name="maxWait" value="1000"/&gt;</code></pre>
<pre style="padding-left:30px;"><code> &lt;property name="defaultAutoCommit" value="true"/&gt;</code></pre>
<pre style="padding-left:30px;"><code> &lt;property name="removeAbandoned" value="true"/&gt;</code></pre>
<pre style="padding-left:30px;"><code> &lt;property name="removeAbandonedTimeout" value="60"/&gt;</code></pre>
<p><code> &lt;/bean&gt;</code></p>
<p>i tried to modify the hotspotlogin.cgi perl script but i&#8217;m not really getting it. AND what i hate the most of all is that html code is printed line by line, in my eyes that is sooo messy &#8230; i heared that other login pages are out there so i have to study them today. I also want to control the logout process from my app, this is a little bit tricky too <img src='http://blog.srvme.de/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  i need to access the adress http://10.1.0.1:3990/logoff but with this addy i can&#8217;t say which user to log off &#8230;</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d52').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d52" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F07%2F52%2F&amp;submitHeadline=&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F07%2F52%2F&amp;title=" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F07%2F52%2F&amp;title=" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F07%2F52%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F07%2F52%2F&amp;title=" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F07%2F52%2F&amp;bm_description=" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F07%2F52%2F&amp;T=" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F07%2F52%2F&amp;title=" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F07%2F52%2F&amp;title=" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F07%2F52%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F07%2F52%2F" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out++@+http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F07%2F52%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fblog.srvme.de%2F2008%2F08%2F07%2F52%2F&amp;t=" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d52').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d52').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://blog.srvme.de/2008/08/07/52/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>hibernate inheritance</title>
		<link>http://blog.srvme.de/2008/07/16/hibernate-inheritance/</link>
		<comments>http://blog.srvme.de/2008/07/16/hibernate-inheritance/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 09:14:15 +0000</pubDate>
		<dc:creator>nils</dc:creator>
				<category><![CDATA[AppFuse]]></category>
		<category><![CDATA[classcastexception]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[inheritance]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[lazy]]></category>

		<guid isPermaLink="false">http://snackycracky.wordpress.com/?p=21</guid>
		<description><![CDATA[inheritance is a well known part of polymorphism in any object orientated language. To map something like an abstract class called &#8220;Customer&#8221; which has two subcalsses called &#8220;PrivateClient&#8221; and &#8220;CompanyClient&#8221; you have three different choices which are well documented in the hibernate docs (table-per-class, &#8230;). When you retrieve the class from the database by runtime, [...]]]></description>
			<content:encoded><![CDATA[<p>inheritance is a well known part of polymorphism in any object orientated language. To map something like an abstract class called &#8220;Customer&#8221; which has two subcalsses called &#8220;PrivateClient&#8221; and &#8220;CompanyClient&#8221; you have three different choices which are well documented in the hibernate docs (table-per-class, &#8230;).</p>
<p>When you retrieve the class from the database by runtime, hibernate dosen&#8217;t load the real subclass just the superclass, until it gets loaded in deph. By default the lazy loading method does that.</p>
<p>Turning off lazy loading on the superclass in the mapping file prevents loading only the superclass, enabling to cast the superclass to a subclass sucssesfully.</p>
<p>I don&#8217;t really like trying with the keyword &#8220;instancof&#8221; to check which subclass it is, so my roommate pointed me to the &#8220;Visitor Pattern&#8221; but i don&#8217;t really understand it jet. In my future Postings I will include it.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d21').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d21" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http%3A%2F%2Fblog.srvme.de%2F2008%2F07%2F16%2Fhibernate-inheritance%2F&amp;submitHeadline=hibernate+inheritance&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fblog.srvme.de%2F2008%2F07%2F16%2Fhibernate-inheritance%2F&amp;title=hibernate+inheritance" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.srvme.de%2F2008%2F07%2F16%2Fhibernate-inheritance%2F&amp;title=hibernate+inheritance" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fblog.srvme.de%2F2008%2F07%2F16%2Fhibernate-inheritance%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fblog.srvme.de%2F2008%2F07%2F16%2Fhibernate-inheritance%2F&amp;title=hibernate+inheritance" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fblog.srvme.de%2F2008%2F07%2F16%2Fhibernate-inheritance%2F&amp;bm_description=hibernate+inheritance" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fblog.srvme.de%2F2008%2F07%2F16%2Fhibernate-inheritance%2F&amp;T=hibernate+inheritance" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fblog.srvme.de%2F2008%2F07%2F16%2Fhibernate-inheritance%2F&amp;title=hibernate+inheritance" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.srvme.de%2F2008%2F07%2F16%2Fhibernate-inheritance%2F&amp;title=hibernate+inheritance" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.srvme.de%2F2008%2F07%2F16%2Fhibernate-inheritance%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http%3A%2F%2Fblog.srvme.de%2F2008%2F07%2F16%2Fhibernate-inheritance%2F" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+hibernate+inheritance+@+http%3A%2F%2Fblog.srvme.de%2F2008%2F07%2F16%2Fhibernate-inheritance%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fblog.srvme.de%2F2008%2F07%2F16%2Fhibernate-inheritance%2F&amp;t=hibernate+inheritance" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://blog.srvme.de/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d21').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d21').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://blog.srvme.de/2008/07/16/hibernate-inheritance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
