| <html><head> |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <title>7. Working with Common Enterprise Libraries</title><link rel="stylesheet" href="css/stylesheet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="Virgo Programmer Guide"><link rel="up" href="index.html" title="Virgo Programmer Guide"><link rel="prev" href="ch06s07.html" title="6.7 Form Tags as a Plan"><link rel="next" href="ch07s02.html" title="7.2 Working with DataSources"><!--Begin Google Analytics code--><script type="text/javascript"> |
| var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); |
| document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); |
| </script><script type="text/javascript"> |
| var pageTracker = _gat._getTracker("UA-2728886-3"); |
| pageTracker._setDomainName("none"); |
| pageTracker._setAllowLinker(true); |
| pageTracker._trackPageview(); |
| </script><!--End Google Analytics code--></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">7. Working with Common Enterprise Libraries</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch06s07.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch07s02.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="common-libraries"></a>7. Working with Common Enterprise Libraries</h2></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="common-libraries-hibernate"></a>7.1 Working with Hibernate</h2></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="common-libraries-hibernate-import"></a>Importing Hibernate</h3></div></div></div><p> |
| Hibernate uses CGLIB to dynamically create subclasses of your entity types at |
| runtime. To guarantee that Hibernate and CGLIB can correctly see the types, |
| you must add an <code class="literal">Import-Library</code> or <code class="literal">Import-Bundle</code> for the Hibernate library or bundle |
| into any bundle that uses Hibernate directly. |
| </p><p> |
| Additionally, if other bundles in your application contain types to be persisted by Hibernate, then be sure to specify the <code class="code">import-scope</code> directive of the <code class="literal">Import-Bundle</code> header in the bundle that uses Hibernate directly. The <code class="literal">import-scope</code> directive tells Virgo Server for Apache Tomcat to implicitly import the bundle into all other bundles that make up the application; this ensures that bundles that indirectly depend on the generated Hibernate classes have access to them, but you do not have to explicitly update their <code class="code">Import-Bundle</code> header, ensuring modularity. For example: |
| </p><pre class="programlisting"> |
| Import-Bundle: com.springsource.org.hibernate;version="[3.2.6.ga,3.2.6.ga]";<span class="bold"><strong>import-scope:=application</strong></span></pre><p> |
| The <code class="code">import-scope</code> directive works only for the bundles in a scoped application (PARs or plans.) |
| </p></div></div></div><!--Begin LoopFuse code--><script src="http://loopfuse.net/webrecorder/js/listen.js" type="text/javascript"></script><script type="text/javascript"> |
| _lf_cid = "LF_48be82fa"; |
| _lf_remora(); |
| </script><!--End LoopFuse code--><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch06s07.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch07s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">6.7 Form Tags as a Plan </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 7.2 Working with DataSources</td></tr></table></div></body></html> |