<?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>Nalfein's Blog</title>
	<atom:link href="http://nalfeins.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nalfeins.wordpress.com</link>
	<description>Interesting things inquiring minds possibly want to know</description>
	<lastBuildDate>Sat, 26 Feb 2011 12:41:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='nalfeins.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Nalfein's Blog</title>
		<link>http://nalfeins.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://nalfeins.wordpress.com/osd.xml" title="Nalfein&#039;s Blog" />
	<atom:link rel='hub' href='http://nalfeins.wordpress.com/?pushpress=hub'/>
		<item>
		<title>ICEfaces clear input fields of a certain bean</title>
		<link>http://nalfeins.wordpress.com/2011/02/26/icefaces-clear-input-fields-of-a-certain-bean/</link>
		<comments>http://nalfeins.wordpress.com/2011/02/26/icefaces-clear-input-fields-of-a-certain-bean/#comments</comments>
		<pubDate>Sat, 26 Feb 2011 12:41:56 +0000</pubDate>
		<dc:creator>nalfein</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://nalfeins.wordpress.com/?p=57</guid>
		<description><![CDATA[Hi, today I will show you a nice solution to clear or refresh input fields. This solution does this with the Direct-2-Dom abilities of ICEfaces. I would not like to use the Render API of ICEfaces because there are some drawback I would not like to handle with. So this solution does not use any [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nalfeins.wordpress.com&amp;blog=6929609&amp;post=57&amp;subd=nalfeins&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>today I will show you a nice solution to clear or refresh input fields. This solution does this with the Direct-2-Dom abilities of ICEfaces. I would not like to use the Render API of ICEfaces because there are some drawback I would not like to handle with. So this solution does not use any special Rendering API of ICEfaces and is very easy to integrate it into existing code without to much refactoring.</p>
<p>So lets beginn, here is the source code:</p>
<p><pre class="brush: java;">
public static void cleanBackingBean(String beanName)
{
  try
  {
    ValueExpression binding = context.getApplication().getExpressionFactory().createValueExpression(elContext, &quot;#{&quot; + beanName + &quot;}&quot;, Object.class);
    Object object = binding.getValue(elContext);
    object = Class.forName(object.getClass().getName()).newInstance();
    setBackingBean(object, beanName);

    clearSubmittedValues(beanName);
  }
  catch (Exception ex)
  {
    ex.printStackTrace();
  }
}

public static void clearSubmittedValues(String beanName)
{
  FacesContext context = FacesContext.getCurrentInstance();
  UIViewRoot viewRoot = context.getViewRoot();
  List&lt;UIComponent&gt; uiComponentList = viewRoot.getChildren();

  for (UIComponent uiComponent : uiComponentList)
  {
    clearSubmittedValues(uiComponent, beanName, context);
  }
}

private static void clearSubmittedValues(UIComponent component, String beanName, FacesContext context)
{
  if (component instanceof UIInput)
  {
    try
    {
      if (component.getValueExpression(&quot;value&quot;).getExpressionString().indexOf(beanName) &gt; -1)
      {
         PassThruAttributeRenderer.renderAttributes(context, component, new String[0]);
      }
    }
    catch (NullPointerException ingnore)
    {
      // Nothing to log here. The NullPointerException just means that there is no ValueExpression found with name 'value'.
    }
  }

  List&lt;UIComponent&gt; childenList = component.getChildren();
  if (childenList.size() &gt; 0)
  {
    Iterator&lt;UIComponent&gt; childIter = childenList.iterator();
    while (childIter.hasNext())
    {
      clearSubmittedValues((UIComponent)childIter.next(), beanName, context);
    }
  }
}
</pre></p>
<p>The &#8220;cleanBackingBean&#8221; method just takes the beanName (as defined in the faces xml). And creates a new instance (which means empty) of this bean and set it back to the application context.<br />
The &#8220;clearSubmittedValues&#8221; method search for all input fields in the view that are associated with the given bean and set them to rerender in the response phase.</p>
<p>Thats all the magic. The &#8220;clearSubmittedValues&#8221; method can be optimised. The search for the solution took me some time, so I hope it will help others to move on faster.</p>
<br />Filed under: <a href='http://nalfeins.wordpress.com/category/software-development/'>Software Development</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nalfeins.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nalfeins.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nalfeins.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nalfeins.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nalfeins.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nalfeins.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nalfeins.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nalfeins.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nalfeins.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nalfeins.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nalfeins.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nalfeins.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nalfeins.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nalfeins.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nalfeins.wordpress.com&amp;blog=6929609&amp;post=57&amp;subd=nalfeins&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nalfeins.wordpress.com/2011/02/26/icefaces-clear-input-fields-of-a-certain-bean/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/82b85fed9ed0c010a0b633a255d51ea6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nalfein</media:title>
		</media:content>
	</item>
		<item>
		<title>Persisting an Enum with Hibernate</title>
		<link>http://nalfeins.wordpress.com/2010/11/26/persisting-an-enum-with-hibernate-2/</link>
		<comments>http://nalfeins.wordpress.com/2010/11/26/persisting-an-enum-with-hibernate-2/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 21:15:06 +0000</pubDate>
		<dc:creator>nalfein</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://nalfeins.wordpress.com/?p=52</guid>
		<description><![CDATA[The following code is a template for easy Enum mapping. Here is an example Enum: Now we just need to create the following custom mapping type: Finally, add it to your mapping file: Or add it via Annotation: I helps me very well and I hope you too. Filed under: Software Development<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nalfeins.wordpress.com&amp;blog=6929609&amp;post=52&amp;subd=nalfeins&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following code is a template for easy Enum mapping.</p>
<p><pre class="brush: java;">
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Types;
import org.hibernate.HibernateException;
import org.hibernate.usertype.UserType;

public class EnumType&lt;E extends Enum&lt;E&gt;&gt; implements UserType {

 private static final int[] SQL_TYPES = {Types.VARCHAR};
 private Class&lt;E&gt; clazz = null;

 protected EnumType(Class&lt;E&gt; clazz) {
 this.clazz = clazz;
 }

 public int[] sqlTypes() {
 return SQL_TYPES;
 }

 public Class&lt;E&gt; returnedClass() {
 return clazz;
 }

 public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner) throws HibernateException, SQLException {
 String name = resultSet.getString(names[0]);
 E result = null;
 if (!resultSet.wasNull()) {
 result = Enum.valueOf(clazz, name);
 }
 return result;
 }

 public void nullSafeSet(PreparedStatement preparedStatement, Object value, int index) throws HibernateException, SQLException {
 if (null == value) {
 preparedStatement.setNull(index, Types.VARCHAR);
 }
 else {
 preparedStatement.setString(index, ((Enum)value).name());
 }
 }

 public Object deepCopy(Object value) throws HibernateException{
 return value;
 }

 public boolean isMutable() {
 return false;
 }

 public Object assemble(Serializable cached, Object owner) throws HibernateException {
 return cached;
 }

 public Serializable disassemble(Object value) throws HibernateException {
 return (Serializable)value;
 }

 public Object replace(Object original, Object target, Object owner) throws HibernateException {
 return original;
 }

 public int hashCode(Object x) throws HibernateException {
 return x.hashCode();
 }

 public boolean equals(Object x, Object y) throws HibernateException {
 if (x == y) {
 return true;
 }

 if (null == x || null == y) {
 return false;
 }

 return x.equals(y);
 }
}
</pre></p>
<p>Here is an example Enum:</p>
<p><pre class="brush: java;">
public ExampleEnum {
 ENUM_A,
 ENUM_B;
}
</pre></p>
<p>Now we just need to create the following custom mapping type:</p>
<p><pre class="brush: java;">
public class ExampleEnumType extends EnumType&lt;ExampleEnum&gt; {

public ExampleEnumType() {
 super(ExampleEnum.class);
 }
}
</pre></p>
<p>Finally, add it to your mapping file:</p>
<p><pre class="brush: xml;">
&lt;hibernate-mapping&gt;
[...]
 &lt;property name=&quot;sample&quot; type=&quot;mypackage.MyEnumUserType&quot; not-null=&quot;true&quot;/&gt;
[...]
</pre></p>
<p>Or add it via Annotation:</p>
<p><pre class="brush: java;">
@Entity
@TypeDef(name = &quot;exampleEnumTypeDef&quot;, typeClass = ExampleEnumType.class)
public class Test {
 private ExampleEnum exampleEnum;
 [...]

@Type(type = &quot;exampleEnumTypeDef&quot;)
@Column(name = &quot;example&quot;)
public ExampleEnum getExample() {
 return exampleEnum;
 }

public void setExample(ExampleEnum exampleEnum) {
 this.exampleEnum = exampleEnum;
 }
}
</pre></p>
<p>I helps me very well and I hope you too.</p>
<br />Filed under: <a href='http://nalfeins.wordpress.com/category/software-development/'>Software Development</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nalfeins.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nalfeins.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nalfeins.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nalfeins.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nalfeins.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nalfeins.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nalfeins.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nalfeins.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nalfeins.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nalfeins.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nalfeins.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nalfeins.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nalfeins.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nalfeins.wordpress.com/52/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nalfeins.wordpress.com&amp;blog=6929609&amp;post=52&amp;subd=nalfeins&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nalfeins.wordpress.com/2010/11/26/persisting-an-enum-with-hibernate-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/82b85fed9ed0c010a0b633a255d51ea6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nalfein</media:title>
		</media:content>
	</item>
		<item>
		<title>Remove unneeded and superfluous whitespaces</title>
		<link>http://nalfeins.wordpress.com/2010/11/26/remove-unneeded-and-superfluous-whitespaces/</link>
		<comments>http://nalfeins.wordpress.com/2010/11/26/remove-unneeded-and-superfluous-whitespaces/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 20:16:49 +0000</pubDate>
		<dc:creator>nalfein</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://nalfeins.wordpress.com/?p=40</guid>
		<description><![CDATA[Here is a very small and simple code to remove superfluous whitespaces (leading, in between but leave at least one and at the end). &#160; String test = &#8221; Hello   World  here I    am.  &#8220;; test = test.replaceAll(&#8220;\\s+&#8221;, &#8221; &#8220;).trim(); Result is: &#8220;Hello World here I am.”; &#160; I have seen a lot of other [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nalfeins.wordpress.com&amp;blog=6929609&amp;post=40&amp;subd=nalfeins&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is a very small and simple  code to remove superfluous whitespaces (leading, in between but leave at  least one and at the end).</p>
<p>&nbsp;</p>
<p>String test = &#8221; Hello   World  here I    am.  &#8220;;</p>
<p>test = test.replaceAll(&#8220;\\s+&#8221;, &#8221; &#8220;).trim();</p>
<p>Result is: &#8220;Hello World here I am.”;</p>
<p>&nbsp;</p>
<p>I  have seen a lot of other implementations that will also work. But they  often use the regex package, which produces too much overhead and is not  needed for such small issue.</p>
<br />Filed under: <a href='http://nalfeins.wordpress.com/category/software-development/'>Software Development</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nalfeins.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nalfeins.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nalfeins.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nalfeins.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nalfeins.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nalfeins.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nalfeins.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nalfeins.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nalfeins.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nalfeins.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nalfeins.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nalfeins.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nalfeins.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nalfeins.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nalfeins.wordpress.com&amp;blog=6929609&amp;post=40&amp;subd=nalfeins&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nalfeins.wordpress.com/2010/11/26/remove-unneeded-and-superfluous-whitespaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/82b85fed9ed0c010a0b633a255d51ea6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nalfein</media:title>
		</media:content>
	</item>
		<item>
		<title>Drop / Deleting Foreign Key in MySQL</title>
		<link>http://nalfeins.wordpress.com/2010/05/04/drop-deleting-foreign-key-in-mysql/</link>
		<comments>http://nalfeins.wordpress.com/2010/05/04/drop-deleting-foreign-key-in-mysql/#comments</comments>
		<pubDate>Tue, 04 May 2010 10:09:43 +0000</pubDate>
		<dc:creator>nalfein</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://nalfeins.wordpress.com/?p=36</guid>
		<description><![CDATA[Sometimes it could be a little bit strange if you try to drop a foreign key on a MySQL table. You get for example error messages like this one: Error on rename of &#8216;.\database\mytable&#8217; to &#8216;.\database\#sql2-6ec-11&#8242; (errno: 152) Error on rename of &#8216;.\database\#sql-6ec_13&#8242; to &#8216;.\database\mytable&#8217; (errno: 150) Often times this is because adding foreign keys [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nalfeins.wordpress.com&amp;blog=6929609&amp;post=36&amp;subd=nalfeins&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes it could be a little bit strange if you try to drop a foreign key on a MySQL table. You get for example error messages like this one:</p>
<ul>
<li><strong>Error</strong> on <strong>rename</strong> of &#8216;.\database\mytable&#8217; to &#8216;.\database\#sql2-6ec-11&#8242; (errno: 152)</li>
<li><strong>Error</strong> on <strong>rename</strong> of &#8216;.\database\#sql-6ec_13&#8242; to &#8216;.\database\mytable&#8217; (errno: 150)</li>
</ul>
<p>Often times this is because adding foreign keys also  adds an <strong>index</strong> key to the table (on top of the reference key).</p>
<p>To drop it you need to execute these two statements:</p>
<ul>
<li>ALTER TABLE &lt;table&gt; DROP FOREIGN KEY `&lt;foreign key name&gt;`;</li>
<li>DROP INDEX &lt;fk name or index name&gt; ON &lt;table&gt;;</li>
</ul>
<p>Here is another example (slight different):</p>
<p>CREATE TABLE `table_name`:<br />
| table_name | CREATE TABLE `table_name` (<br />
`id` int(20) unsigned NOT NULL auto_increment,<br />
`key_column` smallint(5) unsigned default &#8217;1&#8242;,<br />
KEY `key_column` (`key_column`),<br />
CONSTRAINT `table_name_ibfk_1` FOREIGN KEY (`key_column`) REFERENCES<br />
`second_table` (`id`) ON DELETE SET NULL<br />
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |</p>
<p>So, first you remove the key:</p>
<p>ALTER TABLE table_name <strong>DROP</strong> KEY `key_column`;</p>
<p>then the foreign key:</p>
<p>ALTER TABLE table_name <strong>DROP</strong> FOREIGN KEY `table_name_ibfk_1`;</p>
<br />Filed under: <a href='http://nalfeins.wordpress.com/category/software-development/'>Software Development</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nalfeins.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nalfeins.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nalfeins.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nalfeins.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nalfeins.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nalfeins.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nalfeins.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nalfeins.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nalfeins.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nalfeins.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nalfeins.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nalfeins.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nalfeins.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nalfeins.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nalfeins.wordpress.com&amp;blog=6929609&amp;post=36&amp;subd=nalfeins&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nalfeins.wordpress.com/2010/05/04/drop-deleting-foreign-key-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/82b85fed9ed0c010a0b633a255d51ea6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nalfein</media:title>
		</media:content>
	</item>
		<item>
		<title>Can not set java.lang.Long field to java.lang.Long</title>
		<link>http://nalfeins.wordpress.com/2010/02/18/can-not-set-java-lang-long-field-to-java-lang-long/</link>
		<comments>http://nalfeins.wordpress.com/2010/02/18/can-not-set-java-lang-long-field-to-java-lang-long/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 07:54:17 +0000</pubDate>
		<dc:creator>nalfein</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[J2EE]]></category>

		<guid isPermaLink="false">http://nalfeins.wordpress.com/?p=29</guid>
		<description><![CDATA[The error: Caused by: java.lang.IllegalArgumentException: Can not set java.lang.Long field fo.bar.ClassName to java.lang.Long The solution: The problem is that the field of the object which is used is an object itself and I did not specifiy the field of the object. Therefore we need to specifiy the field of the object. Description: This section in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nalfeins.wordpress.com&amp;blog=6929609&amp;post=29&amp;subd=nalfeins&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>The error:</strong></p>
<p>Caused by: java.lang.IllegalArgumentException: Can not set java.lang.Long field fo.bar.ClassName to java.lang.Long</p>
<p><strong>The solution:</strong></p>
<p>The problem is that the field of the object which is used is an object itself  and I did not specifiy the field of the object. Therefore we need to specifiy the field of the object.</p>
<p>Description:</p>
<p>This  section in the SQL (excerpt):</p>
<p>pricedata.product IN ( ? , ? , ? ) AND (  pricedata.product_unit IN ( ? , ? , ? )</p>
<p>need to be look like this:</p>
<p>pricedata.product<strong>.id</strong> IN ( ? , ? , ? ) AND (  pricedata.product_unit<strong>.id</strong> IN ( ? , ? , ? )</p>
<div>Another example:</div>
<div>Pricedata has a many to one relationshipt to product  (snippet from pricedata object):</p>
<p>@ManyToOne<br />
@JoinColumn(&#8220;product&#8221;)<br />
private Product product;</p>
<p>Wrong sql statement:<br />
Select pd from priceData pd where pd.product in (100, 200);</p>
</div>
<div>Right sql statment:<br />
Select pd from priceData pd where pd.product<strong>.id</strong> in (100, 200);</div>
<br />Filed under: <a href='http://nalfeins.wordpress.com/category/software-development/'>Software Development</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nalfeins.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nalfeins.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nalfeins.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nalfeins.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nalfeins.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nalfeins.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nalfeins.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nalfeins.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nalfeins.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nalfeins.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nalfeins.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nalfeins.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nalfeins.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nalfeins.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nalfeins.wordpress.com&amp;blog=6929609&amp;post=29&amp;subd=nalfeins&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nalfeins.wordpress.com/2010/02/18/can-not-set-java-lang-long-field-to-java-lang-long/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/82b85fed9ed0c010a0b633a255d51ea6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nalfein</media:title>
		</media:content>
	</item>
		<item>
		<title>How to set JAAS policy file in J2EE environment</title>
		<link>http://nalfeins.wordpress.com/2009/03/16/how-to-set-jaas-policy-file-in-j2ee-environment/</link>
		<comments>http://nalfeins.wordpress.com/2009/03/16/how-to-set-jaas-policy-file-in-j2ee-environment/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 20:25:33 +0000</pubDate>
		<dc:creator>nalfein</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[J2EE]]></category>
		<category><![CDATA[JAVA]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://nalfeins.wordpress.com/?p=20</guid>
		<description><![CDATA[Problem Normally you set the CATALINA_OPTS with the system properties. But this means you need to change the start script to the server. SET CATALINA_OPTS=-Djava.security.auth.login.config=C:/programs/Tomcat-6.0.16/webapps/MyApp/WEB-INF/myapp.login -Djava.security.auth.policy=D:/programs/Tomcat-6.0.16/webapps/MyApp/WEB-INF/myapp.policy Solution: ServletContext servletContext =  (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext(); System.setProperty(&#8220;java.security.auth.login.config&#8221;, servletContext.getRealPath(&#8220;/WEB-INF/myapp.login&#8221;)); System.setProperty(&#8220;java.security.auth.policy&#8221;, servletContext.getRealPath(&#8220;/WEB-INF/myapp.policy&#8221;)); Beware: The getRealPath method returns NULL if the servlet container cannot translate the virtual path to a real path [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nalfeins.wordpress.com&amp;blog=6929609&amp;post=20&amp;subd=nalfeins&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong></p>
<p>Normally you set the CATALINA_OPTS with the system properties. But this means you need to change the start script to the server.</p>
<p>SET CATALINA_OPTS=-Djava.security.auth.login.config=C:/programs/Tomcat-6.0.16/webapps/MyApp/WEB-INF/myapp.login -Djava.security.auth.policy=D:/programs/Tomcat-6.0.16/webapps/MyApp/WEB-INF/myapp.policy</p>
<p><strong>Solution:</strong></p>
<p>ServletContext servletContext =  (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();</p>
<p>System.setProperty(&#8220;java.security.auth.login.config&#8221;, servletContext.getRealPath(&#8220;/WEB-INF/myapp.login&#8221;));</p>
<p>System.setProperty(&#8220;java.security.auth.policy&#8221;, servletContext.getRealPath(&#8220;/WEB-INF/myapp.policy&#8221;));</p>
<p><strong>Beware:</strong></p>
<p>The getRealPath method returns <code>NULL </code>if the servlet container cannot translate  the virtual path to a real path for any reason (such as when the content is  being made available from a <code>.war</code> archive).</p>
<br />Posted in Software Development  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nalfeins.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nalfeins.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nalfeins.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nalfeins.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nalfeins.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nalfeins.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nalfeins.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nalfeins.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nalfeins.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nalfeins.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nalfeins.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nalfeins.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nalfeins.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nalfeins.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nalfeins.wordpress.com&amp;blog=6929609&amp;post=20&amp;subd=nalfeins&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nalfeins.wordpress.com/2009/03/16/how-to-set-jaas-policy-file-in-j2ee-environment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/82b85fed9ed0c010a0b633a255d51ea6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nalfein</media:title>
		</media:content>
	</item>
		<item>
		<title>Business plan contest</title>
		<link>http://nalfeins.wordpress.com/2009/03/13/business-plan-contest/</link>
		<comments>http://nalfeins.wordpress.com/2009/03/13/business-plan-contest/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 10:21:57 +0000</pubDate>
		<dc:creator>nalfein</dc:creator>
				<category><![CDATA[Founder]]></category>

		<guid isPermaLink="false">http://nalfeins.wordpress.com/?p=15</guid>
		<description><![CDATA[Last year in December I found out that there was a business plan contest in my city. The contest was announced nationwide. Closing date was in the first January week of 2009. So I wrote my business plan in only one month. Not quite a good idea but I had nothing to lose. The business [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nalfeins.wordpress.com&amp;blog=6929609&amp;post=15&amp;subd=nalfeins&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last year in December I found out that there was a business plan contest in my city. The contest was announced <span>nationwide. Closing date was in the first January week of 2009. So I wrote my business plan in only one month. Not quite a good idea but I had nothing to lose. The business plan is checked by bankers, entrepreneurs, venture capitalists and people of the ministry of economics.</span> <span>Now I now that I have not made it into the second round. </span><span>But now I look forward to see what the jurors have to say about my business plan. Because for every business plan that was submitted to the contest a review is written.</span></p>
<p><span>Oh, and I also look forward to the awards show. To see what other projects have ben submitted and to socialise with other founders.<br />
</span></p>
<br />Posted in Founder  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nalfeins.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nalfeins.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nalfeins.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nalfeins.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nalfeins.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nalfeins.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nalfeins.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nalfeins.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nalfeins.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nalfeins.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nalfeins.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nalfeins.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nalfeins.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nalfeins.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nalfeins.wordpress.com&amp;blog=6929609&amp;post=15&amp;subd=nalfeins&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nalfeins.wordpress.com/2009/03/13/business-plan-contest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/82b85fed9ed0c010a0b633a255d51ea6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nalfein</media:title>
		</media:content>
	</item>
		<item>
		<title>Welcome to my blog!</title>
		<link>http://nalfeins.wordpress.com/2009/03/12/hello-world/</link>
		<comments>http://nalfeins.wordpress.com/2009/03/12/hello-world/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 13:21:47 +0000</pubDate>
		<dc:creator>nalfein</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I welcome you to my blog. This is my first post and I hope a thousand more will follow. For now my blog consists of four main topics: Software Development contains Patterns, Examples, Solutions and Tutorials which I think can help any developer. Founder contains information about my way to become a successful entrepreneur. Urban [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nalfeins.wordpress.com&amp;blog=6929609&amp;post=1&amp;subd=nalfeins&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I welcome you to my blog. This is my first post and I hope a thousand more will follow. For now my blog consists of four main topics:</p>
<ul>
<li><strong>Software Development</strong> contains Patterns, Examples, Solutions and Tutorials which I think can help any developer.</li>
<li><strong>Founder</strong> contains information about my way to become a successful entrepreneur.</li>
<li><strong>Urban living</strong> contains humorously and pondering posts about my thoughts  and occurrences I see during my day.</li>
<li><strong>Miscellaneous</strong> contains post that does not fit into the other topics. Just like this one <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </li>
</ul>
<p>I hope you enjoy it,</p>
<p>with kind regards</p>
<p>Nalfein</p>
<br />Posted in Miscellaneous  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nalfeins.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nalfeins.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nalfeins.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nalfeins.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nalfeins.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nalfeins.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nalfeins.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nalfeins.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nalfeins.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nalfeins.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nalfeins.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nalfeins.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nalfeins.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nalfeins.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nalfeins.wordpress.com&amp;blog=6929609&amp;post=1&amp;subd=nalfeins&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nalfeins.wordpress.com/2009/03/12/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/82b85fed9ed0c010a0b633a255d51ea6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nalfein</media:title>
		</media:content>
	</item>
	</channel>
</rss>
