<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>Inconsolata.afm</filename>
    </added>
    <added>
      <filename>Inconsolata.pfa</filename>
    </added>
    <added>
      <filename>Inconsolata.tfm</filename>
    </added>
    <added>
      <filename>Inconsolata.ttf</filename>
    </added>
    <added>
      <filename>T1-WGL4.enc</filename>
    </added>
    <added>
      <filename>T1Inconsolata.fd</filename>
    </added>
    <added>
      <filename>ttfonts.map</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -16,3 +16,4 @@ master/
 *.log
 *.out
 *.toc
+*pk</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -9,4 +9,4 @@ master.tex	: master.lyx
 master.aux	: master.tex
 	pdflatex master.tex
 clean:
-	rm -f *.tex images/*.eps *.toc *.aux *.dvi *.idx *.lof *.log *.out *.toc
+	rm -f *.tex images/*.eps *.toc *.aux *.dvi *.idx *.lof *.log *.out *.toc *.lol</diff>
      <filename>Makefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
-#LyX 1.5.3 created this file. For more info see http://www.lyx.org/
-\lyxformat 276
+#LyX 1.6.1 created this file. For more info see http://www.lyx.org/
+\lyxformat 345
 \begin_document
 \begin_header
 \textclass book
+\use_default_options false
 \language english
 \inputencoding auto
 \font_roman default
@@ -13,9 +14,11 @@
 \font_osf false
 \font_sf_scale 100
 \font_tt_scale 100
+
 \graphics default
 \paperfontsize default
 \spacing single
+\use_hyperref false
 \papersize default
 \use_geometry false
 \use_amsmath 1
@@ -48,9 +51,14 @@ The Java Persistence API
 \begin_inset Foot
 status collapsed
 
-\begin_layout Standard
-\begin_inset LatexCommand htmlurl
-target &quot;http://java.sun.com/javaee/overview/faq/persistence.jsp&quot;
+\begin_layout Plain Layout
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+http://java.sun.com/javaee/overview/faq/persistence.jsp
+\end_layout
 
 \end_inset
 
@@ -60,8 +68,12 @@ target &quot;http://java.sun.com/javaee/overview/faq/persistence.jsp&quot;
 \end_inset
 
 , or JPA
-\begin_inset LatexCommand index
-name &quot;JPA&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+JPA
+\end_layout
 
 \end_inset
 
@@ -71,8 +83,12 @@ name &quot;JPA&quot;
  JPA was developed as part of the EJB3 specification, with the goal of simplifyi
 ng the persistence model.
  Prior versions had used the Container Managed Persistence (CMP
-\begin_inset LatexCommand index
-name &quot;CMP&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+CMP
+\end_layout
 
 \end_inset
 
@@ -80,16 +96,24 @@ name &quot;CMP&quot;
  and XML descriptors.
  As part of the overarching theme of EJB3 to simplify and use configuration
  by convention, JPA uses annotations
-\begin_inset LatexCommand index
-name &quot;annotations&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+annotations
+\end_layout
 
 \end_inset
 
  heavily, while allowing for targetted overrides of behavior via XML descriptors.
  JPA also does away with many of the interfaces used in CMP and provides
  a single EntityManager
-\begin_inset LatexCommand index
-name &quot;EntityManager&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+EntityManager
+\end_layout
 
 \end_inset
 
@@ -97,20 +121,32 @@ name &quot;EntityManager&quot;
  An additional benefit is that JPA was designed so that it could be used
  both inside and outside of the Enterprise container, and several projects
  (Hibernate
-\begin_inset LatexCommand index
-name &quot;Hibernate&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+Hibernate
+\end_layout
 
 \end_inset
 
 , TopLink
-\begin_inset LatexCommand index
-name &quot;TopLink&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+TopLink
+\end_layout
 
 \end_inset
 
 , JPOX
-\begin_inset LatexCommand index
-name &quot;JPOX&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+JPOX
+\end_layout
 
 \end_inset
 
@@ -119,7 +155,8 @@ name &quot;JPOX&quot;
 
 \begin_layout Standard
 As we've seen in chapter 
-\begin_inset LatexCommand ref
+\begin_inset CommandInset ref
+LatexCommand ref
 reference &quot;cha:mapper_and_record&quot;
 
 \end_inset
@@ -143,7 +180,7 @@ JPA gives you more flexibility with complex and/or large schemas.
 \begin_inset Note Note
 status open
 
-\begin_layout Standard
+\begin_layout Plain Layout
 TODO: is it Record or Mapper?
 \end_layout
 
@@ -164,7 +201,7 @@ accessed objects in memory so that you avoid hitting the database entirely
 \begin_inset Note Note
 status open
 
-\begin_layout Standard
+\begin_layout Plain Layout
 May need to remove this if it's not true by printing
 \end_layout
 
@@ -184,8 +221,12 @@ In order to provide a concrete example to build on while learning how to
  integrate JPA, we'll be building a small Lift app to manage a library of
  books.
  The completed example is available under the Lift Git
-\begin_inset LatexCommand index
-name &quot;Git&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+Git
+\end_layout
 
 \end_inset
 
@@ -199,7 +240,8 @@ JPADemo
 
 .
  Basic coverage of the JPA operations is in section 
-\begin_inset LatexCommand vref
+\begin_inset CommandInset ref
+LatexCommand vref
 reference &quot;sec:JPA-Examples&quot;
 
 \end_inset
@@ -210,15 +252,25 @@ reference &quot;sec:JPA-Examples&quot;
 \begin_inset Foot
 status collapsed
 
-\begin_layout Standard
-\begin_inset LatexCommand htmlurl
-target &quot;http://java.sun.com/developer/technicalArticles/J2EE/jpa/&quot;
+\begin_layout Plain Layout
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+http://java.sun.com/developer/technicalArticles/J2EE/jpa/
+\end_layout
 
 \end_inset
 
 , 
-\begin_inset LatexCommand htmlurl
-target &quot;http://www.jpox.org/docs/1_2/tutorials/jpa_tutorial.html&quot;
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+http://www.jpox.org/docs/1_2/tutorials/jpa_tutorial.html
+\end_layout
 
 \end_inset
 
@@ -229,8 +281,12 @@ target &quot;http://www.jpox.org/docs/1_2/tutorials/jpa_tutorial.html&quot;
 
 .
  Our first step is to set up a master project
-\begin_inset LatexCommand index
-name &quot;master project&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+master project
+\end_layout
 
 \end_inset
 
@@ -238,7 +294,7 @@ name &quot;master project&quot;
 \begin_inset Note Note
 status open
 
-\begin_layout Standard
+\begin_layout Plain Layout
 Will the Maven chapter have a section on master/module projects?
 \end_layout
 
@@ -248,14 +304,19 @@ Will the Maven chapter have a section on master/module projects?
  This project will have two modules under it, one for the JPA library and
  one for the Lift application.
  The only thing we actually need for the master project is the pom.xml
-\begin_inset LatexCommand index
-name &quot;pom.xml&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+pom.xml
+\end_layout
 
 \end_inset
 
 .
  The complete pom.xml is shown in section 
-\begin_inset LatexCommand vref
+\begin_inset CommandInset ref
+LatexCommand vref
 reference &quot;lst:JPA-Master-pom.xml&quot;
 
 \end_inset
@@ -271,8 +332,12 @@ reference &quot;lst:JPA-Master-pom.xml&quot;
 The master pom.xml sets up some basic dependencies and plugin configurations
  which the modules will inherit.
  Our next step will be to create the JPA module using an archetype
-\begin_inset LatexCommand index
-name &quot;archetype&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+archetype
+\end_layout
 
 \end_inset
 
@@ -280,7 +345,7 @@ name &quot;archetype&quot;
 \begin_inset Note Note
 status open
 
-\begin_layout Standard
+\begin_layout Plain Layout
 I need to get the JPA archetype set up
 \end_layout
 
@@ -306,8 +371,12 @@ Scala JPA
 
 \begin_layout Subsection
 Entity Classes
-\begin_inset LatexCommand index
-name &quot;entity class&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+entity class
+\end_layout
 
 \end_inset
 
@@ -319,7 +388,8 @@ The main components of a JPA library are the entity classes that comprise
  your data model.
  For our example application we need two primary entities: Author and Book.
  Let's take a look at the Author class first, shown in listing 
-\begin_inset LatexCommand vref
+\begin_inset CommandInset ref
+LatexCommand vref
 reference &quot;lst:Author.scala&quot;
 
 \end_inset
@@ -337,7 +407,7 @@ reference &quot;lst:Author.scala&quot;
 \begin_inset Note Note
 status open
 
-\begin_layout Standard
+\begin_layout Plain Layout
 I think this changes in 2.8
 \end_layout
 
@@ -353,9 +423,14 @@ I think this changes in 2.8
 \begin_inset Foot
 status open
 
-\begin_layout Standard
-\begin_inset LatexCommand htmlurl
-target &quot;https://lampsvn.epfl.ch/trac/scala/ticket/294&quot;
+\begin_layout Plain Layout
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+https://lampsvn.epfl.ch/trac/scala/ticket/294
+\end_layout
 
 \end_inset
 
@@ -369,14 +444,19 @@ target &quot;https://lampsvn.epfl.ch/trac/scala/ticket/294&quot;
 \end_layout
 
 \begin_layout Subsection
-\begin_inset LatexCommand label
+\begin_inset CommandInset label
+LatexCommand label
 name &quot;sub:Using-the-orm.xml&quot;
 
 \end_inset
 
 Using the orm.xml
-\begin_inset LatexCommand index
-name &quot;orm.xml&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+orm.xml
+\end_layout
 
 \end_inset
 
@@ -391,15 +471,20 @@ As we stated in the last section, there are some instances where the Scala
  column names, etc) should be separate from code.
  Because of that, JPA allows you to specify an external mapping descriptor
  to define and/or override the mappings for your entity classes
-\begin_inset LatexCommand index
-name &quot;entity classes&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+entity classes
+\end_layout
 
 \end_inset
 
 .
  The basic orm.xml file starts with the DTD type declaration, as shown in
  listing 
-\begin_inset LatexCommand vref
+\begin_inset CommandInset ref
+LatexCommand vref
 reference &quot;lst:orm.xml&quot;
 
 \end_inset
@@ -412,8 +497,13 @@ reference &quot;lst:orm.xml&quot;
  Putting them in the orm.xml allows us to modify them without requiring a
  recompile.
  The complete XML Schema Definition can be found at 
-\begin_inset LatexCommand htmlurl
-target &quot;http://java.sun.com/xml/ns/persistence/orm_1_0.xsd&quot;
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+http://java.sun.com/xml/ns/persistence/orm_1_0.xsd
+\end_layout
 
 \end_inset
 
@@ -427,7 +517,8 @@ In this case we have used the orm.xml file to augment our entity classes.
  Suppose we wished to change the column name for the Author's name property.
  We can add (per the XSD) a section to the Author entity element as shown
  in listing 
-\begin_inset LatexCommand ref
+\begin_inset CommandInset ref
+LatexCommand ref
 reference &quot;lst:JPA-Author-override&quot;
 
 \end_inset
@@ -445,8 +536,12 @@ attribute-override
  This gives us an extremely powerful method for controlling our schema mapping
  outside of the source code.
  We can also add named queries
-\begin_inset LatexCommand index
-name &quot;named queries&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+named queries
+\end_layout
 
 \end_inset
 
@@ -456,16 +551,17 @@ name &quot;named queries&quot;
 
 \begin_layout Standard
 \begin_inset listings
-lstparams &quot;basicstyle={\footnotesize},float,frame=single,language=XML&quot;
+lstparams &quot;float,language=XML&quot;
 inline false
 status open
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
 \begin_inset Caption
 
-\begin_layout Standard
-\begin_inset LatexCommand label
+\begin_layout Plain Layout
+\begin_inset CommandInset label
+LatexCommand label
 name &quot;lst:JPA-Author-override&quot;
 
 \end_inset
@@ -478,37 +574,37 @@ Author override
   &lt;entity class=&quot;Author&quot;&gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
     &lt;named-query name=&quot;findAllAuthors&quot;&gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
       &lt;query&gt;&lt;![CDATA[from Author a order by a.name]]&gt;&lt;/query&gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
     &lt;/named-query&gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
     &lt;attribute-override name=&quot;name&quot;&gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
       &lt;column name=&quot;author_name&quot; length=&quot;30&quot; /&gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
     &lt;/attribute-override&gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
   &lt;/entity&gt;
 \end_layout
@@ -537,7 +633,8 @@ persist
 merge
 \family default
  methods (section 
-\begin_inset LatexCommand ref
+\begin_inset CommandInset ref
+LatexCommand ref
 reference &quot;sub:Persisting,-merging-and-removing&quot;
 
 \end_inset
@@ -579,7 +676,7 @@ JPA can handle any Java primitive type, their corresponding Object versions
 \begin_inset Foot
 status collapsed
 
-\begin_layout Standard
+\begin_layout Plain Layout
 It can technically handle more; see the JPA spec, section 2.1.1 for details
 \end_layout
 
@@ -589,8 +686,12 @@ It can technically handle more; see the JPA spec, section 2.1.1 for details
  Occasionally, though, you may have a requirement for a type that doesn't
  fit directly with those specifications.
  One example in particular would be Scala's enumerations
-\begin_inset LatexCommand index
-name &quot;enumerations&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+enumerations
+\end_layout
 
 \end_inset
 
@@ -612,7 +713,8 @@ Java
 We begin by implementing a few helper classes besides the Genre enumeration
  itself.
  First, we define an Enumv trait, shown in listing 
-\begin_inset LatexCommand vref
+\begin_inset CommandInset ref
+LatexCommand vref
 reference &quot;lst:Enumv-Trait&quot;
 
 \end_inset
@@ -640,7 +742,8 @@ valueOf
 In order to actually convert the Enumeration class into the proper database
  type (String, Int, etc), we need to implement the Hibernate UserType interface,
  shown in listing 
-\begin_inset LatexCommand vref
+\begin_inset CommandInset ref
+LatexCommand vref
 reference &quot;lst:EnumvType&quot;
 
 \end_inset
@@ -707,16 +810,17 @@ et
 
 \begin_layout Standard
 \begin_inset listings
-lstparams &quot;basicstyle={\scriptsize},breaklines=true,firstline=3,float,frame=single,numbers=left,numberstyle={\tiny}&quot;
+lstparams &quot;breaklines=true,firstline=3,float,numbers=left,numberstyle={\tiny}&quot;
 inline false
 status open
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
 \begin_inset Caption
 
-\begin_layout Standard
-\begin_inset LatexCommand label
+\begin_layout Plain Layout
+\begin_inset CommandInset label
+LatexCommand label
 name &quot;lst:Genre-and-GenreType&quot;
 
 \end_inset
@@ -729,45 +833,45 @@ Genre and GenreType
 package com.foo.jpaweb.model
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
 object Genre extends Enumeration with Enumv {
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
   val Mystery = Value(&quot;Mystery&quot;, &quot;Mystery&quot;)
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
   val Science = Value(&quot;Science&quot;, &quot;Science&quot;)
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
   val Theater = Value(&quot;Theater&quot;, &quot;Drama literature&quot;)
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
   // more values here...
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
 }
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
 class GenreType extends EnumvType(Genre) {}
 \end_layout
@@ -780,7 +884,8 @@ class GenreType extends EnumvType(Genre) {}
 \begin_layout Standard
 Finally, the Genre object and the associated GenreType is shown in listing
  
-\begin_inset LatexCommand ref
+\begin_inset CommandInset ref
+LatexCommand ref
 reference &quot;lst:Genre-and-GenreType&quot;
 
 \end_inset
@@ -795,7 +900,8 @@ reference &quot;lst:Genre-and-GenreType&quot;
 var
 \family default
  and annotate it with the @Type annotation, as shown in listing 
-\begin_inset LatexCommand ref
+\begin_inset CommandInset ref
+LatexCommand ref
 reference &quot;lst:Using-the-@Type&quot;
 
 \end_inset
@@ -814,16 +920,17 @@ unknown
 
 \begin_layout Standard
 \begin_inset listings
-lstparams &quot;basicstyle={\scriptsize},float,frame=single&quot;
+lstparams &quot;float&quot;
 inline false
 status open
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
 \begin_inset Caption
 
-\begin_layout Standard
-\begin_inset LatexCommand label
+\begin_layout Plain Layout
+\begin_inset CommandInset label
+LatexCommand label
 name &quot;lst:Using-the-@Type&quot;
 
 \end_inset
@@ -836,7 +943,7 @@ Using the @Type annotation
   @Type{val `type` = &quot;com.foo.jpaweb.model.GenreType&quot;}
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
   var genre : Genre.Value = Genre.unknown
 \end_layout
@@ -851,7 +958,8 @@ Now that we have our objects defined, let's start using them.
 \end_layout
 
 \begin_layout Section
-\begin_inset LatexCommand label
+\begin_inset CommandInset label
+LatexCommand label
 name &quot;sec:Obtaining-an-EM&quot;
 
 \end_inset
@@ -887,15 +995,19 @@ Fortunately for us, Lift provides just such a mechanism.
 \begin_inset Foot
 status open
 
-\begin_layout Standard
+\begin_layout Plain Layout
 Notably, S.addAround with the LoanWrapper
 \end_layout
 
 \end_inset
 
 , but for now we're going to focus on just one: the RequestVar
-\begin_inset LatexCommand index
-name &quot;RequestVar&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+RequestVar
+\end_layout
 
 \end_inset
 
@@ -910,7 +1022,7 @@ name &quot;RequestVar&quot;
 \begin_inset Note Note
 status open
 
-\begin_layout Standard
+\begin_layout Plain Layout
 TODO: cross-ref
 \end_layout
 
@@ -925,13 +1037,15 @@ The initial setup of the entity manager is done through the RequestVar's
  constructor.
  We define a RequestVar as an object (as opposed to a class) as shown in
  listing 
-\begin_inset LatexCommand ref
+\begin_inset CommandInset ref
+LatexCommand ref
 reference &quot;lst:Setting-up-EM&quot;
 
 \end_inset
 
  (the full listing is in section 
-\begin_inset LatexCommand vref
+\begin_inset CommandInset ref
+LatexCommand vref
 reference &quot;lst:ScalaEntityManager&quot;
 
 \end_inset
@@ -940,7 +1054,8 @@ reference &quot;lst:ScalaEntityManager&quot;
  In our example we're using an abstraction of the EntityManager (and Query)
  interfaces as a template for our concrete implementation; we'll cover these
  in section 
-\begin_inset LatexCommand vref
+\begin_inset CommandInset ref
+LatexCommand vref
 reference &quot;sec:ScalaEntityManager-and-ScalaQuery&quot;
 
 \end_inset
@@ -957,16 +1072,17 @@ reference &quot;sec:ScalaEntityManager-and-ScalaQuery&quot;
 
 \begin_layout Standard
 \begin_inset listings
-lstparams &quot;basicstyle={\scriptsize},breaklines=true,firstline=1,float,frame=single,lastline=8,numbers=left,numberstyle={\tiny}&quot;
+lstparams &quot;breaklines=true,firstline=1,float,lastline=8,numbers=left,numberstyle={\tiny}&quot;
 inline false
 status open
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
 \begin_inset Caption
 
-\begin_layout Standard
-\begin_inset LatexCommand label
+\begin_layout Plain Layout
+\begin_inset CommandInset label
+LatexCommand label
 name &quot;lst:Setting-up-EM&quot;
 
 \end_inset
@@ -979,41 +1095,41 @@ Setting up an EntityManager via RequestVar
 
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
 abstract class ScalaEntityManager(val persistanceName: String) {
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
   // The concrete impl should provide these methods 
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
   protected def openEM () : EntityManager 
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
   protected def closeEM (em : EntityManager)
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
   private object emVar extends RequestVar(openEM()) {
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
     override def cleanupFunc : Can[() =&gt; Unit]= Full(() =&gt; closeEM(this.is))
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
   }
 \end_layout
@@ -1031,8 +1147,12 @@ Now that we've defined the mechanism for setting up and tearing down our
 
 \begin_layout Enumerate
 Construct the EntityManagerFactory
-\begin_inset LatexCommand index
-name &quot;EntityManagerFactory&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+EntityManagerFactory
+\end_layout
 
 \end_inset
 
@@ -1041,8 +1161,12 @@ name &quot;EntityManagerFactory&quot;
 
 \begin_layout Enumerate
 Obtain an EntityManager via JNDI
-\begin_inset LatexCommand index
-name &quot;JNDI&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+JNDI
+\end_layout
 
 \end_inset
 
@@ -1052,8 +1176,12 @@ name &quot;JNDI&quot;
 \begin_layout Standard
 Of these two, JNDI offers a cleaner approach from the standpoint of deployment.
  Using JNDI acts as a form of IoC
-\begin_inset LatexCommand index
-name &quot;Inversion of Control&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+Inversion of Control
+\end_layout
 
 \end_inset
 
@@ -1072,7 +1200,8 @@ Creating a factory directly
 Creating a factory directly is fairly simple, and is the use case for apps
  that will run under the Java SE without access to the JEE facilicities.
  As shown in listing 
-\begin_inset LatexCommand vref
+\begin_inset CommandInset ref
+LatexCommand vref
 reference &quot;lst:Creating-the-EM-directly&quot;
 
 \end_inset
@@ -1104,9 +1233,15 @@ java:comp/env/persistence/&lt;module name&gt;
 \begin_inset Foot
 status open
 
-\begin_layout Standard
-\begin_inset LatexCommand htmlurl
-target &quot;http://database.in2p3.fr/doc/oracle/Oracle_Application_Server_10_Release_3/web.1013/b28221/servjndi010.htm&quot;
+\begin_layout Plain Layout
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+http://database.in2p3.fr/doc/oracle/Oracle_Application_Server_10_Release_3/web.1013
+/b28221/servjndi010.htm
+\end_layout
 
 \end_inset
 
@@ -1118,7 +1253,8 @@ target &quot;http://database.in2p3.fr/doc/oracle/Oracle_Application_Server_10_Release
 .
  We'll cover how to set up JNDI on lightweight containers like Tomcat and
  Jetty in section 
-\begin_inset LatexCommand vref
+\begin_inset CommandInset ref
+LatexCommand vref
 reference &quot;sec:Setting-up-JNDI-jetty&quot;
 
 \end_inset
@@ -1126,7 +1262,8 @@ reference &quot;sec:Setting-up-JNDI-jetty&quot;
 , but for now we'll concentrate on the client side of things.
  We define our openEM method using the javax.naming.InitialContext class to
  obtain the EM from JNDI, as shown in listing 
-\begin_inset LatexCommand vref
+\begin_inset CommandInset ref
+LatexCommand vref
 reference &quot;lst:EM-Via-JNDI&quot;
 
 \end_inset
@@ -1138,14 +1275,22 @@ reference &quot;lst:EM-Via-JNDI&quot;
  we open begin and end the transaction outsid of the EM's lifecycle.
  In a production application you would want to put these steps into a try/catch
  or use LiftRules.browserResponseToException
-\begin_inset LatexCommand index
-name &quot;browserResponseToException&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+browserResponseToException
+\end_layout
 
 \end_inset
 
 
-\begin_inset LatexCommand index
-name &quot;LiftRules&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+LiftRules
+\end_layout
 
 \end_inset
 
@@ -1153,7 +1298,7 @@ name &quot;LiftRules&quot;
 \begin_inset Note Note
 status open
 
-\begin_layout Standard
+\begin_layout Plain Layout
 TODO: cross-ref
 \end_layout
 
@@ -1179,8 +1324,12 @@ However you obtain the EM, the general principles of how you use the EM
 
 \begin_layout Subsection
 Transactions
-\begin_inset LatexCommand index
-name &quot;Transactions&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+Transactions
+\end_layout
 
 \end_inset
 
@@ -1193,9 +1342,14 @@ We're not going to go into too much detail here; there are better documents
 \begin_inset Foot
 status open
 
-\begin_layout Standard
-\begin_inset LatexCommand htmlurl
-target &quot;http://java.sun.com/developer/EJTechTips/2005/tt0125.html&quot;
+\begin_layout Plain Layout
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+http://java.sun.com/developer/EJTechTips/2005/tt0125.html
+\end_layout
 
 \end_inset
 
@@ -1222,7 +1376,8 @@ In JPA, transactions are required.
  JTA.
  Resource local transactions are what you use if you are managing the EM
  factory yourself (section 
-\begin_inset LatexCommand ref
+\begin_inset CommandInset ref
+LatexCommand ref
 reference &quot;lst:Creating-the-EM-directly&quot;
 
 \end_inset
@@ -1232,7 +1387,8 @@ reference &quot;lst:Creating-the-EM-directly&quot;
  Choosing between the two is as simple as setting a property in your persistence.
 xml file (and changing the code to open and close the EM).
  Listing 
-\begin_inset LatexCommand ref
+\begin_inset CommandInset ref
+LatexCommand ref
 reference &quot;lst:Setting-the-transaction-type&quot;
 
 \end_inset
@@ -1255,16 +1411,17 @@ transaction-type
 
 \begin_layout Standard
 \begin_inset listings
-lstparams &quot;basicstyle={\scriptsize},float,frame=single,language=XML&quot;
+lstparams &quot;float,language=XML&quot;
 inline false
 status open
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
 \begin_inset Caption
 
-\begin_layout Standard
-\begin_inset LatexCommand label
+\begin_layout Plain Layout
+\begin_inset CommandInset label
+LatexCommand label
 name &quot;lst:Setting-the-transaction-type&quot;
 
 \end_inset
@@ -1277,26 +1434,26 @@ Setting the transaction type
 
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
 &lt;persistence-unit name=&quot;jpaweb&quot; transaction-type=&quot;RESOURCE_LOCAL&quot;&gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
   &lt;non-jta-datasource&gt;myDS&lt;/non-jta-datasource&gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
 &lt;persistence-unit name=&quot;jpaweb&quot; transaction-type=&quot;JTA&quot;&gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
   &lt;non-jta-datasource&gt;myDS&lt;/jta-datasource&gt;
 \end_layout
@@ -1323,7 +1480,8 @@ jta-data-source
 non-jta-datasource
 \family default
  element or you can set the provider properties, as shown in listing 
-\begin_inset LatexCommand vref
+\begin_inset CommandInset ref
+LatexCommand vref
 reference &quot;lst:Setting-resource-local-properties&quot;
 
 \end_inset
@@ -1334,9 +1492,15 @@ reference &quot;lst:Setting-resource-local-properties&quot;
 \begin_inset Foot
 status open
 
-\begin_layout Standard
-\begin_inset LatexCommand htmlurl
-target &quot;http://www.oracle.com/technology/products/ias/toplink/JPA/essentials/toplink-jpa-extensions.html&quot;
+\begin_layout Plain Layout
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+http://www.oracle.com/technology/products/ias/toplink/JPA/essentials/toplink-jpa-e
+xtensions.html
+\end_layout
 
 \end_inset
 
@@ -1349,9 +1513,14 @@ target &quot;http://www.oracle.com/technology/products/ias/toplink/JPA/essentials/top
 \begin_inset Foot
 status open
 
-\begin_layout Standard
-\begin_inset LatexCommand htmlurl
-target &quot;http://www.jpox.org/docs/1_2/persistence_unit.html&quot;
+\begin_layout Plain Layout
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+http://www.jpox.org/docs/1_2/persistence_unit.html
+\end_layout
 
 \end_inset
 
@@ -1377,16 +1546,17 @@ ion when you use JNDI.
 
 \begin_layout Standard
 \begin_inset listings
-lstparams &quot;basicstyle={\scriptsize},breaklines=true,float,frame=single,language=XML,numbers=left,numberstyle={\tiny}&quot;
+lstparams &quot;breaklines=true,float,language=XML,numbers=left,numberstyle={\tiny}&quot;
 inline false
 status open
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
 \begin_inset Caption
 
-\begin_layout Standard
-\begin_inset LatexCommand label
+\begin_layout Plain Layout
+\begin_inset CommandInset label
+LatexCommand label
 name &quot;lst:Setting-resource-local-properties&quot;
 
 \end_inset
@@ -1399,60 +1569,60 @@ Setting resource-local properties for Hibernate
 
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
 &lt;persistence&gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
    &lt;persistence-unit name=&quot;jpaweb&quot; transaction-type=&quot;RESOURCE_LOCAL&quot;&gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
       &lt;properties&gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
          &lt;property name=&quot;hibernate.dialect&quot; value=&quot;org.hibernate.dialect.PostgreSQLD
 ialect&quot;/&gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
          &lt;property name=&quot;hibernate.connection.driver_class&quot; value=&quot;org.postgresql.Dr
 iver&quot;/&gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
          &lt;property name=&quot;hibernate.connection.username&quot; value=&quot;somUser&quot;/&gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
          &lt;property name=&quot;hibernate.connection.password&quot; value=&quot;somePass&quot;/&gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
          &lt;property name=&quot;hibernate.connection.url&quot; value=&quot;jdbc:postgresql:jpaweb&quot;/
 &gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
       &lt;/properties&gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
    &lt;/persistence-unit&gt;
 \end_layout
 
-\begin_layout Standard
+\begin_layout Plain Layout
 
 &lt;/persistence&gt;
 \end_layout
@@ -1477,7 +1647,8 @@ javax.persistence.NonUniqueResultException
 \end_layout
 
 \begin_layout Section
-\begin_inset LatexCommand label
+\begin_inset CommandInset label
+LatexCommand label
 name &quot;sec:ScalaEntityManager-and-ScalaQuery&quot;
 
 \end_inset
@@ -1493,9 +1664,14 @@ r
 \begin_inset Foot
 status collapsed
 
-\begin_layout Standard
-\begin_inset LatexCommand htmlurl
-target &quot;http://java.sun.com/javaee/5/docs/api/javax/persistence/EntityManager.html&quot;
+\begin_layout Plain Layout
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+http://java.sun.com/javaee/5/docs/api/javax/persistence/EntityManager.html
+\end_layout
 
 \end_inset
 
@@ -1508,9 +1684,14 @@ target &quot;http://java.sun.com/javaee/5/docs/api/javax/persistence/EntityManager.ht
 \begin_inset Foot
 status collapsed
 
-\begin_layout Standard
-\begin_inset LatexCommand htmlurl
-target &quot;http://java.sun.com/javaee/5/docs/api/javax/persistence/Query.html&quot;
+\begin_layout Plain Layout
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+http://java.sun.com/javaee/5/docs/api/javax/persistence/Query.html
+\end_layout
 
 \end_inset
 
@@ -1524,7 +1705,8 @@ target &quot;http://java.sun.com/javaee/5/docs/api/javax/persistence/Query.html&quot;
  List instead of java.util.List) and generic signatures so that we can avoid
  explicit casting.
  Listing 
-\begin_inset LatexCommand vref
+\begin_inset CommandInset ref
+LatexCommand vref
 reference &quot;lst:ScalaEntityManager&quot;
 
 \end_inset
@@ -1532,7 +1714,8 @@ reference &quot;lst:ScalaEntityManager&quot;
  shows the ScalaEntityManager class.
  We start with the method and RequestVar definitions that we discussed in
  section 
-\begin_inset LatexCommand ref
+\begin_inset CommandInset ref
+LatexCommand ref
 reference &quot;sec:Obtaining-an-EM&quot;
 
 \end_inset
@@ -1546,7 +1729,8 @@ reference &quot;sec:Obtaining-an-EM&quot;
 
 \begin_layout Standard
 Next, we have the ScalaQuery class in listing 
-\begin_inset LatexCommand vref
+\begin_inset CommandInset ref
+LatexCommand vref
 reference &quot;lst:ScalaQuery&quot;
 
 \end_inset
@@ -1562,7 +1746,8 @@ reference &quot;lst:ScalaQuery&quot;
 \end_layout
 
 \begin_layout Section
-\begin_inset LatexCommand label
+\begin_inset CommandInset label
+LatexCommand label
 name &quot;sec:JPA-Examples&quot;
 
 \end_inset
@@ -1577,7 +1762,8 @@ We find it helpful to solidify what we've discussed here with some concrete
 \end_layout
 
 \begin_layout Subsection
-\begin_inset LatexCommand label
+\begin_inset CommandInset label
+LatexCommand label
 name &quot;sub:Persisting,-merging-and-removing&quot;
 
 \end_inset
@@ -1603,7 +1789,8 @@ Model.persist(myNewAuthor)
 This attaches the myNewAuthor object to the current persistence session.
  Once the object is attached it should be visible in any subsequent queries,
  although it may not be written to the database just yet (see section 
-\begin_inset LatexCommand ref
+\begin_inset CommandInset ref
+LatexCommand ref
 reference &quot;sub:The-importance-of-flush&quot;
 
 \end_inset
@@ -1677,7 +1864,8 @@ The passed entity is detached from the session immediately and will be removed
  If the entity has any associations on it (to collections or other entities),
  they will be cascaded as indicated by the entity mapping.
  An example of a cascade is shown in the Author listing on page 
-\begin_inset LatexCommand pageref
+\begin_inset CommandInset ref
+LatexCommand pageref
 reference &quot;lst:Author.scala&quot;
 
 \end_inset
@@ -1717,7 +1905,7 @@ find
 \begin_inset Note Note
 status open
 
-\begin_layout Standard
+\begin_layout Plain Layout
 Jorge has pointed out that this may change: http://groups.google.com/group/liftweb
 /browse_thread/thread/874b38daa0d535f7
 \end_layout
@@ -1744,7 +1932,7 @@ find
 \begin_inset Note Note
 status open
 
-\begin_layout Standard
+\begin_layout Plain Layout
 TODO: cross-ref
 \end_layout
 
@@ -1899,19 +2087,28 @@ paramName
 
  -&gt; value).
  Named queries
-\begin_inset LatexCommand index
-name &quot;named queries&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+named queries
+\end_layout
 
 \end_inset
 
  can be defined in your orm.xml
-\begin_inset LatexCommand index
-name &quot;orm.xml&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+orm.xml
+\end_layout
 
 \end_inset
 
 , as shown in section 
-\begin_inset LatexCommand vref
+\begin_inset CommandInset ref
+LatexCommand vref
 reference &quot;sub:Using-the-orm.xml&quot;
 
 \end_inset
@@ -1984,7 +2181,10 @@ In general we recommend that you use named queries throughout your code.
 
 \begin_layout List
 \labelwidthstring 00.00.0000
-Named\InsetSpace ~
+Named
+\begin_inset space ~
+\end_inset
+
 parameters 
 \family typewriter
 select user from User where (user.name like :searchString or user.email like
@@ -1993,7 +2193,10 @@ select user from User where (user.name like :searchString or user.email like
 
 \begin_layout List
 \labelwidthstring 00.00.0000
-Positional\InsetSpace ~
+Positional
+\begin_inset space ~
+\end_inset
+
 parameters 
 \family typewriter
 select user from User where (user.name like ? or user.email like ?) and user.widget
@@ -2027,8 +2230,13 @@ In any case, you should generally use the parameterized query types as opposed
  opens up your site to SQL injection attacks unless you're very careful.
  For more information on queries there's an excellent reference for the
  EJBQL on the Hibernate website at 
-\begin_inset LatexCommand htmlurl
-target &quot;http://www.hibernate.org/hib_docs/entitymanager/reference/en/html/queryhql.html&quot;
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+http://www.hibernate.org/hib_docs/entitymanager/reference/en/html/queryhql.html
+\end_layout
 
 \end_inset
 
@@ -2050,9 +2258,14 @@ scala.collection.jcl.BufferWrapper
 \begin_inset Foot
 status collapsed
 
-\begin_layout Standard
-\begin_inset LatexCommand htmlurl
-target &quot;http://java.sun.com/docs/books/tutorial/collections/index.html&quot;
+\begin_layout Plain Layout
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+http://java.sun.com/docs/books/tutorial/collections/index.html
+\end_layout
 
 \end_inset
 
@@ -2075,8 +2288,12 @@ under the hood
  Fortunately, Scala has a very nice framework for wrapping Java collections.
  In particular, the scala.collection.jcl.Conversions class contains a number
  of implicit conversions
-\begin_inset LatexCommand index
-name &quot;implicit conversions&quot;
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+implicit conversions
+\end_layout
 
 \end_inset
 
@@ -2099,7 +2316,8 @@ val suspenseful = author.books.exists(_.genre = Genre.Mystery)
 \end_layout
 
 \begin_layout Subsection
-\begin_inset LatexCommand label
+\begin_inset CommandInset label
+LatexCommand label
 name &quot;sub:The-importance-of-flush&quot;
 
 \end_inset
@@ -2117,7 +2335,8 @@ It's important to understand that in JPA the provider isn't required to
  violations.
  As a convenience, we've written methods to do persist, merge and remove
  with a subsequent flush, as shown in listing 
-\begin_inset LatexCommand vref
+\begin_inset CommandInset ref
+LatexCommand vref
 reference &quot;lst:ScalaEntityManager&quot;
 
 \end_inset</diff>
      <filename>chap-JPA.lyx</filename>
    </modified>
    <modified>
      <diff>@@ -461,6 +461,7 @@ http://groups.google.com/group/liftweb
 status collapsed
 
 \begin_layout Plain Layout
+
 http://groups.google.com/group/the-lift-book
 \end_layout
 
@@ -1328,7 +1329,6 @@ src/main/scala/demo/helloworld/snippet/HelloWorld.scala
 
 \begin_layout Standard
 \begin_inset listings
-lstparams &quot;basicstyle={\scriptsize},frame=lines&quot;
 inline false
 status open
 
@@ -1417,7 +1417,7 @@ bootstrap.liftweb
 
 \begin_layout Standard
 \begin_inset listings
-lstparams &quot;basicstyle={\scriptsize},firstline=13,frame=lines&quot;
+lstparams &quot;firstline=13&quot;
 inline false
 status open
 </diff>
      <filename>chap-welcome.lyx</filename>
    </modified>
    <modified>
      <diff>@@ -19,8 +19,11 @@ morecomment=[l]{//},
 morecomment=[s]{/*}{*/},
 morestring=[b]&quot;}
 
+%\font\ttfinconsolata Inconsolata
+%\renewcommand{\ttdefault}{Inconsolata}
+
 % Default settings for code listings
-\lstset{frame=tb,language=scala,basicstyle=\small\ttfamily,aboveskip=3mm,belowskip=3mm,showstringspaces=false,columns=flexible,keywordstyle=\bfseries}
+\lstset{frame=tb,language=scala,aboveskip=3mm,belowskip=3mm,showstringspaces=false,columns=flexible,basicstyle={\small\ttfamily}}
 
 % Fix the List of Listings title
 \renewcommand{\lstlistlistingname}{List of Listings}
@@ -30,7 +33,7 @@ morestring=[b]&quot;}
 \inputencoding auto
 \font_roman palatino
 \font_sans default
-\font_typewriter default
+\font_typewriter courier
 \font_default_family default
 \font_sc false
 \font_osf false</diff>
      <filename>master.lyx</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>27d86bfdac00c8eaa61eb2eeffe4cb9608675485</id>
    </parent>
  </parents>
  <author>
    <name>Derek Chen-Becker</name>
    <email>github@chen-becker.org</email>
  </author>
  <url>http://github.com/tjweir/liftbook/commit/1b925ab68cb4494fe59d93d824d58c2417e6e9c4</url>
  <id>1b925ab68cb4494fe59d93d824d58c2417e6e9c4</id>
  <committed-date>2008-12-22T08:51:40-08:00</committed-date>
  <authored-date>2008-12-22T08:51:40-08:00</authored-date>
  <message>Some tweaking before alpha release.</message>
  <tree>dcd63c901591c7c123dfa13c34111a2eb7f10220</tree>
  <committer>
    <name>Derek Chen-Becker</name>
    <email>github@chen-becker.org</email>
  </committer>
</commit>
