<?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>Next Presso &#187; Java</title>
	<atom:link href="http://www.next-presso.fr/category/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.next-presso.fr</link>
	<description>Java, Seam, Spring &#38; co</description>
	<lastBuildDate>Thu, 08 Apr 2010 10:09:31 +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>WTP + M2eclipse + Seam : Maven works !</title>
		<link>http://www.next-presso.fr/2009/06/wtp-m2eclipse-seam-cest-bien-maven/</link>
		<comments>http://www.next-presso.fr/2009/06/wtp-m2eclipse-seam-cest-bien-maven/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 16:19:10 +0000</pubDate>
		<dc:creator>Antoine Sabot-Durand</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Outil]]></category>
		<category><![CDATA[Tutoriel]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[m2eclipse]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Seam]]></category>

		<guid isPermaLink="false">http://www.next-presso.fr/?p=167</guid>
		<description><![CDATA[<p>
Lucky me ! It&#8217;s only now that I need that one of my Seam project works with Eclipse WTP and Maven. Lucky because a few months ago, that tutorial would have been impossible to write. This article will show how to adapt a JEE5 project in order to make it usable with Eclipse WTP and [...]]]></description>
			<content:encoded><![CDATA[<p>
Lucky me ! It&#8217;s only now that I need that one of my Seam project works with Eclipse WTP and Maven. Lucky because a few months ago, that tutorial would have been impossible to write. This article will show how to adapt a JEE5 project in order to make it usable with Eclipse WTP and Maven.
</p>
<p><span id="more-167"></span></p>
<h3>Starting the tutorial</h3>
<p>We start this tutorial with 3 Eclipse projects : an EAR, an EJB and a WAR project. These projects are showed in the following picture</p>
<p style="text-align: center;"><img class="size-full wp-image-204" title="figure1" src="http://www.next-presso.fr/wp-content/uploads/2009/06/figure1.png" alt="figure 1 : les trois projets sous Eclipse et WTP" width="235" height="168" /></p>
<p>
The 3 projects are linked with the Eclipse configuration files which contains informations about EAR, EJB and WAR projects. In this article the projects are based on JBoss Seam, but all the tutorial could be used in any project type.
</p>
<p>On the disk, the 3 projects are 3 directories in the workspace folders. Useless to say it&#8217;s not the Maven way to organize projects.</p>
<h4>Creation of the parent Project</h4>
<p>First step, we create a Maven parent project which will contain our EAR, EJB and WAR projects (that Maven call modules). In this parent project we can define global parameters for the modules. To create this project click on &#8220;File/New/Porject&#8230;&#8221;</p>
<p style="text-align: center;"><img class="size-medium wp-image-212 aligncenter" title="ChooseMavenProject" src="http://www.next-presso.fr/wp-content/uploads/2009/06/Image-11-300x285.png" alt="ChooseMavenProject" width="300" height="285" /></p>
<p>Choose Maven Project in the Maven category and click on Next, this opens the &#8220;New Maven Project&#8221; wizard :</p>
<p style="text-align: center;"><img class="size-medium wp-image-213 aligncenter" title="New Maven Project 1" src="http://www.next-presso.fr/wp-content/uploads/2009/06/Image-2-300x298.png" alt="New Maven Project 1" width="300" height="298" /></p>
<p>You can go to the next step after checking that &#8220;Create a simple project&#8221; is unchecked.</p>
<p style="text-align: center;"><img class="size-medium wp-image-214 aligncenter" title="Choose Archetype" src="http://www.next-presso.fr/wp-content/uploads/2009/06/Image-3-300x254.png" alt="Choose Archetype" width="300" height="254" /></p>
<p>In this dialog box you have to choose an archetype (a template for your project). In Catalog choose Nexus Indexer which brings a richer list than the internal default one. In the filter field enter &#8220;pom&#8221; to reach the &#8220;pom-root&#8221; archetype&#8221;. Select it and click on &#8220;Next&#8221;.</p>
<p style="text-align: center;"><img class="alignnone size-medium wp-image-217" title="Maven Project Name" src="http://www.next-presso.fr/wp-content/uploads/2009/06/Image-4-300x252.png" alt="Maven Project Name" width="300" height="252" /></p>
<p>In this last dialog box you choose the project name. click on &#8220;Finish&#8221;. Now you have a new project in your workspace. In my case it&#8217;s &#8220;pfm77-parent&#8221;</p>
<h4>Creating the Maven modules</h4>
<p>In the same way we created parent project, we&#8217;re going to create the children projects or modules. click on &#8220;File/New/Project&#8230;&#8221;</p>
<p style="text-align: center;"><img class="size-medium wp-image-211 aligncenter" title="Choose Maven Module" src="http://www.next-presso.fr/wp-content/uploads/2009/06/Image-1-300x283.png" alt="Choose Maven Module" width="300" height="283" /></p>
<p>Choose &#8220;Maven Module&#8221; then click on &#8220;Next&#8221;. A new wizard opens :</p>
<p style="text-align: center;"><img class="size-medium wp-image-219 aligncenter" title="create ear module" src="http://www.next-presso.fr/wp-content/uploads/2009/06/Image-5-300x204.png" alt="create ear module" width="300" height="204" /></p>
<p>Enter the name for the EAR module and the name of the parent project then click on &#8220;Next.</p>
<p style="text-align: center;"><img class="size-medium wp-image-220 aligncenter" title="Archetype EAR" src="http://www.next-presso.fr/wp-content/uploads/2009/06/Image-6-300x253.png" alt="Archetype EAR" width="300" height="253" /></p>
<p>Don&#8217;t forget to choose &#8220;Nexus Indexer&#8221; in the catalog, enter &#8220;ear&#8221; in the filter field. Choose the &#8220;ear-jee5&#8243; archetype then click on &#8220;finish&#8221;</p>
<p>To create the EJB and WAR modules, we&#8217;ll use the same wizard choosing archetypes &#8220;ejb-jee5&#8243; and &#8220;webapp-jee5&#8243;.</p>
<p>After all those wizards and clicks, we have 4 new projects in the workspace :</p>
<p style="text-align: center;"><img class="size-medium wp-image-221 aligncenter" title="projets maven créés" src="http://www.next-presso.fr/wp-content/uploads/2009/06/Image-7-300x285.png" alt="projets maven créés" width="300" height="285" /></p>
<p />
<p>The physical structure of these Eclipse projects are different. If you look on your disk, you&#8217;ll see a Maven hierarchy (a main project and modules in in the folder of the main project). It&#8217;s one of the m2eclipse benefits : supporting sub-projects in Eclipse. But it&#8217;s not the only advantage of the plugin.</p>
<h4>Benefits of m2eclipse</h4>
<h5>1) Managing sub-projects in Eclipse</h5>
<p>As we saw, you can have a Maven hierarchy that m2eclipse make look likes different Eclipse project in the IDE. This also works when you import existing maven project in the worskpace from the disk or versioning system.</p>
<h5>2) Managing Maven dependencies</h5>
<p>The plugin use the pom.xml files to download and add jar files in your project.</p>
<h5>3) Maven build in Eclipse</h5>
<p>The least we can wait for this plugin. A m2eclipse project has 2 builders : the standard Eclipse one and the maven one.</p>
<h5>4) A nice user interface to manage pom.xml files</h5>
<p>You can use this interface to look for dependencies or exclude a sub-dependency easily. It was rather bugy in the past but with version 0.99 of m2eclipse it starts to be very usefull.</p>
<h5>5) Automatic management of Eclipse projects configuration</h5>
<p>That&#8217;s an important benefit that is not very well documented on m2eclipse site. M2eclipse uses pom.xml information to generate and maintain Eclipse configuration files for the project. For instance the projects we just created are not Eclipse project. They were created from Maven Archetypes that have nothing to do with Eclipse. So the eclipse configuration files of these new project (.classpath, .project files and .settings folder) were generated by m2eclipse from the pom files. When pom files are modified, m2eclipse will change Eclipse configuration files automatically. For instance, let&#8217;s have a look at the Facets of the EJB project (right-click on the project, and choose properties/facets) :</p>
<p style="text-align: center;"><img class="size-full wp-image-222 aligncenter" title="project facets" src="http://www.next-presso.fr/wp-content/uploads/2009/06/Image-9.png" alt="project facets" width="753" height="308" /></p>
<p>M2eclipse have added this EJB3 facets by analyzing the pom.xml file. So if you change Eclipse configuration on the project there can be some chance that you touch a configuration driven by m2eclipse. So take care of your modification. To be sure you won&#8217;t go battle wth m2eclipse in the configuration you should check the <a href="http://docs.codehaus.org/display/M2ECLIPSE/Integration+with+WTP" target="_blank">m2eclipse documentation</a>. This page show all the Maven parameters (with green checkboxes) that are used by m2eclipse to build and maintain Eclipse WTP configuration files.</p>
<p>To finish with this point, you&#8217;ll have to be extremely carrefull when you put those project under versioning system. The best solution is to ignore Eclipse configuration files and let m2eclipse do the job on the other systems (you&#8217;ll have to create local configuration on each IDE to configure information that are not in Maven files like deploying servers for instance).</p>
<h4>Copying Files</h4>
<p>Let&#8217;s go back to our tutorial : moving WTP projects to maven/WTP projects. The next step consist to copy files from our old WTP project to the newly created Maven/WTP projects. You can do this by dragging files from file system (Explorer, Finder, or whatever you use) to Eclipse using the &#8220;resources&#8221; perspective which is the more close to filesystem perspective. To keep it simple try to stick with the <a href="http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html" target="_blank">default Maven layout</a>, It will make pom files lighter.</p>
<ul>
<li style="list-style: none"></li>
<li>For the EAR module you&#8217;ll put  the content of META-INF in src/main/application/META-INF all the other files in te project will be  build from pom.xml</li>
<li>For the EJB module, all your classes should be put in src/main/java, resources files like properties or META-INF folder should be in src/main/resources.</li>
<li>For the WAR module you&#8217;ll use the same folders as EJB for classes and resources. The site files will be copied in src/main/webapp folder (be carefull and don&#8217;t take the WEB-INF/lib folder)</li>
</ul>
<p>
You should ignore Manifest files in all the project because they can cause runtime errors.</p>
<p>Now we have to deal with our pom files</p>
<h4>Pom pom pom pom</h4>
<p>It&#8217;s not a symphony but almost (sorry for that). The setting of our 4 pom.xml files will ask some patience (it&#8217;s the Maven feng-shui side) but we will get trough.</p>
<h4>Parent project</h4>
<p>I won&#8217;t detail all my pom.xml files content : I want to keep my readers till the end. Instead I&#8217;ll show you the result and comment the main part of each file</p>
<ul>
<li style="list-style: none"></li>
<li>Introduction : here I tell Maven that it is a pom project that drive construction of sub-projects (modules).</li>
<li>modules : here are the modules contained by this parent project.</li>
<li>properties : here I define variables that will be used in configuration of all the modules (libraries version for instance)</li>
<li>repositories : in this section I add Maven repositories used by my project. For me it&#8217;s JBoss repositories for Seam and java.net to get all Jee5 dependencies</li>
<li>dependencyManagement : In this part, I declare all the dependencies used by my modules. Declaring them here, I can set their version once for all.</li>
<li>build : in this final section I can set up compilation configuration once for all.</li>
</ul>
<p> </p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;cos&lt;/groupId&gt;
  &lt;artifactId&gt;pfm77-parent&lt;/artifactId&gt;
  &lt;packaging&gt;pom&lt;/packaging&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;pfm77-parent Multi Project&lt;/name&gt;
  &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  &lt;modules&gt;
    &lt;module&gt;pfm77-ear&lt;/module&gt;
    &lt;module&gt;pfm77-ejb&lt;/module&gt;
    &lt;module&gt;pfm77-war&lt;/module&gt;
  &lt;/modules&gt;

  &lt;properties&gt;
    &lt;seam.version&gt;2.0.3.CR1&lt;/seam.version&gt;
    &lt;jsf.version&gt;1.2_10&lt;/jsf.version&gt;
    &lt;richfaces.version&gt;3.2.1.GA&lt;/richfaces.version&gt;
  &lt;/properties&gt;

  &lt;repositories&gt;
    &lt;repository&gt;
      &lt;id&gt;jboss&lt;/id&gt;
      &lt;name&gt;JBoss Repository&lt;/name&gt;
      &lt;url&gt;http://repository.jboss.org/maven2&lt;/url&gt;
      &lt;snapshots&gt;
        &lt;enabled&gt;false&lt;/enabled&gt;
      &lt;/snapshots&gt;
    &lt;/repository&gt;
    &lt;repository&gt;
      &lt;id&gt;jboss-snapshots&lt;/id&gt;
      &lt;name&gt;JBoss Snapshot Repository&lt;/name&gt;
      &lt;url&gt;http://snapshots.jboss.org/maven2&lt;/url&gt;
      &lt;releases&gt;
        &lt;enabled&gt;false&lt;/enabled&gt;
      &lt;/releases&gt;
      &lt;snapshots&gt;
        &lt;enabled&gt;true&lt;/enabled&gt;
      &lt;/snapshots&gt;
    &lt;/repository&gt;
    &lt;repository&gt;
          &lt;id&gt;java.net1&lt;/id&gt;
          &lt;name&gt;Java.Net Maven1 Repository, hosts the javaee-api dependency&lt;/name&gt;
          &lt;url&gt;http://download.java.net/maven/1&lt;/url&gt;
          &lt;layout&gt;legacy&lt;/layout&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;

 &lt;dependencyManagement&gt;
 &lt;dependencies&gt;

  &lt;dependency&gt;
      &lt;groupId&gt;commons-beanutils&lt;/groupId&gt;
      &lt;artifactId&gt;commons-beanutils&lt;/artifactId&gt;
      &lt;version&gt;1.8.0&lt;/version&gt;
      &lt;scope&gt;compile&lt;/scope&gt;
       &lt;/dependency&gt;
        &lt;dependency&gt;
      &lt;groupId&gt;org.ostermiller&lt;/groupId&gt;
      &lt;artifactId&gt;utils&lt;/artifactId&gt;
      &lt;version&gt;1.07.00&lt;/version&gt;
      &lt;scope&gt;compile&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;/dependencies&gt;
 &lt;/dependencyManagement&gt;

  &lt;build&gt;
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
        &lt;configuration&gt;
          &lt;source&gt;1.5&lt;/source&gt;
          &lt;target&gt;1.5&lt;/target&gt;
        &lt;/configuration&gt;
      &lt;/plugin&gt;

    &lt;/plugins&gt;
  &lt;/build&gt;

&lt;/project&gt;
</pre>
<p></p>
<h4>EAR project</h4>
<p>In the pom file, we can get rid of compilation plug-in because we configured it in the parent project. But we&#8217;ll have to add all the depending jars and their version. The m2eclipse auto-completion tools are very usefull for this. Right-click on the project and choose &#8220;Maven/add Maven dependency&#8221;. The following dialog box opens  </p>
<p style="text-align: center;"><img class="alignnone size-medium wp-image-252" title="Image 10" src="http://www.next-presso.fr/wp-content/uploads/2009/06/Image-10-300x263.png" alt="Image 10" width="300" height="263" /></p>
<p>With this box you can search in Maven repositories the right jar and version for your project and add it the pom.xml file. With time some sub-depencies can appear in the project. You can exclude them by using the &#8220;Dependency graph&#8221; in pom editor. This view show a graph like this one : </p>
<p style="text-align: center;"><img class="size-full wp-image-253 aligncenter" title="dependency graph" src="http://www.next-presso.fr/wp-content/uploads/2009/06/Image-111.png" alt="dependency graph" width="858" height="248" /></p>
<p>If yo want to exclude a jar you can do it via the context menu and choosing &#8220;Exclude Maven Artefact&#8230;&#8221; (wasn&#8217;t working in version 0.98 of m2eclipse). Now, back to our pom file of EAR module here are its content</p>
<ul>
<li>header : I specify that it&#8217;s an EAR module and I don&#8217;t forget to point to the Parent project</li>
<li>In the dependencies I don&#8217;t forget EJB and War modules</li>
<li>In the build section I add the Maven EAR plugin. In the configuration of the plugin I give the directory where to put the lib and ask Maven to generate my application.xml file</li>
<li>In the modules section of the plugin, I add my EJB and WAR modules that I defined at the beginning of the file as dependencies</li>
</ul>
<p></p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;parent&gt;
    &lt;artifactId&gt;pfm77-parent&lt;/artifactId&gt;
    &lt;groupId&gt;cos&lt;/groupId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;/parent&gt;
  &lt;groupId&gt;cos&lt;/groupId&gt;
  &lt;artifactId&gt;pfm77-ear&lt;/artifactId&gt;
  &lt;packaging&gt;ear&lt;/packaging&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;pfm77-ear JEE5 Assembly&lt;/name&gt;
  &lt;url&gt;http://maven.apache.org&lt;/url&gt;

  &lt;dependencies&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;cos&lt;/groupId&gt;
      &lt;artifactId&gt;pfm77-ejb&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;type&gt;ejb&lt;/type&gt;
      &lt;scope&gt;compile&lt;/scope&gt;

    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;cos&lt;/groupId&gt;
      &lt;artifactId&gt;pfm77-war&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;type&gt;war&lt;/type&gt;
      &lt;scope&gt;compile&lt;/scope&gt;

    &lt;/dependency&gt;

    &lt;dependency&gt;
      &lt;groupId&gt;org.jboss.seam&lt;/groupId&gt;
      &lt;artifactId&gt;jboss-seam&lt;/artifactId&gt;
      &lt;version&gt;${seam.version}&lt;/version&gt;
      &lt;type&gt;ejb&lt;/type&gt;
      &lt;scope&gt;compile&lt;/scope&gt;
      &lt;exclusions&gt;
        &lt;exclusion&gt;
          &lt;groupId&gt;javax.el&lt;/groupId&gt;
          &lt;artifactId&gt;el-api&lt;/artifactId&gt;
        &lt;/exclusion&gt;
        &lt;exclusion&gt;
          &lt;artifactId&gt;javassist&lt;/artifactId&gt;
          &lt;groupId&gt;javassist&lt;/groupId&gt;
        &lt;/exclusion&gt;
        &lt;exclusion&gt;
          &lt;artifactId&gt;dom4j&lt;/artifactId&gt;
          &lt;groupId&gt;dom4j&lt;/groupId&gt;
        &lt;/exclusion&gt;
      &lt;/exclusions&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
      &lt;groupId&gt;org.ostermiller&lt;/groupId&gt;
      &lt;artifactId&gt;utils&lt;/artifactId&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
      &lt;groupId&gt;org.richfaces.framework&lt;/groupId&gt;
      &lt;artifactId&gt;richfaces-api&lt;/artifactId&gt;
      &lt;version&gt;${richfaces.version}&lt;/version&gt;
      &lt;scope&gt;compile&lt;/scope&gt;
      &lt;exclusions&gt;
        &lt;exclusion&gt;
          &lt;artifactId&gt;commons-collections&lt;/artifactId&gt;
          &lt;groupId&gt;commons-collections&lt;/groupId&gt;
        &lt;/exclusion&gt;
        &lt;exclusion&gt;
          &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
          &lt;groupId&gt;commons-logging&lt;/groupId&gt;
        &lt;/exclusion&gt;
      &lt;/exclusions&gt;
    &lt;/dependency&gt;

  &lt;/dependencies&gt;

  &lt;build&gt;
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-ear-plugin&lt;/artifactId&gt;
        &lt;version&gt;2.3.2&lt;/version&gt;
        &lt;configuration&gt;
          &lt;version&gt;5&lt;/version&gt;
          &lt;defaultLibBundleDir&gt;lib&lt;/defaultLibBundleDir&gt;
          &lt;generateApplicationXml&gt;true&lt;/generateApplicationXml&gt;

          &lt;modules&gt;
            &lt;ejbModule&gt;
              &lt;groupId&gt;cos&lt;/groupId&gt;
              &lt;artifactId&gt;pfm77-ejb&lt;/artifactId&gt;
            &lt;/ejbModule&gt;
            &lt;ejbModule&gt;
              &lt;groupId&gt;org.jboss.seam&lt;/groupId&gt;
              &lt;artifactId&gt;jboss-seam&lt;/artifactId&gt;
            &lt;/ejbModule&gt;
            &lt;webModule&gt;
              &lt;groupId&gt;cos&lt;/groupId&gt;
              &lt;artifactId&gt;pfm77-war&lt;/artifactId&gt;
              &lt;contextRoot&gt;PFM77&lt;/contextRoot&gt;
            &lt;/webModule&gt;
          &lt;/modules&gt;

        &lt;/configuration&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
    &lt;finalName&gt;pfm77-ear&lt;/finalName&gt;
  &lt;/build&gt;

&lt;/project&gt;
</pre>
<p></p>
<h4>EJB project</h4>
<p>Next step the EJB pom file. Not a lot of things to say about it except concerning the Maven EJB plugin which is used to set the EJB version.</p>
<p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;parent&gt;
    &lt;artifactId&gt;pfm77-parent&lt;/artifactId&gt;
    &lt;groupId&gt;cos&lt;/groupId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;/parent&gt;
  &lt;groupId&gt;cos&lt;/groupId&gt;
  &lt;artifactId&gt;pfm77-ejb&lt;/artifactId&gt;
  &lt;packaging&gt;ejb&lt;/packaging&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;pfm77-ejb JEE5 EJB&lt;/name&gt;
  &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  &lt;dependencies&gt;

    &lt;dependency&gt;
      &lt;groupId&gt;javaee&lt;/groupId&gt;
      &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
      &lt;version&gt;5&lt;/version&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
      &lt;groupId&gt;junit&lt;/groupId&gt;
      &lt;artifactId&gt;junit&lt;/artifactId&gt;
      &lt;version&gt;3.8.1&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;org.jboss.seam&lt;/groupId&gt;
      &lt;artifactId&gt;jboss-seam&lt;/artifactId&gt;
      &lt;version&gt;${seam.version}&lt;/version&gt;
      &lt;scope&gt;provided&lt;/scope&gt;

    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
      &lt;artifactId&gt;hibernate-annotations&lt;/artifactId&gt;
      &lt;version&gt;3.2.0.ga&lt;/version&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;commons-beanutils&lt;/groupId&gt;
      &lt;artifactId&gt;commons-beanutils&lt;/artifactId&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;org.ostermiller&lt;/groupId&gt;
      &lt;artifactId&gt;utils&lt;/artifactId&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
    	&lt;groupId&gt;mysql&lt;/groupId&gt;
    	&lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
    	&lt;version&gt;5.1.6&lt;/version&gt;
    	&lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;
  &lt;/dependencies&gt;

  &lt;build&gt;
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-ejb-plugin&lt;/artifactId&gt;
        &lt;version&gt;2.1&lt;/version&gt;
        &lt;configuration&gt;
          &lt;ejbVersion&gt;3.0&lt;/ejbVersion&gt;

        &lt;/configuration&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
    &lt;finalName&gt;pfm77-ejb&lt;/finalName&gt;
  &lt;/build&gt;
&lt;/project&gt;
</pre>
<p></p>
<h4>WAR project</h4>
<p>Last but not least the WAR pom file. Notice that we&#8217;re not using Maven war plugin in this pom file, the default values of War packaging are enough.</p>
<p></p>
<p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;parent&gt;
    &lt;artifactId&gt;pfm77-parent&lt;/artifactId&gt;
    &lt;groupId&gt;cos&lt;/groupId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;/parent&gt;
  &lt;groupId&gt;cos&lt;/groupId&gt;
  &lt;artifactId&gt;pfm77-war&lt;/artifactId&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;pfm77-war JEE5 Webapp&lt;/name&gt;
  &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  &lt;dependencies&gt;

    &lt;dependency&gt;
      &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
      &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
      &lt;version&gt;2.5&lt;/version&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
      &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;
      &lt;artifactId&gt;jsp-api&lt;/artifactId&gt;
      &lt;version&gt;2.1&lt;/version&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
      &lt;groupId&gt;junit&lt;/groupId&gt;
      &lt;artifactId&gt;junit&lt;/artifactId&gt;
      &lt;version&gt;3.8.1&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
      &lt;groupId&gt;org.jboss.seam&lt;/groupId&gt;
      &lt;artifactId&gt;jboss-seam-ui&lt;/artifactId&gt;
      &lt;version&gt;${seam.version}&lt;/version&gt;
      &lt;scope&gt;compile&lt;/scope&gt;
      &lt;exclusions&gt;
        &lt;exclusion&gt;
          &lt;groupId&gt;org.jboss.seam&lt;/groupId&gt;
          &lt;artifactId&gt;jboss-seam&lt;/artifactId&gt;
        &lt;/exclusion&gt;
      &lt;/exclusions&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
      &lt;groupId&gt;org.jboss.seam&lt;/groupId&gt;
      &lt;artifactId&gt;jboss-seam-debug&lt;/artifactId&gt;
      &lt;version&gt;${seam.version}&lt;/version&gt;
      &lt;scope&gt;compile&lt;/scope&gt;
      &lt;exclusions&gt;
        &lt;exclusion&gt;
          &lt;groupId&gt;org.jboss.seam&lt;/groupId&gt;
          &lt;artifactId&gt;jboss-seam&lt;/artifactId&gt;
        &lt;/exclusion&gt;
      &lt;/exclusions&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
      &lt;groupId&gt;org.jboss.seam&lt;/groupId&gt;
      &lt;artifactId&gt;jboss-seam-pdf&lt;/artifactId&gt;
      &lt;version&gt;${seam.version}&lt;/version&gt;
      &lt;scope&gt;compile&lt;/scope&gt;
      &lt;exclusions&gt;
        &lt;exclusion&gt;
          &lt;groupId&gt;org.jboss.seam&lt;/groupId&gt;
          &lt;artifactId&gt;jboss-seam&lt;/artifactId&gt;
        &lt;/exclusion&gt;
      &lt;/exclusions&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
      &lt;groupId&gt;org.richfaces.ui&lt;/groupId&gt;
      &lt;artifactId&gt;richfaces-ui&lt;/artifactId&gt;
      &lt;version&gt;${richfaces.version}&lt;/version&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
      &lt;groupId&gt;org.richfaces.framework&lt;/groupId&gt;
      &lt;artifactId&gt;richfaces-impl&lt;/artifactId&gt;
      &lt;version&gt;${richfaces.version}&lt;/version&gt;
      &lt;exclusions&gt;
        &lt;exclusion&gt;
          &lt;groupId&gt;commons-logging&lt;/groupId&gt;
          &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
        &lt;/exclusion&gt;
        &lt;exclusion&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;/exclusion&gt;
        &lt;exclusion&gt;
          &lt;groupId&gt;javax.faces&lt;/groupId&gt;
          &lt;artifactId&gt;jsf-api&lt;/artifactId&gt;
        &lt;/exclusion&gt;
        &lt;exclusion&gt;
          &lt;groupId&gt;org.richfaces.framework&lt;/groupId&gt;
          &lt;artifactId&gt;richfaces-api&lt;/artifactId&gt;
        &lt;/exclusion&gt;
        &lt;exclusion&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
        &lt;/exclusion&gt;
        &lt;exclusion&gt;
          &lt;groupId&gt;javax.faces&lt;/groupId&gt;
          &lt;artifactId&gt;jsf-impl&lt;/artifactId&gt;
        &lt;/exclusion&gt;
      &lt;/exclusions&gt;
    &lt;/dependency&gt;

  &lt;/dependencies&gt;
  &lt;build&gt;

    &lt;finalName&gt;pfm77-war&lt;/finalName&gt;
  &lt;/build&gt;
&lt;/project&gt;
</pre>
<p></p>
<h4>Generating Eclipse configuration</h4>
<p>Now that we have our pom files, we&#8217;ll ask m2eclipse to refresh eclipse config files by accessing the &#8220;Maven/update configuration file&#8221; in the context menu of each project. Doing this refresh .classpath, .project files and .settings folder of our projects.</p>
<h4>First Maven build and first fix</h4>
<p>From the context menu of the parent project (not the EAR), choose &#8220;Run as&#8230;/Maven install&#8221; or &#8220;Maven package&#8221;. Maven is launched but the build fails. Don&#8217;t panic this issue is caused by a conflict in Maven resolution and Workspace resolution. Disable Worksapce resolution in the parent project by choosing  &#8220;Maven/Disable Workspace Resolution&#8221; in contextual menu of the parent project. Launch the build again and &#8220;voila&#8221;. You get an ear file in the target directory of the EAR project. In command line you&#8217;ll have to launch &#8220;mvn install&#8221; from parent project folder to have the same result.</p>
<h4>What about WTP ?</h4>
<p>Before using WTP to deploy your project you&#8217;ll have to copy the application.xml file from the target folder (of the EAR project) to the &#8220;src/main/application/META-INF&#8221; folder and do it again each time EAR modules change (which is not so often). And now ? Beleive it or not but it&#8217;s over and it works. In the server view choose your server (if you don&#8217;t have one you can create a &#8220;local deployer&#8221;). In the contextual menu choose &#8220;Add remove&#8230;&#8221; and add your project.</p>
<p style="text-align: center;"><img class="size-medium wp-image-254 aligncenter" title="Deployment" src="http://www.next-presso.fr/wp-content/uploads/2009/06/Image-12-293x300.png" alt="Deployment" width="293" height="300" /></p>
<p>Then click on &#8220;publih&#8221; and tadaaa, your project is deployed with WTP (if it&#8217;s not, you just have to restart all this tutorial over <img src='http://www.next-presso.fr/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ). The only issue is a WEB-INF directory in the root of the EAR which contains a copy of the lib directory of the good WEB-INF directory of the war module. This problem should be harmless for a local deployment and is caused by this <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=247090" target="_blank">Eclipse bug</a>.</p>
<h4>Conclusion</h4>
<p>So m2eclipse is not working out of the box with WTP project. However it&#8217;s a powerfull tool even without this need. About Seam and Maven, JBoss is working on making developer life more simple. JBoss tools 3.1 should include extensions to <a href="https://jira.jboss.org/jira/browse/JBIDE-3874" target="_blank">ease the work with m2eclipse and Seam</a> and Seam 3.0 should be totally mavenized, so easier to be <a href="http://sfwk.org/Download/SeamDownloads#H-BuildingSeam3" target="_blank">build with Maven</a>.</p>
<p>We&#8217;ll keep an eye on it&#8230;</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.next-presso.fr%2F2009%2F06%2Fwtp-m2eclipse-seam-cest-bien-maven%2F&amp;partner=sociable" title="Print"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.next-presso.fr%2F2009%2F06%2Fwtp-m2eclipse-seam-cest-bien-maven%2F&amp;title=%5Blang_fr%5DWTP%20%2B%20M2eclipse%20%2B%20Seam%20%3A%20c%27est%20bien%20Maven%20%21%5B%2Flang_fr%5D%5Blang_en%5DWTP%20%2B%20M2eclipse%20%2B%20Seam%20%3A%20Maven%20works%20%21%5B%2Flang_en%5D&amp;bodytext=%5Blang_fr%5D%0A%0AOui%20c%27est%20bien%20ma%20veine%20d%27avoir%20eu%20besoin%20qu%27un%20de%20mes%20projets%20Seam%20fonctionne%20%C3%A0%20la%20fois%20sous%20Maven%20et%20Eclipse%20WTP%20seulement%20maintenant%2C%20parce%20que%20tout%20ce%20que%20je%20vais%20d%C3%A9crire%20dans%20cet%20article%20ne%20fonctionnait%20pas%20ou%20tr%C3%A8s%20mal%20il%20y%20a%20encor" title="Digg"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.next-presso.fr%2F2009%2F06%2Fwtp-m2eclipse-seam-cest-bien-maven%2F&amp;title=%5Blang_fr%5DWTP%20%2B%20M2eclipse%20%2B%20Seam%20%3A%20c%27est%20bien%20Maven%20%21%5B%2Flang_fr%5D%5Blang_en%5DWTP%20%2B%20M2eclipse%20%2B%20Seam%20%3A%20Maven%20works%20%21%5B%2Flang_en%5D&amp;notes=%5Blang_fr%5D%0A%0AOui%20c%27est%20bien%20ma%20veine%20d%27avoir%20eu%20besoin%20qu%27un%20de%20mes%20projets%20Seam%20fonctionne%20%C3%A0%20la%20fois%20sous%20Maven%20et%20Eclipse%20WTP%20seulement%20maintenant%2C%20parce%20que%20tout%20ce%20que%20je%20vais%20d%C3%A9crire%20dans%20cet%20article%20ne%20fonctionnait%20pas%20ou%20tr%C3%A8s%20mal%20il%20y%20a%20encor" title="del.icio.us"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.next-presso.fr%2F2009%2F06%2Fwtp-m2eclipse-seam-cest-bien-maven%2F&amp;t=%5Blang_fr%5DWTP%20%2B%20M2eclipse%20%2B%20Seam%20%3A%20c%27est%20bien%20Maven%20%21%5B%2Flang_fr%5D%5Blang_en%5DWTP%20%2B%20M2eclipse%20%2B%20Seam%20%3A%20Maven%20works%20%21%5B%2Flang_en%5D" title="Facebook"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.next-presso.fr%2F2009%2F06%2Fwtp-m2eclipse-seam-cest-bien-maven%2F&amp;title=%5Blang_fr%5DWTP%20%2B%20M2eclipse%20%2B%20Seam%20%3A%20c%27est%20bien%20Maven%20%21%5B%2Flang_fr%5D%5Blang_en%5DWTP%20%2B%20M2eclipse%20%2B%20Seam%20%3A%20Maven%20works%20%21%5B%2Flang_en%5D&amp;annotation=%5Blang_fr%5D%0A%0AOui%20c%27est%20bien%20ma%20veine%20d%27avoir%20eu%20besoin%20qu%27un%20de%20mes%20projets%20Seam%20fonctionne%20%C3%A0%20la%20fois%20sous%20Maven%20et%20Eclipse%20WTP%20seulement%20maintenant%2C%20parce%20que%20tout%20ce%20que%20je%20vais%20d%C3%A9crire%20dans%20cet%20article%20ne%20fonctionnait%20pas%20ou%20tr%C3%A8s%20mal%20il%20y%20a%20encor" title="Google Bookmarks"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.next-presso.fr%2F2009%2F06%2Fwtp-m2eclipse-seam-cest-bien-maven%2F&amp;title=%5Blang_fr%5DWTP%20%2B%20M2eclipse%20%2B%20Seam%20%3A%20c%27est%20bien%20Maven%20%21%5B%2Flang_fr%5D%5Blang_en%5DWTP%20%2B%20M2eclipse%20%2B%20Seam%20%3A%20Maven%20works%20%21%5B%2Flang_en%5D&amp;source=Next+Presso+Java%2C+Seam%2C+Spring+%26amp%3B+co&amp;summary=%5Blang_fr%5D%0A%0AOui%20c%27est%20bien%20ma%20veine%20d%27avoir%20eu%20besoin%20qu%27un%20de%20mes%20projets%20Seam%20fonctionne%20%C3%A0%20la%20fois%20sous%20Maven%20et%20Eclipse%20WTP%20seulement%20maintenant%2C%20parce%20que%20tout%20ce%20que%20je%20vais%20d%C3%A9crire%20dans%20cet%20article%20ne%20fonctionnait%20pas%20ou%20tr%C3%A8s%20mal%20il%20y%20a%20encor" title="LinkedIn"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.netvibes.com/share?title=%5Blang_fr%5DWTP%20%2B%20M2eclipse%20%2B%20Seam%20%3A%20c%27est%20bien%20Maven%20%21%5B%2Flang_fr%5D%5Blang_en%5DWTP%20%2B%20M2eclipse%20%2B%20Seam%20%3A%20Maven%20works%20%21%5B%2Flang_en%5D&amp;url=http%3A%2F%2Fwww.next-presso.fr%2F2009%2F06%2Fwtp-m2eclipse-seam-cest-bien-maven%2F" title="Netvibes"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=%5Blang_fr%5DWTP%20%2B%20M2eclipse%20%2B%20Seam%20%3A%20c%27est%20bien%20Maven%20%21%5B%2Flang_fr%5D%5Blang_en%5DWTP%20%2B%20M2eclipse%20%2B%20Seam%20%3A%20Maven%20works%20%21%5B%2Flang_en%5D%20-%20http%3A%2F%2Fwww.next-presso.fr%2F2009%2F06%2Fwtp-m2eclipse-seam-cest-bien-maven%2F" title="Twitter"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.next-presso.fr/2009/06/wtp-m2eclipse-seam-cest-bien-maven/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Who&#8217;s @In ? who&#8217;s @Out ? Clarification on Seam bijection (part 1)</title>
		<link>http://www.next-presso.fr/2008/10/whos-in-whos-out-clarification-on-seam-bijection/</link>
		<comments>http://www.next-presso.fr/2008/10/whos-in-whos-out-clarification-on-seam-bijection/#comments</comments>
		<pubDate>Sun, 26 Oct 2008 22:13:54 +0000</pubDate>
		<dc:creator>Antoine Sabot-Durand</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Seam]]></category>

		<guid isPermaLink="false">http://www.next-presso.fr/?p=59</guid>
		<description><![CDATA[<p>After reading the article of Chiral Software about @Factory and @Unwrap Seam annotations, I found it could be useful to add some information on Seam bijection from my experience on the subject.

One common mistake with Seam is to be too confident in its &#8220;magic&#8221;.
One of the first traps you can fall in when you start [...]]]></description>
			<content:encoded><![CDATA[<p>After reading the article of <a href="http://chiralsoftware.com/jboss-seam-book/unwrap.seam" target="_blank">Chiral Software</a> about @Factory and @Unwrap Seam annotations, I found it could be useful to add some information on Seam bijection from my experience on the subject.<br />
<!--more--><br />
One common mistake with Seam is to be too confident in its &#8220;magic&#8221;.<br />
One of the first traps you can fall in when you start with Seam is about outjection.</p>
<p>See this code for instance :<br />

<code>@Name("registerHdl")
@Scope(ScopeType.CONVERSATION)
public class RegisterHandler implements Serializable{

        @Out
  private Registrant registrant=new Registrant();

        @Create
        public void create()
        {
        }

}
...

@Entity
public class Registrant {

  private Long id;
  private String firstName;
  private String lastName;
  private String email;
  private String origine;

(getters and setters skiped)  
}</code></p>
<p>It defines a component in the conversation scope with a private field containing an entity which is outjected with &#8220;registrant&#8221; name.</p>
<p>Later we&#8217;ll want to use this variable in a view :</p>
<p>pages.xml :
<code>...
&lt;page view-id="/register.xhtml"&gt;
    &lt;begin-conversation join="true" /&gt;
    

    &lt;navigation&gt;
      &lt;rule if-outcome="ok"&gt;
        &lt;end-conversation /&gt;
        &lt;redirect view-id="/thanks.xhtml"&gt;&lt;/redirect&gt;
      &lt;/rule&gt;
    &lt;/navigation&gt;
  &lt;/page&gt;
...</code></p>
<p>register.xhtml :
<code>...
&lt;span class="inputLabel"&gt;Your  name : &lt;/span&gt;&lt;br/&gt;
&lt;h:inputText id="Name" styleClass="inputShort" required="true"
value="#{registrant.lastName}"/&gt;
...</code></p>
<p>But it doesn&#8217;t work (an exception occurs when the form is submitted). We started a conversation in pages.xml and called the outjected &#8220;registrant&#8221; variable from registerHdl without any success.<br />
So what went wrong ?<br />
The problem is that the &#8220;registerHdl&#8221; component is never created and the call we made to &#8220;registrant&#8221; didn&#8217;t trigger this creation.<br />
To trigger this creation we could have called a method of registerHdl. We could have mapped the fields with #{registerHdl.registrant} in the view after having defined getter and setter for registrant in the component. But ther&#8217;s a better way.<br />
That&#8217;s here that @Factory start to be useful.<br />

<code>@Name("registerHdl")
@Scope(ScopeType.CONVERSATION)
public class RegisterHandler implements Serializable{

       
  private Registrant registrant=new Registrant();
        
        @Factory
  public Registrant getRegistrant() {
    return registrant;
  }

  public void setRegistrant(Registrant registrant) {
    this.registrant = registrant;
  }
        @Create
        public void create()
        {
        }

}</code></p>
<p>We deleted the @Out annotation and added a getter with the @Factory annotation.  This new configuration triggers  the creation of registerHdl component when we call #{registrant&#8230;} in our view.</p>
<p>To summarize @Out outjects a field as a context variable <strong>after</strong> the creation of the component and @Factory triggers if necessary the creation of the component to outject the return value of a method. @Out is only visible in the component life cycle and @Factory is visible in the whole application.<br />
But that&#8217;s not the only difference between @Factory and @Out as we&#8217;ll see in part 2 of this article.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.next-presso.fr%2F2008%2F10%2Fwhos-in-whos-out-clarification-on-seam-bijection%2F&amp;partner=sociable" title="Print"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.next-presso.fr%2F2008%2F10%2Fwhos-in-whos-out-clarification-on-seam-bijection%2F&amp;title=%5Blang_en%5DWho%27s%20%40In%20%3F%20who%27s%20%40Out%20%3F%20Clarification%20on%20Seam%20bijection%20%28part%201%29%5B%2Flang_en%5D%5Blang_fr%5DQui%20est%20%40In%20%3F%20Qui%20est%20%40Out%20%3F%20Eclairsissement%20sur%20la%20bijection%20dans%20Seam%20%281%C3%A8re%20partie%29%5B%2Flang_fr%5D&amp;bodytext=%5Blang_fr%5D%0D%0ASuite%20%C3%A0%20la%20lecture%20de%20l%27article%20de%20Chiral%20Software%20sur%20les%20annotations%20Seam%20%40Factory%20et%20%40Unwrap%2C%20j%27ai%20pens%C3%A9%20qu%27il%20serait%20bon%20d%27apporter%20quelques%20pr%C3%A9cisions%20sur%20le%20fontionnement%20de%20la%20bijection%20dans%20Seam%20%C3%A0%20la%20lumi%C3%A8re%20de%20mon%20exp%C3%A9rience" title="Digg"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.next-presso.fr%2F2008%2F10%2Fwhos-in-whos-out-clarification-on-seam-bijection%2F&amp;title=%5Blang_en%5DWho%27s%20%40In%20%3F%20who%27s%20%40Out%20%3F%20Clarification%20on%20Seam%20bijection%20%28part%201%29%5B%2Flang_en%5D%5Blang_fr%5DQui%20est%20%40In%20%3F%20Qui%20est%20%40Out%20%3F%20Eclairsissement%20sur%20la%20bijection%20dans%20Seam%20%281%C3%A8re%20partie%29%5B%2Flang_fr%5D&amp;notes=%5Blang_fr%5D%0D%0ASuite%20%C3%A0%20la%20lecture%20de%20l%27article%20de%20Chiral%20Software%20sur%20les%20annotations%20Seam%20%40Factory%20et%20%40Unwrap%2C%20j%27ai%20pens%C3%A9%20qu%27il%20serait%20bon%20d%27apporter%20quelques%20pr%C3%A9cisions%20sur%20le%20fontionnement%20de%20la%20bijection%20dans%20Seam%20%C3%A0%20la%20lumi%C3%A8re%20de%20mon%20exp%C3%A9rience" title="del.icio.us"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.next-presso.fr%2F2008%2F10%2Fwhos-in-whos-out-clarification-on-seam-bijection%2F&amp;t=%5Blang_en%5DWho%27s%20%40In%20%3F%20who%27s%20%40Out%20%3F%20Clarification%20on%20Seam%20bijection%20%28part%201%29%5B%2Flang_en%5D%5Blang_fr%5DQui%20est%20%40In%20%3F%20Qui%20est%20%40Out%20%3F%20Eclairsissement%20sur%20la%20bijection%20dans%20Seam%20%281%C3%A8re%20partie%29%5B%2Flang_fr%5D" title="Facebook"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.next-presso.fr%2F2008%2F10%2Fwhos-in-whos-out-clarification-on-seam-bijection%2F&amp;title=%5Blang_en%5DWho%27s%20%40In%20%3F%20who%27s%20%40Out%20%3F%20Clarification%20on%20Seam%20bijection%20%28part%201%29%5B%2Flang_en%5D%5Blang_fr%5DQui%20est%20%40In%20%3F%20Qui%20est%20%40Out%20%3F%20Eclairsissement%20sur%20la%20bijection%20dans%20Seam%20%281%C3%A8re%20partie%29%5B%2Flang_fr%5D&amp;annotation=%5Blang_fr%5D%0D%0ASuite%20%C3%A0%20la%20lecture%20de%20l%27article%20de%20Chiral%20Software%20sur%20les%20annotations%20Seam%20%40Factory%20et%20%40Unwrap%2C%20j%27ai%20pens%C3%A9%20qu%27il%20serait%20bon%20d%27apporter%20quelques%20pr%C3%A9cisions%20sur%20le%20fontionnement%20de%20la%20bijection%20dans%20Seam%20%C3%A0%20la%20lumi%C3%A8re%20de%20mon%20exp%C3%A9rience" title="Google Bookmarks"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.next-presso.fr%2F2008%2F10%2Fwhos-in-whos-out-clarification-on-seam-bijection%2F&amp;title=%5Blang_en%5DWho%27s%20%40In%20%3F%20who%27s%20%40Out%20%3F%20Clarification%20on%20Seam%20bijection%20%28part%201%29%5B%2Flang_en%5D%5Blang_fr%5DQui%20est%20%40In%20%3F%20Qui%20est%20%40Out%20%3F%20Eclairsissement%20sur%20la%20bijection%20dans%20Seam%20%281%C3%A8re%20partie%29%5B%2Flang_fr%5D&amp;source=Next+Presso+Java%2C+Seam%2C+Spring+%26amp%3B+co&amp;summary=%5Blang_fr%5D%0D%0ASuite%20%C3%A0%20la%20lecture%20de%20l%27article%20de%20Chiral%20Software%20sur%20les%20annotations%20Seam%20%40Factory%20et%20%40Unwrap%2C%20j%27ai%20pens%C3%A9%20qu%27il%20serait%20bon%20d%27apporter%20quelques%20pr%C3%A9cisions%20sur%20le%20fontionnement%20de%20la%20bijection%20dans%20Seam%20%C3%A0%20la%20lumi%C3%A8re%20de%20mon%20exp%C3%A9rience" title="LinkedIn"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.netvibes.com/share?title=%5Blang_en%5DWho%27s%20%40In%20%3F%20who%27s%20%40Out%20%3F%20Clarification%20on%20Seam%20bijection%20%28part%201%29%5B%2Flang_en%5D%5Blang_fr%5DQui%20est%20%40In%20%3F%20Qui%20est%20%40Out%20%3F%20Eclairsissement%20sur%20la%20bijection%20dans%20Seam%20%281%C3%A8re%20partie%29%5B%2Flang_fr%5D&amp;url=http%3A%2F%2Fwww.next-presso.fr%2F2008%2F10%2Fwhos-in-whos-out-clarification-on-seam-bijection%2F" title="Netvibes"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=%5Blang_en%5DWho%27s%20%40In%20%3F%20who%27s%20%40Out%20%3F%20Clarification%20on%20Seam%20bijection%20%28part%201%29%5B%2Flang_en%5D%5Blang_fr%5DQui%20est%20%40In%20%3F%20Qui%20est%20%40Out%20%3F%20Eclairsissement%20sur%20la%20bijection%20dans%20Seam%20%281%C3%A8re%20partie%29%5B%2Flang_fr%5D%20-%20http%3A%2F%2Fwww.next-presso.fr%2F2008%2F10%2Fwhos-in-whos-out-clarification-on-seam-bijection%2F" title="Twitter"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.next-presso.fr/2008/10/whos-in-whos-out-clarification-on-seam-bijection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use Hibernate filters in Seam</title>
		<link>http://www.next-presso.fr/2008/10/how-to-use-hibernate-filters-in-seam/</link>
		<comments>http://www.next-presso.fr/2008/10/how-to-use-hibernate-filters-in-seam/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 21:56:30 +0000</pubDate>
		<dc:creator>Antoine Sabot-Durand</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Seam]]></category>

		<guid isPermaLink="false">http://www.next-presso.fr/?p=12</guid>
		<description><![CDATA[<p>JBoss Seam is very rich and powerful framework but some of its features are badly documented.</p>
<p>Hibernate Filters is one of these  forgotten features. In fact filters documentation in Seam is rather useless.</p>
<p></p>
<p>I won&#8217;t explain in details Hibernate Filters here. Hibernate documentation does it ways better. To make short it&#8217;s a smart solution to add [...]]]></description>
			<content:encoded><![CDATA[<p>JBoss Seam is very rich and powerful framework but some of its features are badly documented.</p>
<p>Hibernate Filters is one of these  forgotten features. In fact <a href="http://docs.jboss.org/seam/latest/reference/en-US/html/persistence.html#d0e6816" target="_blank">filters documentation in Seam</a> is rather useless.</p>
<p><span id="more-12"></span></p>
<p>I won&#8217;t explain in details Hibernate Filters here. Hibernate <a href="http://www.hibernate.org/hib_docs/v3/reference/en-US/html/filters.html" target="_blank">documentation</a> does it ways better. To make short it&#8217;s a smart solution to add conditions to the &#8220;where&#8221; clause of a request at runtime.</p>
<p>To create such a filter in Seam, one will also have to read <a href="http://www.hibernate.org/hib_docs/annotations/reference/en/html/entity.html#entity-hibspec-filters" target="_blank">Hibernate annotations</a> on that matter.</p>
<p>For instance let say we have an used cars stock for which we had developed a bunch of forms and pages to search and navigate through it. We also created a Seam component to handle a requests collection to populate search form&#8217;s combo box fields and orchestrate all the search and navigation.</p>
<p>In database, cars have a &#8220;stockVoLib&#8221; field which gives car origin (demonstration, management car, etc&#8230;). Until now this field wasn&#8217;t used by the application and search were done on all the stock db. But now, our customer ask for a new navigation having exactly the same look at the first one but restricted on  a given car origin.</p>
<p>We can answer to this request in two different ways.</p>
<ul>
<li>Refactor all the running website&#8217;s engine to introduce the new &#8220;stcokVoLib&#8221; parameter in all the requests and code calling these requests</li>
<li>Create a filter which will save us a lot of refactoring work on existing code.</li>
</ul>
<p>Guess what ? I prefer to create a filter <img src='http://www.next-presso.fr/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  (good news for the end of this post).</p>
<h3>1.Hibernate filter creation with annotations</h3>
<p>First thing to do : define the filter. We can dot it in the target entity or at the package level. As a filter can be applied to more than one entity I prefer the package level option. So I add a &#8220;package-info.java&#8221; file to my entities package to define the filter in it.</p>
<pre class="brush: java;">
@FilterDef(name = &quot;stockLib&quot;, defaultCondition = &quot;stockLibele = :aStockLib&quot;,
parameters = @ParamDef(name = &quot;aStockLib&quot;, type = &quot;string&quot;))

package org.fpp.domain;

import org.hibernate.annotations.FilterDef;
import org.hibernate.annotations.ParamDef;
</pre>
<p>The name of the filter is &#8220;stockLib&#8221;, it has a default condition which will be used if there is no condition defined when the filter is applied on the entity and it also has one string parameter : &#8220;aStockLib&#8221;.<br />
Keep in mind that the condition defined here is not a HQL &#8220;where&#8221; but a SQL one.</p>
<p>After that I apply the filter on one or more entities (I could also attach it to a collection). In my use case I only have one entity concerned : &#8220;usedCar&#8221;.</p>
<pre class="brush: java;">
@Entity
@Filter(name = &quot;stockLib&quot;)
public class usedCar {
...
</pre>
<h3>3.Using the filter with Hibernate</h3>
<p>Now, I can use the filter with Hibernate. I can activate it and send it parameter values  by getting Hibernate session (if we are using JPA we do that with EntityManager.getDelegate())</p>
<pre class="brush: java;">
Session session=(Session) entityManager.getDelegate();
session.enableFilter(&quot;stockLib&quot;).setParameter(&quot;aStockLib&quot;, &quot;VD&quot;);
...
session.disableFilter(&quot;stockLib&quot;);
</pre>
<h3>3.What about Seam ?</h3>
<p>You can do better with Seam by creating a filter component (wraping Hibernate filter) in which you can inject parameter at runtime.<br />
We only have to have this component in the Seam components.xml file.</p>
<pre class="brush: xml;">
&lt;persistence:filter name=&quot;stockLibFilter&quot;&gt;
  &lt;persistence:name&gt;stockLib&lt;/persistence:name&gt;
  &lt;persistence:parameters&gt;
    &lt;key&gt;aStockLib&lt;/key&gt;
    &lt;value&gt;#{parameterHdl.stockLib}&lt;/value&gt;
  &lt;/persistence:parameters&gt;
&lt;/persistence:filter&gt;
</pre>
<p>Remember that parameters value in this &#8220;meta-filter&#8221;  should always be expressed in expression language even if we want inject a constant : #{&#8216;VD&#8217;}.<br />
In our example &#8220;parameterHdl&#8221; is a Seam component in which the stockLib parameter is injected from the URL according tto the the following configuration in pages.xml</p>
<pre class="brush: xml;">
&lt;param name=&quot;stockLib&quot; value=&quot;#{parameterHdl.stockLib}&quot; required=&quot;false&quot;/&gt;
</pre>
<p>At that point Seam filter can be injected in a specific EntityManager on which the filter will be always activated.</p>
<pre class="brush: xml;">
&lt;persistence:managed-persistence-context name=&quot;emStockLib&quot; auto-create=&quot;true&quot; persistence-unit-jndi-name=&quot;java:/fppEntityManagerFactory&quot; &gt;
  &lt;persistence:filters&gt;
    &lt;value&gt;#{stockLibFilter}&lt;/value&gt;
  &lt;/persistence:filters&gt;
&lt;/persistence:managed-persistence-context&gt;
</pre>
<p>This new entityManager could be injected in components instead of the standard entityManager (without filter). There is nothing to do to activate the filter, it is on by default.<br />
<strong>But that&#8217;s not all !</strong></p>
<h3>4.Dynamic filters activation in Seam</h3>
<p>It&#8217;s here that Seam documentation is lacking something very useful : filters activation can be dynamically set at run time.</p>
<p>Thus we can write someting like :</p>
<pre class="brush: xml;">
&lt;persistence:filter name=&quot;stockLibFilter&quot; enabled=&quot;#{!(empty parameterHdl.stockLib)}&quot;&gt;
  &lt;persistence:name&gt;stockLib&lt;/persistence:name&gt;
  &lt;persistence:parameters&gt;
    &lt;key&gt;aStockLib&lt;/key&gt;
    &lt;value&gt;#{parameterHdl.stockLib}&lt;/value&gt;
  &lt;/persistence:parameters&gt;
&lt;/persistence:filter&gt;
</pre>
<p>Pay attention to the &#8220;enabled&#8221; parameter in which we put a boolean expression. It means that the filter is activated only if stockLib field of component parameterHdl is not empty. As this field is filled by URL parameter injection, an existing stockLib parameter in URL activate the filter.</p>
<p>In this usage we can apply the filter to the application&#8217;s main entityManager (no need to create a specific one) and this filter will be activated if its enabled parameter is satisfied. This test will be evaluated each time the entityManager is called (that&#8217;s Seam&#8217;s &#8220;magic&#8221;).</p>
<pre class="brush: xml;">
&lt;persistence:managed-persistence-context name=&quot;entityManager&quot; auto-create=&quot;true&quot; persistence-unit-jndi-name=&quot;java:/fppEntityManagerFactory&quot; &gt;
  &lt;persistence:filters&gt;
    &lt;value&gt;#{stockLibFilter}&lt;/value&gt;
  &lt;/persistence:filters&gt;
&lt;/persistence:managed-persistence-context&gt;
</pre>
<p>So we have injected a dynamically activated Hibernate filter in the entityManager and its activation will depend of the application context.<br />
One last thing to keep in mind : if the enabled parameter of the filter uses a Seam component (like in my example), you should not inject the &#8220;filtered&#8221; entityManager in this component. If you did you would get an exception at the application launch caused by the circular reference.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.next-presso.fr%2F2008%2F10%2Fhow-to-use-hibernate-filters-in-seam%2F&amp;partner=sociable" title="Print"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.next-presso.fr%2F2008%2F10%2Fhow-to-use-hibernate-filters-in-seam%2F&amp;title=%5Blang_en%5DHow%20to%20use%20Hibernate%20filters%20in%20Seam%5B%2Flang_en%5D%5Blang_fr%5DUtilisation%20des%20filtres%20hibernate%20dans%20Seam%5B%2Flang_fr%5D&amp;bodytext=%5Blang_fr%5DJBoss%20Seam%20est%20vraiment%20un%20framework%20tr%C3%A8s%20riche%20mais%20certaines%20de%20ses%20fonctionalit%C3%A9s%20sont%20mal%20document%C3%A9es.%0D%0A%0D%0AC%27est%20le%20cas%20des%20filtres%20Hibernate.%20La%20documentation%20de%20Seam%20sur%20le%20sujet%20est%20plut%C3%B4t%20lapidaire%20et%20inutilisable%20en%20l%27%C3%A9tat.%5B%2Flan" title="Digg"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.next-presso.fr%2F2008%2F10%2Fhow-to-use-hibernate-filters-in-seam%2F&amp;title=%5Blang_en%5DHow%20to%20use%20Hibernate%20filters%20in%20Seam%5B%2Flang_en%5D%5Blang_fr%5DUtilisation%20des%20filtres%20hibernate%20dans%20Seam%5B%2Flang_fr%5D&amp;notes=%5Blang_fr%5DJBoss%20Seam%20est%20vraiment%20un%20framework%20tr%C3%A8s%20riche%20mais%20certaines%20de%20ses%20fonctionalit%C3%A9s%20sont%20mal%20document%C3%A9es.%0D%0A%0D%0AC%27est%20le%20cas%20des%20filtres%20Hibernate.%20La%20documentation%20de%20Seam%20sur%20le%20sujet%20est%20plut%C3%B4t%20lapidaire%20et%20inutilisable%20en%20l%27%C3%A9tat.%5B%2Flan" title="del.icio.us"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.next-presso.fr%2F2008%2F10%2Fhow-to-use-hibernate-filters-in-seam%2F&amp;t=%5Blang_en%5DHow%20to%20use%20Hibernate%20filters%20in%20Seam%5B%2Flang_en%5D%5Blang_fr%5DUtilisation%20des%20filtres%20hibernate%20dans%20Seam%5B%2Flang_fr%5D" title="Facebook"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.next-presso.fr%2F2008%2F10%2Fhow-to-use-hibernate-filters-in-seam%2F&amp;title=%5Blang_en%5DHow%20to%20use%20Hibernate%20filters%20in%20Seam%5B%2Flang_en%5D%5Blang_fr%5DUtilisation%20des%20filtres%20hibernate%20dans%20Seam%5B%2Flang_fr%5D&amp;annotation=%5Blang_fr%5DJBoss%20Seam%20est%20vraiment%20un%20framework%20tr%C3%A8s%20riche%20mais%20certaines%20de%20ses%20fonctionalit%C3%A9s%20sont%20mal%20document%C3%A9es.%0D%0A%0D%0AC%27est%20le%20cas%20des%20filtres%20Hibernate.%20La%20documentation%20de%20Seam%20sur%20le%20sujet%20est%20plut%C3%B4t%20lapidaire%20et%20inutilisable%20en%20l%27%C3%A9tat.%5B%2Flan" title="Google Bookmarks"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.next-presso.fr%2F2008%2F10%2Fhow-to-use-hibernate-filters-in-seam%2F&amp;title=%5Blang_en%5DHow%20to%20use%20Hibernate%20filters%20in%20Seam%5B%2Flang_en%5D%5Blang_fr%5DUtilisation%20des%20filtres%20hibernate%20dans%20Seam%5B%2Flang_fr%5D&amp;source=Next+Presso+Java%2C+Seam%2C+Spring+%26amp%3B+co&amp;summary=%5Blang_fr%5DJBoss%20Seam%20est%20vraiment%20un%20framework%20tr%C3%A8s%20riche%20mais%20certaines%20de%20ses%20fonctionalit%C3%A9s%20sont%20mal%20document%C3%A9es.%0D%0A%0D%0AC%27est%20le%20cas%20des%20filtres%20Hibernate.%20La%20documentation%20de%20Seam%20sur%20le%20sujet%20est%20plut%C3%B4t%20lapidaire%20et%20inutilisable%20en%20l%27%C3%A9tat.%5B%2Flan" title="LinkedIn"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.netvibes.com/share?title=%5Blang_en%5DHow%20to%20use%20Hibernate%20filters%20in%20Seam%5B%2Flang_en%5D%5Blang_fr%5DUtilisation%20des%20filtres%20hibernate%20dans%20Seam%5B%2Flang_fr%5D&amp;url=http%3A%2F%2Fwww.next-presso.fr%2F2008%2F10%2Fhow-to-use-hibernate-filters-in-seam%2F" title="Netvibes"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=%5Blang_en%5DHow%20to%20use%20Hibernate%20filters%20in%20Seam%5B%2Flang_en%5D%5Blang_fr%5DUtilisation%20des%20filtres%20hibernate%20dans%20Seam%5B%2Flang_fr%5D%20-%20http%3A%2F%2Fwww.next-presso.fr%2F2008%2F10%2Fhow-to-use-hibernate-filters-in-seam%2F" title="Twitter"><img src="http://www.next-presso.fr/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.next-presso.fr/2008/10/how-to-use-hibernate-filters-in-seam/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
	</channel>
</rss>
