<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2" -->
<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/"
	>

<channel>
	<title>Absolutely no idea</title>
	<link>http://alweb.homeip.net/dw0rm/dblog</link>
	<description>Blog by Lukas Rossa</description>
	<pubDate>Wed, 11 Nov 2009 21:47:35 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2</generator>
	<language>en</language>
			<item>
		<title>Generating polymorphic classes from XSD using JAXB 1.2</title>
		<link>http://alweb.homeip.net/dw0rm/dblog/?p=80</link>
		<comments>http://alweb.homeip.net/dw0rm/dblog/?p=80#comments</comments>
		<pubDate>Wed, 11 Nov 2009 20:23:55 +0000</pubDate>
		<dc:creator>lukas</dc:creator>
		
		<category><![CDATA[xml]]></category>

		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://alweb.homeip.net/dw0rm/dblog/?p=80</guid>
		<description><![CDATA[JAXB 1.x DOES support the xsd extension syntax for polymorphism in schema. JAXB 2 supports this build-in but for JAXB 1 some customisation is required through the use of the type substitution vendor extension.
Either jump straight to relevant Sun documentation:
http://java.sun.com/webservices/docs/1.4/jaxb/vendorCustomizations.html#typesub
and
http://java.sun.com/webservices/docs/1.4/jaxb/vendorSchemaLangs.html#typesub
Or follow this to get up and running in no time:
We&#8217;re basically looking for a way [...]]]></description>
			<content:encoded><![CDATA[<p>JAXB 1.x DOES support the xsd extension syntax for polymorphism in schema. JAXB 2 supports this build-in but for JAXB 1 some customisation is required through the use of the type substitution vendor extension.</p>
<p>Either jump straight to relevant Sun documentation:<br />
<a href="http://java.sun.com/webservices/docs/1.4/jaxb/vendorCustomizations.html#typesub">http://java.sun.com/webservices/docs/1.4/jaxb/vendorCustomizations.html#typesub</a><br />
and<br />
<a href="http://java.sun.com/webservices/docs/1.4/jaxb/vendorSchemaLangs.html#typesub">http://java.sun.com/webservices/docs/1.4/jaxb/vendorSchemaLangs.html#typesub</a></p>
<p>Or follow this to get up and running in no time:</p>
<p>We&#8217;re basically looking for a way to correctly generate the corresponding Java inheritance hierarchy for a schema where we have subtypes extending a parent:</p>

<div class="wp_syntax"><div class="code"><pre class="xml">      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:complexType</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;AddressType&quot;</span> <span style="color: #000066;">abstract</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:complexType<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:complexType</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;BusinessAddressType&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
               <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:complexContent<span style="font-weight: bold; color: black;">&gt;</span></span></span>
                       <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:extension</span> <span style="color: #000066;">base</span>=<span style="color: #ff0000;">&quot;AddressType&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
                               <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:sequence<span style="font-weight: bold; color: black;">&gt;</span></span></span>
                                   ...
                               <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:sequence<span style="font-weight: bold; color: black;">&gt;</span></span></span>
                       <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:extension<span style="font-weight: bold; color: black;">&gt;</span></span></span>
               <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:complexContent<span style="font-weight: bold; color: black;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:complexType<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:complexType</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;HomeAddressType&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
               <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:complexContent<span style="font-weight: bold; color: black;">&gt;</span></span></span>
                       <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:extension</span> <span style="color: #000066;">base</span>=<span style="color: #ff0000;">&quot;AddressType&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
                               <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:sequence<span style="font-weight: bold; color: black;">&gt;</span></span></span>
                                     ...
                               <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:sequence<span style="font-weight: bold; color: black;">&gt;</span></span></span>
                       <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:extension<span style="font-weight: bold; color: black;">&gt;</span></span></span>
               <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:complexContent<span style="font-weight: bold; color: black;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:complexType<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p>From the above schema we want AddressType to be generated as an interface and superclass Impl and BusinessAddressType and HomeAddressType should extend that parent interface and the relevant impl classes.</p>
<p>To get this up and running in 5 minutes, assuming your XSD schema is<br />
in place already:<br />
- Hide quoted text -</p>
<p>1. set the &#8220;extension&#8221; option in your Ant xjc target: (Ant task excerpt)</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xjc</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;${src.gen.dir}&quot;</span> <span style="color: #000066;">removeOldoutput</span>=<span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #000066;">extension</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;schema</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${xsd.schemas.dir}&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;schema/**/*.xsd&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/schema<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xjc<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p>2. put the following typeSubstitution.xsd in your schemas directory (or where the above xjc target can access it)</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!--
 Copyright 2004 Sun Microsystems, Inc. All rights reserved.
 SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
--&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xs:schema</span>
  xmlns:xs  =<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span>
  <span style="color: #000066;">xmlns:jaxb</span>=<span style="color: #ff0000;">&quot;http://java.sun.com/xml/ns/jaxb&quot;</span>
  xmlns:xjc =<span style="color: #ff0000;">&quot;http://java.sun.com/xml/ns/jaxb/xjc&quot;</span>
  <span style="color: #000066;">jaxb:extensionBindingPrefixes</span>=<span style="color: #ff0000;">&quot;xjc&quot;</span>
  <span style="color: #000066;">jaxb:version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
&nbsp;
 <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!--
   This schema file is used to enable the type substitution support, so we can use type
   inheritance in schema. It doesn't define any schema definition at all.
   See http://java.sun.com/webservices/docs/1.5/jaxb/vendorSchemaLangs.html#typesub for details.
 --&gt;</span></span>
&nbsp;
 <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xs:annotation<span style="font-weight: bold; color: black;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xs:appinfo<span style="font-weight: bold; color: black;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;jaxb:globalBindings<span style="font-weight: bold; color: black;">&gt;</span></span></span>
             <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xjc:typeSubstitution</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;complex&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
           <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/jaxb:globalBindings<span style="font-weight: bold; color: black;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xs:appinfo<span style="font-weight: bold; color: black;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xs:annotation<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xs:schema<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p>3. Kick-off the xjc Ant task to regenerate your bindings! - that&#8217;s it.<br />
There will be a new file called Table.java generated which maps the QNames of the XSD types to the all classes in the hierarchy - make sure that is included in your source and it should all work fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://alweb.homeip.net/dw0rm/dblog/?feed=rss2&amp;p=80</wfw:commentRss>
		</item>
		<item>
		<title>Hibernate mappings and the XDoclet merge option</title>
		<link>http://alweb.homeip.net/dw0rm/dblog/?p=79</link>
		<comments>http://alweb.homeip.net/dw0rm/dblog/?p=79#comments</comments>
		<pubDate>Mon, 16 Mar 2009 23:56:08 +0000</pubDate>
		<dc:creator>lukas</dc:creator>
		
		<category><![CDATA[hibernate]]></category>

		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://alweb.homeip.net/dw0rm/dblog/?p=79</guid>
		<description><![CDATA[The project I&#8217;m currently working on uses XDoclet 1.2 to generate hibernate mapping and configuration files. Up to now, when our mapping requirements were too complex for XDoclet we would supplement our Java bean hibernate annotations with custom hbm.xml files and include those within an  element inside a  tag of the HibernateDocletTask.
Ant would [...]]]></description>
			<content:encoded><![CDATA[<p>The project I&#8217;m currently working on uses XDoclet 1.2 to generate hibernate mapping and configuration files. Up to now, when our mapping requirements were too complex for XDoclet we would supplement our Java bean hibernate annotations with custom hbm.xml files and include those within an <<em>otherMapping</em>> element inside a <<em>hibernatecfg</em>> tag of the HibernateDocletTask.</p>
<p>Ant would then build most of the hbm.xml files from the bean annotations but also copy the handful of handcoded custom ones into the bin dir.</p>
<p>An improvement on this is to leave most of the hibernate annotations in the bean classes and have HibernateDoclet <strong>merge</strong> only the required mappings into the hibernate mapping files. The definition of the Hibernate XDoclet task is at <a href="http://xdoclet.sourceforge.net/xdoclet/ant/xdoclet/modules/hibernate/HibernateSubTask.html">thislink</a>.</p>
<p>build.xml:</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;xdoclet-generate&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;init&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;generate xdoclet hibernate mappings&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
	   <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- location of xdoclet libraries --&gt;</span></span>	
          <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;path</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;xdoclet.task.classpath&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
	        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${xdoclet.lib.dir}&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
		     <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;*.jar&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
	        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/fileset<span style="font-weight: bold; color: black;">&gt;</span></span></span>
	  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/path<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
	 <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;taskdef</span>
            <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;hibernatedoclet&quot;</span>
            <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;xdoclet.modules.hibernate.HibernateDocletTask&quot;</span>
            <span style="color: #000066;">classpathref</span>=<span style="color: #ff0000;">&quot;xdoclet.task.classpath&quot;</span>
        <span style="font-weight: bold; color: black;">/&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;hibernatedoclet</span>  
		<span style="color: #000066;">destdir</span>=<span style="color: #ff0000;">&quot;${build.classes.dir}&quot;</span>
		<span style="color: #000066;">verbose</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
&nbsp;
                <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- defines the files handled by xdoclet --&gt;</span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${basedir}/src&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
                    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**/*.java&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/fileset<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
                <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- generate the mapping files --&gt;</span></span>
		<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;hibernate</span> 
			<span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;3.0&quot;</span>
			<span style="color: #000066;">validateXML</span>=<span style="color: #ff0000;">&quot;true&quot;</span>
			<span style="color: #000066;">mergeDir</span>=<span style="color: #ff0000;">&quot;${source.dir}&quot;</span>
		<span style="font-weight: bold; color: black;">/&gt;</span></span>
&nbsp;
		<span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- generate hibernate config file --&gt;</span></span>
		<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;hibernatecfg</span> 
			<span style="color: #000066;">destinationFile</span>=<span style="color: #ff0000;">&quot;hibernate.cfg.xml&quot;</span>				
			<span style="color: #000066;">validateXML</span>=<span style="color: #ff0000;">&quot;true&quot;</span>
                        <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;3.0&quot;</span>
			<span style="color: #000066;">transactionManagerFactory</span>=<span style="color: #ff0000;">&quot;org.hibernate.transaction.CMTTransactionFactory&quot;</span>
			<span style="color: #000066;">transactionManagerLookup</span>=<span style="color: #ff0000;">&quot;org.hibernate.transaction.WebSphereExtendedJTATransactionLookup&quot;</span>
			<span style="color: #000066;">dataSource</span>=<span style="color: #ff0000;">&quot;jdbc/schemaName&quot;</span>
			<span style="color: #000066;">showSql</span>=<span style="color: #ff0000;">&quot;true&quot;</span>				
			<span style="color: #000066;">dialect</span>=<span style="color: #ff0000;">&quot;org.hibernate.dialect.DB2Dialect&quot;</span>
                 <span style="font-weight: bold; color: black;">&gt;</span></span>
			<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;otherProperty</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;hibernate.transaction.flush_before_completion&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
			<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;otherProperty</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;hibernate.transaction.auto_close_session&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
			<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;otherMapping</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;resource&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;com/mycompany/domain/model/ComplexDomainObject.hbm.xml&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
			<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;otherMapping</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;resource&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;com/mycompany/domain/model/CommonDefinitions.hbm.xml&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
		<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/hibernatecfg<span style="font-weight: bold; color: black;">&gt;</span></span></span>		
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/hibernatedoclet<span style="font-weight: bold; color: black;">&gt;</span></span></span>		
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/target<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p>Notice how the above task defines a <strong>mergeDir</strong> at the hibernate element level. XDoclet will scan all dirs below this for any custom xml files to be merged into the hibernate mappings. </p>
<ul>
<li><em>hibernate-properties.xml</em> - goes into the root of the mergeDir. Anything in there is included in ALL mapping files.</li>
<li><em>hibernate-properties-{0}.xml</em>  - must be located in a <strong>directory underneath the mergeDir, mirroring the fully qualified package/name of the {0} bean class</strong>. (This is so that two classes from different packages could be mapped correctly). </li>
</ul>
<p>I can now define any mapping not supported with annotations in 1.2 (e.g. a hibernate-filter) in a separate <em>hibernate-properties-{0}.xml</em> file: </p>
<p>hibernate-properties-NotSoSimpleDomainObject.xml:</p>

<div class="wp_syntax"><div class="code"><pre class="xml">    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;filter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;limitByCurrentDataVersionFilter&quot;</span> <span style="color: #000066;">condition</span>=<span style="color: #ff0000;">&quot;:dataVersion = dataversion&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></pre></div></div>

<p>and xdoclet will merge it into the mapping file at build:<br />
NotSoSimpleDomainObject.hbm.xml:</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;hibernate-mapping<span style="font-weight: bold; color: black;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;class</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;com.mycompany.domain.model.NotSoSimpleDomainObject&quot;</span> <span style="color: #000066;">table</span>=<span style="color: #ff0000;">&quot;NOT_SIMPLE_DOMAIN&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;id</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;id&quot;</span> <span style="color: #000066;">column</span>=<span style="color: #ff0000;">&quot;NOT_SIMPLE_DOMAIN_ID&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
         <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;generator</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;identity&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
         <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/generator<span style="font-weight: bold; color: black;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/id<span style="font-weight: bold; color: black;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;codeValue&quot;</span> <span style="color: #000066;">column</span>=<span style="color: #ff0000;">&quot;CODE_VALUE&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;description&quot;</span> <span style="color: #000066;">column</span>=<span style="color: #ff0000;">&quot;VALUE_DESC&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
&nbsp;
      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;filter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;limitByCurrentDataVersionFilter&quot;</span> <span style="color: #000066;">condition</span>=<span style="color: #ff0000;">&quot;:dataVersion = dataversion&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
&nbsp;
   <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/class<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/hibernate-mapping<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p>For completeness sake, remember that you also need a filter definition inside a hibernate-mapping element (this is a global definition so can be anywhere - even in its own mapping file). I import this using the otherMapping element from a <em>CommonDefinitions.hbm.xml</em> in the Ant task above.</p>
<p>CommonDefinitions.hbm.xml:</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;filter-def</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;activatedFilter&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;filter-param</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;activatedParam&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;boolean&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/filter-def<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://alweb.homeip.net/dw0rm/dblog/?feed=rss2&amp;p=79</wfw:commentRss>
		</item>
		<item>
		<title>London - IT job market conditions &#038; job hunting</title>
		<link>http://alweb.homeip.net/dw0rm/dblog/?p=77</link>
		<comments>http://alweb.homeip.net/dw0rm/dblog/?p=77#comments</comments>
		<pubDate>Mon, 29 Dec 2008 18:50:27 +0000</pubDate>
		<dc:creator>lukas</dc:creator>
		
		<category><![CDATA[software development career]]></category>

		<guid isPermaLink="false">http://alweb.homeip.net/dw0rm/dblog/?p=77</guid>
		<description><![CDATA[Job hunting in London was quite different from other places where I have previously looked for a job. The market is huge, there are literally hundreds of companies looking for skilled developers and tens of recruitment agencies ranging from the &#8220;we do it all&#8221; to niche players who specialise in certain technologies, domains or methodologies [...]]]></description>
			<content:encoded><![CDATA[<p>Job hunting in London was quite different from other places where I have previously looked for a job. The market is huge, there are literally hundreds of companies looking for skilled developers and tens of recruitment agencies ranging from the &#8220;we do it all&#8221; to niche players who specialise in certain technologies, domains or methodologies (yep, there are companies who specialise in &#8220;Agile&#8221; <img src='http://alweb.homeip.net/dw0rm/dblog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> I&#8217;d hazard a guess that there are hundreds - if not thousands - of job seekers in IT in London at the moment. </p>
<p>I have been told by various recruitment agents that 12 months ago the majority of the work was contract work but due to the economic crisis there has been a definite shift to permanent / full-time positions and up to 90% of current positions advertised in London are such. The few contract positions still around are mainly (surprisingly) in the investment finance sector - unavailable to most but the most hardcore (real-time Java, Swing, investment finance guru types).<br />
Given the downturn, there are obviously also fewer permanent jobs going around but a few sectors are still hiring if not booming. Having spent about 2 months closely watching job ads and talking to recruiters I have observed a lot of activity in the following:</p>
<ul>
<li>Banking / Finance - a lot of activity - even though thousands have been laid off, the mergers, consolidation &#038; cost cutting initiatives all involve IT systems - many opportunities abound</li>
<li>E-Commerce - retailers are busy improving their on-line presence, upgrading web sites, adding new functionality (so they can shut physical stores to cut costs) - a lot of front-end &#038; e-commerce work</li>
<li>Gambling / Gaming - there seems to be an enourmous amount of activity in this sector here in London at the moment - why do people tend to spend money they don&#8217;t have in a crisis?</li>
<li>Telecoms - most of the major telecoms providers seem to have some roles open at the moment. I found that they require high specialisation (i.e. pigeon-holing - sorry, we need somebody with Webwork and Apache CXF and not Spring MVC and Axis) and unless you match their spec exactly you&#8217;re unlikely to get an interview.</li>
</ul>
<p>Having come from a more consulting type environment where every project used new / different technologies, I think the biggest pain was the focus on specialisation. I am assuming this is a result of such a big market. Several interviews I had focused on one or two technologies (e.g. Hibernate or Spring MVC) and if you didn&#8217;t know it to guru level then you&#8217;re out of luck, regardless of the fact that you&#8217;ve worked with a ton of similar technologies in the past. One of the most idiotic situations I had was when a recruitment agent invited me for a &#8220;chat&#8221; and then handed me a test consisting of 30 questions on the intricacies of Hibernate and Spring xml configuration syntax and told me his clients are looking for Hibernate and Spring professionals.</p>
<p>I used 3 websites to post my CV and look for positions:<br />
<a href="http://www.jobserve.com">http://www.jobserve.com</a>   - best interface &#038; search, lots of jobs<br />
<a href="http://www.jobsite.co.uk">http://www.jobsite.co.uk</a>    - ok interface &#038; search, lots of jobs<br />
<a href="http://www.cwjobs.co.uk">http://www.cwjobs.co.uk</a>    - crap interface &#038; very bad search functionality but contains lots of contract opportunities</p>
<p>There is also <a href="http://www.monster.co.uk">http://www.monster.co.uk</a> but this site is badly organised, user unfriendly and has few IT opportunities compared to the others and apart from posting my CV on it I have not bothered with it.</p>
<p>Last minute tips:</p>
<ol>
<li>CV should be short and tailored to position - for the London market the CV should not be more than 4 pages!</li>
<li>Refresh your knowledge - prepare before you start interviewing - if you haven&#8217;t coded in a while, fire up your IDE and write some code</li>
<li>Once you start looking - be ready to be technically tested anytime</li>
<li>Keep track of who you talk to and which companies you get forwarded to - with so many agents it&#8217;s very easy to have the same position presented by multiple agencies</li>
<li>Figure out how far you want to commute - there are many large IT companies in Greater London or within 50km of London (e.g. Reading). Find out whether you are close to a rail link - the trains are more reliable than the tube. (It makes more sense to first find a job and then an apartment)</li>
<li>Update your CV once a week and refresh it on the job sites - this way it will stay &#8220;current&#8221; on the site and more noticable to agents</li>
<li>Follow-up all applications with a phone call - the recruiters get swamped by applications for every job - make yourself stand out from the crowd by having a conversation with them about the position</li>
<li>Get a good internet connection - Initially I was able to cheaply share a <a href="http://www.fon.com">FON connection</a> but hotspots are few and far between in London. Unlike Canada there are very few coffee shops offering unlimited internet and you will usually have to pay for getting online as there aren&#8217;t many other options for when you&#8217;ve just arrived..
</ol>
<p>Looking for a job is a full-time job in itself so don&#8217;t get discouraged and let me know how it goes.<br />
Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://alweb.homeip.net/dw0rm/dblog/?feed=rss2&amp;p=77</wfw:commentRss>
		</item>
		<item>
		<title>Back on-line from London!</title>
		<link>http://alweb.homeip.net/dw0rm/dblog/?p=78</link>
		<comments>http://alweb.homeip.net/dw0rm/dblog/?p=78#comments</comments>
		<pubDate>Mon, 29 Dec 2008 18:38:55 +0000</pubDate>
		<dc:creator>lukas</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://alweb.homeip.net/dw0rm/dblog/?p=78</guid>
		<description><![CDATA[First post since we&#8217;ve crossed the ocean to come and live and work in London. The timing was pretty dreadful - recession headlines everywhere, companies going bankrupt left right and centre and thousands of workers being laid off. All of this just added to the usual stresses associated with moving countries like finding an apartment, [...]]]></description>
			<content:encoded><![CDATA[<p>First post since we&#8217;ve crossed the ocean to come and live and work in London. The timing was pretty dreadful - recession headlines everywhere, companies going bankrupt left right and centre and thousands of workers being laid off. All of this just added to the usual stresses associated with moving countries like finding an apartment, setting up bank accounts (arguably more difficult than finding a job in the current climate) and generally getting used to the new locality (I am still overwhelmed by how crowded London and Europe are).</p>
<p>The last few months have been tough and stressful - the move itself, getting used to London, getting used to how crowded Europe and London are, the job hunt, finding an apartment, getting a bank account, etc. No matter how many times you&#8217;ve been through it all it&#8217;s still a pain in the b.. </p>
<p>It looks like we&#8217;re slowly settling in though. We have an apartment, we both landed great jobs and we&#8217;ve even had our first holiday over on the continent - snowboarding in Italy&#8217;s South Tyrol. </p>
<p>Bring on the New Year!</p>
]]></content:encoded>
			<wfw:commentRss>http://alweb.homeip.net/dw0rm/dblog/?feed=rss2&amp;p=78</wfw:commentRss>
		</item>
		<item>
		<title>Still on the road&#8230;</title>
		<link>http://alweb.homeip.net/dw0rm/dblog/?p=76</link>
		<comments>http://alweb.homeip.net/dw0rm/dblog/?p=76#comments</comments>
		<pubDate>Mon, 08 Sep 2008 04:54:47 +0000</pubDate>
		<dc:creator>lukas</dc:creator>
		
		<category><![CDATA[holidays]]></category>

		<guid isPermaLink="false">http://alweb.homeip.net/dw0rm/dblog/?p=76</guid>
		<description><![CDATA[If you&#8217;re wondering why I haven&#8217;t posted in a while it&#8217;s because in the last two months I haven&#8217;t been near a computer long enough to write an email let alone put together a technical blog post. 
Our stay in Vancouver has come to an end. My wife and I have decided not to extend [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re wondering why I haven&#8217;t posted in a while it&#8217;s because in the last two months I haven&#8217;t been near a computer long enough to write an email let alone put together a technical blog post. </p>
<p>Our stay in Vancouver has come to an end. My wife and I have decided not to extend our Canadian working holiday Visas and so have to finish our stay in North America. We have quit our jobs and are finally doing some traveling across this vast and beautiful continent. In the last couple of months we have been to some wonderful places - first to the far north, past the Arctic Circle to Yukon and Alaska and now we are finishing our road trip of the western US - from Vancouver, BC, through the Sunshine Coast, Vancouver Island, the states of Washington, Oregon, California, Nevada, Utah, Idaho, Wyoming and now Montana. We&#8217;re slowly making our way back to Vancouver where we&#8217;ll say good-bye to our friends and then get on a plane to Europe to start a new leg of our overseas adventure in October. </p>
<p>I haven&#8217;t gone, I&#8217;m still here, just busy doing something else that&#8217;s on my TODO list, that&#8217;s all. I&#8217;ll tick that off and I&#8217;ll be back soon enough. See you then.</p>
]]></content:encoded>
			<wfw:commentRss>http://alweb.homeip.net/dw0rm/dblog/?feed=rss2&amp;p=76</wfw:commentRss>
		</item>
	</channel>
</rss>
