blob: aa2c539e3c9cfcaabc3d66aa30c2f734f40906da [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?><fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="serif,Symbol,ZapfDingbats" font-size="10pt" text-align="left" line-height="normal" font-selection-strategy="character-by-character" line-height-shift-adjustment="disregard-shifts" language="en"><fo:layout-master-set><fo:simple-page-master master-name="blank" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body display-align="center" margin-bottom="0.88in" margin-top="0.5in"/><fo:region-before region-name="xsl-region-before-blank" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-blank" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="titlepage-first" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1"/><fo:region-before region-name="xsl-region-before-first" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-first" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="titlepage-odd" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1"/><fo:region-before region-name="xsl-region-before-odd" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-odd" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="titlepage-even" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1"/><fo:region-before region-name="xsl-region-before-even" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-even" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="lot-first" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1"/><fo:region-before region-name="xsl-region-before-first" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-first" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="lot-odd" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1"/><fo:region-before region-name="xsl-region-before-odd" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-odd" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="lot-even" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1"/><fo:region-before region-name="xsl-region-before-even" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-even" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="front-first" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1"/><fo:region-before region-name="xsl-region-before-first" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-first" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="front-odd" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1"/><fo:region-before region-name="xsl-region-before-odd" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-odd" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="front-even" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1"/><fo:region-before region-name="xsl-region-before-even" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-even" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="body-first" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1"/><fo:region-before region-name="xsl-region-before-first" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-first" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="body-odd" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1"/><fo:region-before region-name="xsl-region-before-odd" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-odd" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="body-even" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1"/><fo:region-before region-name="xsl-region-before-even" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-even" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="back-first" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1"/><fo:region-before region-name="xsl-region-before-first" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-first" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="back-odd" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1"/><fo:region-before region-name="xsl-region-before-odd" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-odd" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="back-even" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1"/><fo:region-before region-name="xsl-region-before-even" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-even" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="index-first" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="2"/><fo:region-before region-name="xsl-region-before-first" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-first" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="index-odd" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="2"/><fo:region-before region-name="xsl-region-before-odd" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-odd" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="index-even" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="2"/><fo:region-before region-name="xsl-region-before-even" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-even" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="blank-draft" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" background-image="http://docbook.sourceforge.net/release/images/draft.png" background-attachment="fixed" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center"/><fo:region-before region-name="xsl-region-before-blank" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-blank" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="titlepage-first-draft" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1" background-image="http://docbook.sourceforge.net/release/images/draft.png" background-attachment="fixed" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center"/><fo:region-before region-name="xsl-region-before-first" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-first" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="titlepage-odd-draft" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1" background-image="http://docbook.sourceforge.net/release/images/draft.png" background-attachment="fixed" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center"/><fo:region-before region-name="xsl-region-before-odd" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-odd" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="titlepage-even-draft" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1" background-image="http://docbook.sourceforge.net/release/images/draft.png" background-attachment="fixed" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center"/><fo:region-before region-name="xsl-region-before-even" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-even" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="lot-first-draft" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1" background-image="http://docbook.sourceforge.net/release/images/draft.png" background-attachment="fixed" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center"/><fo:region-before region-name="xsl-region-before-first" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-first" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="lot-odd-draft" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1" background-image="http://docbook.sourceforge.net/release/images/draft.png" background-attachment="fixed" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center"/><fo:region-before region-name="xsl-region-before-odd" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-odd" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="lot-even-draft" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1" background-image="http://docbook.sourceforge.net/release/images/draft.png" background-attachment="fixed" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center"/><fo:region-before region-name="xsl-region-before-even" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-even" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="front-first-draft" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1" background-image="http://docbook.sourceforge.net/release/images/draft.png" background-attachment="fixed" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center"/><fo:region-before region-name="xsl-region-before-first" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-first" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="front-odd-draft" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1" background-image="http://docbook.sourceforge.net/release/images/draft.png" background-attachment="fixed" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center"/><fo:region-before region-name="xsl-region-before-odd" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-odd" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="front-even-draft" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1" background-image="http://docbook.sourceforge.net/release/images/draft.png" background-attachment="fixed" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center"/><fo:region-before region-name="xsl-region-before-even" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-even" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="body-first-draft" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1" background-image="http://docbook.sourceforge.net/release/images/draft.png" background-attachment="fixed" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center"/><fo:region-before region-name="xsl-region-before-first" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-first" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="body-odd-draft" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1" background-image="http://docbook.sourceforge.net/release/images/draft.png" background-attachment="fixed" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center"/><fo:region-before region-name="xsl-region-before-odd" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-odd" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="body-even-draft" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1" background-image="http://docbook.sourceforge.net/release/images/draft.png" background-attachment="fixed" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center"/><fo:region-before region-name="xsl-region-before-even" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-even" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="back-first-draft" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1" background-image="http://docbook.sourceforge.net/release/images/draft.png" background-attachment="fixed" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center"/><fo:region-before region-name="xsl-region-before-first" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-first" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="back-odd-draft" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1" background-image="http://docbook.sourceforge.net/release/images/draft.png" background-attachment="fixed" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center"/><fo:region-before region-name="xsl-region-before-odd" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-odd" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="back-even-draft" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in - -4pc" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="1" background-image="http://docbook.sourceforge.net/release/images/draft.png" background-attachment="fixed" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center"/><fo:region-before region-name="xsl-region-before-even" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-even" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="index-first-draft" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="2" background-image="http://docbook.sourceforge.net/release/images/draft.png" background-attachment="fixed" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center"/><fo:region-before region-name="xsl-region-before-first" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-first" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="index-odd-draft" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-left="0.3in" margin-right="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="2" background-image="http://docbook.sourceforge.net/release/images/draft.png" background-attachment="fixed" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center"/><fo:region-before region-name="xsl-region-before-odd" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-odd" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:simple-page-master master-name="index-even-draft" page-width="8.5in" page-height="11in" margin-top="0.5in" margin-bottom="0.01in" margin-right="0.3in" margin-left="0.3in"><fo:region-body margin-bottom="0.88in" margin-top="0.5in" column-gap="12pt" column-count="2" background-image="http://docbook.sourceforge.net/release/images/draft.png" background-attachment="fixed" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center"/><fo:region-before region-name="xsl-region-before-even" extent="0.4in" display-align="before"/><fo:region-after region-name="xsl-region-after-even" extent="0.4in" display-align="after"/></fo:simple-page-master><fo:page-sequence-master master-name="titlepage"><fo:repeatable-page-master-alternatives><fo:conditional-page-master-reference master-reference="blank" blank-or-not-blank="blank"/><fo:conditional-page-master-reference master-reference="titlepage-first" page-position="first"/><fo:conditional-page-master-reference master-reference="titlepage-odd" odd-or-even="odd"/><fo:conditional-page-master-reference odd-or-even="even" master-reference="titlepage-odd"/></fo:repeatable-page-master-alternatives></fo:page-sequence-master><fo:page-sequence-master master-name="lot"><fo:repeatable-page-master-alternatives><fo:conditional-page-master-reference master-reference="blank" blank-or-not-blank="blank"/><fo:conditional-page-master-reference master-reference="lot-first" page-position="first"/><fo:conditional-page-master-reference master-reference="lot-odd" odd-or-even="odd"/><fo:conditional-page-master-reference odd-or-even="even" master-reference="lot-odd"/></fo:repeatable-page-master-alternatives></fo:page-sequence-master><fo:page-sequence-master master-name="front"><fo:repeatable-page-master-alternatives><fo:conditional-page-master-reference master-reference="blank" blank-or-not-blank="blank"/><fo:conditional-page-master-reference master-reference="front-first" page-position="first"/><fo:conditional-page-master-reference master-reference="front-odd" odd-or-even="odd"/><fo:conditional-page-master-reference odd-or-even="even" master-reference="front-odd"/></fo:repeatable-page-master-alternatives></fo:page-sequence-master><fo:page-sequence-master master-name="body"><fo:repeatable-page-master-alternatives><fo:conditional-page-master-reference master-reference="blank" blank-or-not-blank="blank"/><fo:conditional-page-master-reference master-reference="body-first" page-position="first"/><fo:conditional-page-master-reference master-reference="body-odd" odd-or-even="odd"/><fo:conditional-page-master-reference odd-or-even="even" master-reference="body-odd"/></fo:repeatable-page-master-alternatives></fo:page-sequence-master><fo:page-sequence-master master-name="back"><fo:repeatable-page-master-alternatives><fo:conditional-page-master-reference master-reference="blank" blank-or-not-blank="blank"/><fo:conditional-page-master-reference master-reference="back-first" page-position="first"/><fo:conditional-page-master-reference master-reference="back-odd" odd-or-even="odd"/><fo:conditional-page-master-reference odd-or-even="even" master-reference="back-odd"/></fo:repeatable-page-master-alternatives></fo:page-sequence-master><fo:page-sequence-master master-name="index"><fo:repeatable-page-master-alternatives><fo:conditional-page-master-reference master-reference="blank" blank-or-not-blank="blank"/><fo:conditional-page-master-reference master-reference="index-first" page-position="first"/><fo:conditional-page-master-reference master-reference="index-odd" odd-or-even="odd"/><fo:conditional-page-master-reference odd-or-even="even" master-reference="index-odd"/></fo:repeatable-page-master-alternatives></fo:page-sequence-master><fo:page-sequence-master master-name="titlepage-draft"><fo:repeatable-page-master-alternatives><fo:conditional-page-master-reference master-reference="blank-draft" blank-or-not-blank="blank"/><fo:conditional-page-master-reference master-reference="titlepage-first-draft" page-position="first"/><fo:conditional-page-master-reference master-reference="titlepage-odd-draft" odd-or-even="odd"/><fo:conditional-page-master-reference odd-or-even="even" master-reference="titlepage-odd-draft"/></fo:repeatable-page-master-alternatives></fo:page-sequence-master><fo:page-sequence-master master-name="lot-draft"><fo:repeatable-page-master-alternatives><fo:conditional-page-master-reference master-reference="blank-draft" blank-or-not-blank="blank"/><fo:conditional-page-master-reference master-reference="lot-first-draft" page-position="first"/><fo:conditional-page-master-reference master-reference="lot-odd-draft" odd-or-even="odd"/><fo:conditional-page-master-reference odd-or-even="even" master-reference="lot-odd-draft"/></fo:repeatable-page-master-alternatives></fo:page-sequence-master><fo:page-sequence-master master-name="front-draft"><fo:repeatable-page-master-alternatives><fo:conditional-page-master-reference master-reference="blank-draft" blank-or-not-blank="blank"/><fo:conditional-page-master-reference master-reference="front-first-draft" page-position="first"/><fo:conditional-page-master-reference master-reference="front-odd-draft" odd-or-even="odd"/><fo:conditional-page-master-reference odd-or-even="even" master-reference="front-odd-draft"/></fo:repeatable-page-master-alternatives></fo:page-sequence-master><fo:page-sequence-master master-name="body-draft"><fo:repeatable-page-master-alternatives><fo:conditional-page-master-reference master-reference="blank-draft" blank-or-not-blank="blank"/><fo:conditional-page-master-reference master-reference="body-first-draft" page-position="first"/><fo:conditional-page-master-reference master-reference="body-odd-draft" odd-or-even="odd"/><fo:conditional-page-master-reference odd-or-even="even" master-reference="body-odd-draft"/></fo:repeatable-page-master-alternatives></fo:page-sequence-master><fo:page-sequence-master master-name="back-draft"><fo:repeatable-page-master-alternatives><fo:conditional-page-master-reference master-reference="blank-draft" blank-or-not-blank="blank"/><fo:conditional-page-master-reference master-reference="back-first-draft" page-position="first"/><fo:conditional-page-master-reference master-reference="back-odd-draft" odd-or-even="odd"/><fo:conditional-page-master-reference odd-or-even="even" master-reference="back-odd-draft"/></fo:repeatable-page-master-alternatives></fo:page-sequence-master><fo:page-sequence-master master-name="index-draft"><fo:repeatable-page-master-alternatives><fo:conditional-page-master-reference master-reference="blank-draft" blank-or-not-blank="blank"/><fo:conditional-page-master-reference master-reference="index-first-draft" page-position="first"/><fo:conditional-page-master-reference master-reference="index-odd-draft" odd-or-even="odd"/><fo:conditional-page-master-reference odd-or-even="even" master-reference="index-odd-draft"/></fo:repeatable-page-master-alternatives></fo:page-sequence-master></fo:layout-master-set><fox:outline xmlns:fox="http://xml.apache.org/fop/extensions" internal-destination="manual"><fox:label>Apache OpenJPA User's Guide</fox:label></fox:outline><fox:outline xmlns:fox="http://xml.apache.org/fop/extensions" internal-destination="toc...manual"><fox:label>Table of Contents</fox:label></fox:outline><fox:outline xmlns:fox="http://xml.apache.org/fop/extensions" internal-destination="introduction"><fox:label>Part 1. Introduction</fox:label><fox:outline internal-destination="openjpa_intro"><fox:label>Chapter 1.  OpenJPA</fox:label><fox:outline internal-destination="openjpa_intro_about"><fox:label>1.1.  About This Document</fox:label></fox:outline><fox:destination internal-destination="openjpa_intro_about"/></fox:outline><fox:destination internal-destination="openjpa_intro"/></fox:outline><fox:destination xmlns:fox="http://xml.apache.org/fop/extensions" internal-destination="introduction"/><fox:outline xmlns:fox="http://xml.apache.org/fop/extensions" internal-destination="jpa_overview"><fox:label>Part 2. Java Persistence API</fox:label><fox:outline internal-destination="jpa_overview_intro"><fox:label>Chapter 1.  Introduction</fox:label><fox:outline internal-destination="jpa_overview_intro_audience"><fox:label>1.1.  Intended Audience</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_intro_audience"/><fox:outline internal-destination="jpa_overview_intro_transpers"><fox:label>1.2.  Lightweight Persistence</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_intro_transpers"/></fox:outline><fox:destination internal-destination="jpa_overview_intro"/><fox:outline internal-destination="jpa_overview_why"><fox:label>Chapter 2.  Why JPA?</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_why"/><fox:outline internal-destination="jpa_overview_arch"><fox:label>Chapter 3.  Java Persistence API Architecture</fox:label><fox:destination internal-destination="jpa_overview_arch_interact_outside"/><fox:destination internal-destination="jpa_overview_arch_interact_inside"/><fox:outline internal-destination="jpa_overview_arch_exceptions"><fox:label>3.1.  JPA Exceptions</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_arch_exceptions"/></fox:outline><fox:destination internal-destination="jpa_overview_arch"/><fox:outline internal-destination="jpa_overview_pc"><fox:label>Chapter 4.  Entity</fox:label><fox:destination internal-destination="jpa_overview_pc_pcclass"/><fox:outline internal-destination="jpa_overview_pc_restrict"><fox:label>4.1.  Restrictions on Persistent Classes</fox:label><fox:outline internal-destination="jpa_overview_pc_no_arg"><fox:label>4.1.1.  Default or No-Arg Constructor</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_pc_no_arg"/><fox:outline internal-destination="jpa_overview_pc_final"><fox:label>4.1.2.  Final</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_pc_final"/><fox:outline internal-destination="jpa_overview_pc_id"><fox:label>4.1.3.  Identity Fields</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_pc_id"/><fox:outline internal-destination="jpa_overview_pc_version"><fox:label>4.1.4.  Version Field</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_pc_version"/><fox:outline internal-destination="jpa_overview_pc_restrict_inheritance"><fox:label>4.1.5.  Inheritance</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_pc_restrict_inheritance"/><fox:outline internal-destination="jpa_overview_pc_restrict_fields"><fox:label>4.1.6.  Persistent Fields</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_pc_restrict_fields"/><fox:outline internal-destination="jpa_overview_pc_restrict_conclusion"><fox:label>4.1.7.  Conclusions</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_pc_restrict_conclusion"/></fox:outline><fox:destination internal-destination="jpa_overview_pc_restrict"/><fox:outline internal-destination="jpa_overview_pc_identity"><fox:label>4.2.  Entity Identity</fox:label><fox:outline internal-destination="jpa_overview_pc_identitycls"><fox:label>4.2.1.  Identity Class</fox:label><fox:destination internal-destination="jpa_overview_pc_identity_appidcode"/><fox:outline internal-destination="jpa_overview_pc_identity_hierarchy"><fox:label>4.2.1.1.  Identity Hierarchies</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_pc_identity_hierarchy"/></fox:outline><fox:destination internal-destination="jpa_overview_pc_identitycls"/></fox:outline><fox:destination internal-destination="jpa_overview_pc_identity"/><fox:outline internal-destination="jpa_overview_pc_callbacks"><fox:label>4.3.  Lifecycle Callbacks</fox:label><fox:outline internal-destination="jpa_overview_pc_callbacks_methods"><fox:label>4.3.1.  Callback Methods</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_pc_callbacks_methods"/><fox:outline internal-destination="jpa_overview_callbacks_using"><fox:label>4.3.2.  Using Callback Methods</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_callbacks_using"/><fox:outline internal-destination="jpa_overview_entity_listeners_using"><fox:label>4.3.3.  Using Entity Listeners</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_entity_listeners_using"/><fox:outline internal-destination="jpa_overview_entity_listeners_exclude"><fox:label>4.3.4.  Entity Listeners Hierarchy</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_entity_listeners_exclude"/></fox:outline><fox:destination internal-destination="jpa_overview_pc_callbacks"/><fox:outline internal-destination="jpa_overview_pc_conclusion"><fox:label>4.4.  Conclusions</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_pc_conclusion"/></fox:outline><fox:destination internal-destination="jpa_overview_pc"/><fox:outline internal-destination="jpa_overview_meta"><fox:label>Chapter 5.  Metadata</fox:label><fox:outline internal-destination="jpa_overview_meta_class"><fox:label>5.1.  Class Metadata</fox:label><fox:outline internal-destination="jpa_overview_meta_entity"><fox:label>5.1.1.  Entity</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_entity"/><fox:outline internal-destination="jpa_overview_meta_idclass"><fox:label>5.1.2.  Id Class</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_idclass"/><fox:outline internal-destination="jpa_overview_meta_embeddablesuper"><fox:label>5.1.3.  Mapped Superclass</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_embeddablesuper"/><fox:outline internal-destination="jpa_overview_meta_embeddable"><fox:label>5.1.4.  Embeddable</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_embeddable"/><fox:outline internal-destination="jpa_overview_meta_entity_listeners"><fox:label>5.1.5.  EntityListeners</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_entity_listeners"/><fox:outline internal-destination="jpa_overview_meta_classex"><fox:label>5.1.6.  Example</fox:label><fox:destination internal-destination="jpa_overview_meta_classlisting"/></fox:outline><fox:destination internal-destination="jpa_overview_meta_classex"/></fox:outline><fox:destination internal-destination="jpa_overview_meta_class"/><fox:outline internal-destination="jpa_overview_meta_field"><fox:label>5.2.  Field and Property Metadata</fox:label><fox:outline internal-destination="jpa_overview_meta_transient"><fox:label>5.2.1.  Transient</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_transient"/><fox:outline internal-destination="jpa_overview_meta_id"><fox:label>5.2.2.  Id</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_id"/><fox:outline internal-destination="jpa_overview_meta_gen"><fox:label>5.2.3.  Generated Value</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_gen"/><fox:outline internal-destination="jpa_overview_meta_embedid"><fox:label>5.2.4.  Embedded Id</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_embedid"/><fox:outline internal-destination="jpa_overview_meta_version"><fox:label>5.2.5.  Version</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_version"/><fox:outline internal-destination="jpa_overview_meta_basic"><fox:label>5.2.6.  Basic</fox:label><fox:outline internal-destination="jpa_overview_meta_fetch"><fox:label>5.2.6.1.  Fetch Type</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_fetch"/></fox:outline><fox:destination internal-destination="jpa_overview_meta_basic"/><fox:outline internal-destination="jpa_overview_meta_embedded"><fox:label>5.2.7.  Embedded</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_embedded"/><fox:outline internal-destination="jpa_overview_meta_manytoone"><fox:label>5.2.8.  Many To One</fox:label><fox:outline internal-destination="jpa_overview_meta_cascade"><fox:label>5.2.8.1.  Cascade Type</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_cascade"/></fox:outline><fox:destination internal-destination="jpa_overview_meta_manytoone"/><fox:outline internal-destination="jpa_overview_meta_onetomany"><fox:label>5.2.9.  One To Many</fox:label><fox:outline internal-destination="jpa_overview_meta_mappedby"><fox:label>5.2.9.1.  Bidirectional Relations</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_mappedby"/></fox:outline><fox:destination internal-destination="jpa_overview_meta_onetomany"/><fox:outline internal-destination="jpa_overview_meta_onetoone"><fox:label>5.2.10.  One To One</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_onetoone"/><fox:outline internal-destination="jpa_overview_meta_manytomany"><fox:label>5.2.11.  Many To Many</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_manytomany"/><fox:outline internal-destination="jpa_overview_meta_orderby"><fox:label>5.2.12.  Order By</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_orderby"/><fox:outline internal-destination="jpa_overview_meta_mapkey"><fox:label>5.2.13.  Map Key</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_mapkey"/><fox:outline internal-destination="jpa_overview_meta_fielddefaults"><fox:label>5.2.14.  Persistent Field Defaults</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_fielddefaults"/></fox:outline><fox:destination internal-destination="jpa_overview_meta_field"/><fox:outline internal-destination="jpa_overview_meta_xml"><fox:label>5.3.  XML Schema</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_meta_xml"/><fox:outline internal-destination="jpa_overview_meta_complete"><fox:label>5.4.  Conclusion</fox:label><fox:destination internal-destination="jpa_overview_meta_complete_ex"/></fox:outline><fox:destination internal-destination="jpa_overview_meta_complete"/></fox:outline><fox:destination internal-destination="jpa_overview_meta"/><fox:outline internal-destination="jpa_overview_persistence"><fox:label>Chapter 6.  Persistence</fox:label><fox:outline internal-destination="jpa_overview_persistence_xml"><fox:label>6.1.  persistence.xml</fox:label><fox:destination internal-destination="jpa_overview_persistence_xmlex"/></fox:outline><fox:destination internal-destination="jpa_overview_persistence_xml"/><fox:outline internal-destination="jpa_overview_persistence_use"><fox:label>6.2.  Non-EE Use</fox:label><fox:destination internal-destination="jpa_overview_persistence_getemfactory"/></fox:outline><fox:destination internal-destination="jpa_overview_persistence_use"/></fox:outline><fox:destination internal-destination="jpa_overview_persistence"/><fox:outline internal-destination="jpa_overview_emfactory"><fox:label>Chapter 7.  EntityManagerFactory</fox:label><fox:outline internal-destination="jpa_overview_emfactory_obtain"><fox:label>7.1.  Obtaining an EntityManagerFactory</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_emfactory_obtain"/><fox:outline internal-destination="jpa_overview_emfactory_em"><fox:label>7.2.  Obtaining EntityManagers</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_emfactory_em"/><fox:outline internal-destination="jpa_overview_emfactory_perscontext"><fox:label>7.3.  Persistence Context</fox:label><fox:outline internal-destination="jpa_overview_emfactory_perscontext_trans"><fox:label>7.3.1.  Transaction Persistence Context</fox:label><fox:destination internal-destination="jpa_overview_emfactory_perscontext_transex"/></fox:outline><fox:destination internal-destination="jpa_overview_emfactory_perscontext_trans"/><fox:outline internal-destination="jpa_overview_emfactory_perscontext_extend"><fox:label>7.3.2.  Extended Persistence Context</fox:label><fox:destination internal-destination="jpa_overview_emfactory_perscontext_extendex"/></fox:outline><fox:destination internal-destination="jpa_overview_emfactory_perscontext_extend"/></fox:outline><fox:destination internal-destination="jpa_overview_emfactory_perscontext"/><fox:outline internal-destination="jpa_overview_emfactory_close"><fox:label>7.4.  Closing the EntityManagerFactory</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_emfactory_close"/></fox:outline><fox:destination internal-destination="jpa_overview_emfactory"/><fox:outline internal-destination="jpa_overview_em"><fox:label>Chapter 8.  EntityManager</fox:label><fox:outline internal-destination="jpa_overview_em_trans"><fox:label>8.1.  Transaction Association</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_em_trans"/><fox:outline internal-destination="jpa_overview_em_lifecycle"><fox:label>8.2.  Entity Lifecycle Management</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_em_lifecycle"/><fox:outline internal-destination="jpa_overview_em_lifeexamples"><fox:label>8.3.  Lifecycle Examples</fox:label><fox:destination internal-destination="jpa_overview_em_lifecycle_persist"/><fox:destination internal-destination="jpa_overview_em_lifecycle_update"/><fox:destination internal-destination="jpa_overview_em_lifecycle_delete"/><fox:destination internal-destination="jpa_overview_em_detachex"/></fox:outline><fox:destination internal-destination="jpa_overview_em_lifeexamples"/><fox:outline internal-destination="jpa_overview_em_identity"><fox:label>8.4.  Entity Identity Management</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_em_identity"/><fox:outline internal-destination="jpa_overview_em_cache"><fox:label>8.5.  Cache Management</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_em_cache"/><fox:outline internal-destination="jpa_overview_em_query"><fox:label>8.6.  Query Factory</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_em_query"/><fox:outline internal-destination="jpa_overview_em_closing"><fox:label>8.7.  Closing</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_em_closing"/></fox:outline><fox:destination internal-destination="jpa_overview_em"/><fox:outline internal-destination="jpa_overview_trans"><fox:label>Chapter 9.  Transaction</fox:label><fox:outline internal-destination="jpa_overview_trans_types"><fox:label>9.1.  Transaction Types</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_trans_types"/><fox:outline internal-destination="jpa_overview_trans_local"><fox:label>9.2.  The EntityTransaction Interface</fox:label><fox:destination internal-destination="jpa_overview_trans_group"/></fox:outline><fox:destination internal-destination="jpa_overview_trans_local"/></fox:outline><fox:destination internal-destination="jpa_overview_trans"/><fox:outline internal-destination="jpa_overview_query"><fox:label>Chapter 10.  JPA Query</fox:label><fox:outline internal-destination="jpa_query_api"><fox:label>10.1.  JPQL API</fox:label><fox:outline internal-destination="jpa_overview_query_basic"><fox:label>10.1.1.  Query Basics</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_query_basic"/><fox:outline internal-destination="jpa_overview_query_relations"><fox:label>10.1.2.  Relation Traversal</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_query_relations"/><fox:outline internal-destination="jpa_overview_join_fetch"><fox:label>10.1.3.  Fetch Joins</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_join_fetch"/><fox:outline internal-destination="jpa_overview_query_functions"><fox:label>10.1.4.  JPQL Functions</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_query_functions"/><fox:outline internal-destination="jpa_overview_query_inheritance"><fox:label>10.1.5.  Polymorphic Queries</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_query_inheritance"/><fox:outline internal-destination="jpa_overview_query_params"><fox:label>10.1.6.  Query Parameters</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_query_params"/><fox:outline internal-destination="jpa_overview_query_hints"><fox:label>10.1.7.  Query Hints</fox:label><fox:destination internal-destination="jpa_query_hint1"/><fox:outline internal-destination="jpa_hints_locking"><fox:label>10.1.7.1.  Locking Hints</fox:label></fox:outline><fox:destination internal-destination="jpa_hints_locking"/><fox:outline internal-destination="jpa_hints_resultset"><fox:label>10.1.7.2.  Result Set Size Hint</fox:label></fox:outline><fox:destination internal-destination="jpa_hints_resultset"/><fox:outline internal-destination="jpa_hints_isolation"><fox:label>10.1.7.3.  Isolation Level Hint</fox:label></fox:outline><fox:destination internal-destination="jpa_hints_isolation"/><fox:outline internal-destination="jpa_hints_fetchplan"><fox:label>10.1.7.4.  Other Fetchplan Hints</fox:label></fox:outline><fox:destination internal-destination="jpa_hints_fetchplan"/><fox:outline internal-destination="d0e6431"><fox:label>10.1.7.5.  Oracle Query Hints</fox:label></fox:outline><fox:destination internal-destination="d0e6431"/><fox:outline internal-destination="jpa_hints_named"><fox:label>10.1.7.6.  Named Query Hints</fox:label><fox:destination internal-destination="jpa_query_hint2"/></fox:outline><fox:destination internal-destination="jpa_hints_named"/></fox:outline><fox:destination internal-destination="jpa_overview_query_hints"/><fox:outline internal-destination="jpa_overview_query_ordering"><fox:label>10.1.8.  Ordering</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_query_ordering"/><fox:outline internal-destination="jpa_overview_query_aggregates"><fox:label>10.1.9.  Aggregates</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_query_aggregates"/><fox:outline internal-destination="jpa_overview_query_named"><fox:label>10.1.10.  Named Queries</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_query_named"/><fox:outline internal-destination="jpa_overview_query_delete"><fox:label>10.1.11.  Delete By Query</fox:label><fox:destination internal-destination="jpa_overview_query_deleteex"/></fox:outline><fox:destination internal-destination="jpa_overview_query_delete"/><fox:outline internal-destination="jpa_overview_query_update"><fox:label>10.1.12.  Update By Query</fox:label><fox:destination internal-destination="jpa_overview_query_updateex"/></fox:outline><fox:destination internal-destination="jpa_overview_query_update"/></fox:outline><fox:destination internal-destination="jpa_query_api"/><fox:outline internal-destination="jpa_langref"><fox:label>10.2.  JPQL Language Reference</fox:label><fox:outline internal-destination="jpa_langref_stmnttypes"><fox:label>10.2.1.  JPQL Statement Types</fox:label><fox:outline internal-destination="jpa_langref_select"><fox:label>10.2.1.1.  JPQL Select Statement</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_select"/><fox:outline internal-destination="jpa_langref_bulk"><fox:label>10.2.1.2.  JPQL Update and Delete Statements</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_bulk"/></fox:outline><fox:destination internal-destination="jpa_langref_stmnttypes"/><fox:outline internal-destination="jpa_langref_schematypes"><fox:label>10.2.2.  JPQL Abstract Schema Types and Query Domains</fox:label><fox:outline internal-destination="jpa_langref_schemanaming"><fox:label>10.2.2.1.  JPQL Entity Naming</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_schemanaming"/><fox:outline internal-destination="jpa_langref_schemaexample"><fox:label>10.2.2.2.  JPQL Schema Example</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_schemaexample"/></fox:outline><fox:destination internal-destination="jpa_langref_schematypes"/><fox:outline internal-destination="jpa_langref_fromclause"><fox:label>10.2.3.  JPQL FROM Clause and Navigational Declarations</fox:label><fox:outline internal-destination="jpa_langref_from_identifiers"><fox:label>10.2.3.1.  JPQL FROM Identifiers</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_from_identifiers"/><fox:outline internal-destination="jpa_langref_from_vars"><fox:label>10.2.3.2.  JPQL Identification Variables</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_from_vars"/><fox:outline internal-destination="jpa_langref_range"><fox:label>10.2.3.3.  JPQL Range Declarations</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_range"/><fox:outline internal-destination="jpa_langref_path"><fox:label>10.2.3.4.  JPQL Path Expressions</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_path"/><fox:outline internal-destination="jpa_langref_Joins"><fox:label>10.2.3.5.  JPQL Joins</fox:label><fox:outline internal-destination="jpa_langref_inner_joins"><fox:label>10.2.3.5.1.  JPQL Inner Joins (Relationship Joins)</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_inner_joins"/><fox:outline internal-destination="jpa_langref_outer_joins"><fox:label>10.2.3.5.2.  JPQL Outer Joins</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_outer_joins"/><fox:outline internal-destination="jpa_langref_fetch_joins"><fox:label>10.2.3.5.3.  JPQL Fetch Joins</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_fetch_joins"/></fox:outline><fox:destination internal-destination="jpa_langref_Joins"/><fox:outline internal-destination="jpa_langref_collection_dec"><fox:label>10.2.3.6.  JPQL Collection Member Declarations</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_collection_dec"/><fox:outline internal-destination="jpa_langref_polymorph"><fox:label>10.2.3.7.  JPQL Polymorphism</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_polymorph"/></fox:outline><fox:destination internal-destination="jpa_langref_fromclause"/><fox:outline internal-destination="jpa_langref_where"><fox:label>10.2.4.  JPQL WHERE Clause</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_where"/><fox:outline internal-destination="jpa_langref_cond"><fox:label>10.2.5.  JPQL Conditional Expressions</fox:label><fox:outline internal-destination="jpa_langref_lit"><fox:label>10.2.5.1.  JPQL Literals</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_lit"/><fox:outline internal-destination="jpa_langref_idvar"><fox:label>10.2.5.2.  JPQL Identification Variables</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_idvar"/><fox:outline internal-destination="jpa_langref_path_exp"><fox:label>10.2.5.3.  JPQL Path Expressions</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_path_exp"/><fox:outline internal-destination="jpa_langref_input_params"><fox:label>10.2.5.4.  JPQL Input Parameters</fox:label><fox:outline internal-destination="jpa_langref_pos_params"><fox:label>10.2.5.4.1.  JPQL Positional Parameters</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_pos_params"/><fox:outline internal-destination="jpa_langref_named_params"><fox:label>10.2.5.4.2.  JPQL Named Parameters</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_named_params"/></fox:outline><fox:destination internal-destination="jpa_langref_input_params"/><fox:outline internal-destination="jpa_langref_cond_comp"><fox:label>10.2.5.5.  JPQL Conditional Expression Composition</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_cond_comp"/><fox:outline internal-destination="jpa_langref_operators"><fox:label>10.2.5.6.  JPQL Operators and Operator Precedence</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_operators"/><fox:outline internal-destination="jpa_langref_between"><fox:label>10.2.5.7.  JPQL Between Expressions</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_between"/><fox:outline internal-destination="jpa_langref_in"><fox:label>10.2.5.8.  JPQL In Expressions</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_in"/><fox:outline internal-destination="jpa_langref_like"><fox:label>10.2.5.9.  JPQL Like Expressions</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_like"/><fox:outline internal-destination="jpa_langref_null"><fox:label>10.2.5.10.  JPQL Null Comparison Expressions</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_null"/><fox:outline internal-destination="jpa_langref_empty_comp"><fox:label>10.2.5.11.  JPQL Empty Collection Comparison Expressions</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_empty_comp"/><fox:outline internal-destination="jpa_langref_collection_member"><fox:label>10.2.5.12.  JPQL Collection Member Expressions</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_collection_member"/><fox:outline internal-destination="jpa_langref_exists"><fox:label>10.2.5.13.  JPQL Exists Expressions</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_exists"/><fox:outline internal-destination="jpa_langref_all_any"><fox:label>10.2.5.14.  JPQL All or Any Expressions</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_all_any"/><fox:outline internal-destination="jpa_langref_subqueries"><fox:label>10.2.5.15.  JPQL Subqueries</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_subqueries"/><fox:outline internal-destination="jpa_langref_functional"><fox:label>10.2.5.16.  JPQL Functional Expressions</fox:label><fox:outline internal-destination="jpa_langref_string_fun"><fox:label>10.2.5.16.1.  JPQL String Functions</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_string_fun"/><fox:outline internal-destination="jpa_langref_arithmetic"><fox:label>10.2.5.16.2.  JPQL Arithmetic Functions</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_arithmetic"/><fox:outline internal-destination="jpa_langref_datetime"><fox:label>10.2.5.16.3.  JPQL Datetime Functions</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_datetime"/></fox:outline><fox:destination internal-destination="jpa_langref_functional"/></fox:outline><fox:destination internal-destination="jpa_langref_cond"/><fox:outline internal-destination="jpa_langref_group"><fox:label>10.2.6.  JPQL GROUP BY, HAVING</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_group"/><fox:outline internal-destination="jpa_langref_select_clause"><fox:label>10.2.7.  JPQL SELECT Clause</fox:label><fox:outline internal-destination="jpa_langref_resulttype"><fox:label>10.2.7.1.  JPQL Result Type of the SELECT Clause</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_resulttype"/><fox:outline internal-destination="jpa_langref_constructor"><fox:label>10.2.7.2.  JPQL Constructor Expressions</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_constructor"/><fox:outline internal-destination="jpa_langref_null_select"><fox:label>10.2.7.3.  JPQL Null Values in the Query Result</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_null_select"/><fox:outline internal-destination="jpa_langref_aggregates"><fox:label>10.2.7.4.  JPQL Aggregate Functions</fox:label><fox:outline internal-destination="jpa_langref_agg_examples"><fox:label>10.2.7.4.1.  JPQL Aggregate Examples</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_agg_examples"/></fox:outline><fox:destination internal-destination="jpa_langref_aggregates"/></fox:outline><fox:destination internal-destination="jpa_langref_select_clause"/><fox:outline internal-destination="jpa_langref_orderby"><fox:label>10.2.8.  JPQL ORDER BY Clause</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_orderby"/><fox:outline internal-destination="jpa_langref_bulk_ops"><fox:label>10.2.9.  JPQL Bulk Update and Delete</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_bulk_ops"/><fox:outline internal-destination="jpa_langref_null_values"><fox:label>10.2.10.  JPQL Null Values</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_null_values"/><fox:outline internal-destination="jpa_langref_equality"><fox:label>10.2.11.  JPQL Equality and Comparison Semantics</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_equality"/><fox:outline internal-destination="jpa_langref_bnf"><fox:label>10.2.12.  JPQL BNF</fox:label></fox:outline><fox:destination internal-destination="jpa_langref_bnf"/></fox:outline><fox:destination internal-destination="jpa_langref"/></fox:outline><fox:destination internal-destination="jpa_overview_query"/><fox:outline internal-destination="jpa_overview_sqlquery"><fox:label>Chapter 11.  SQL Queries</fox:label><fox:outline internal-destination="jpa_overview_sqlquery_create"><fox:label>11.1.  Creating SQL Queries</fox:label><fox:destination internal-destination="jpa_overview_sqlquery_createex"/></fox:outline><fox:destination internal-destination="jpa_overview_sqlquery_create"/><fox:outline internal-destination="jpa_overview_sqlquery_obj"><fox:label>11.2.  Retrieving Persistent Objects with SQL</fox:label><fox:destination internal-destination="jpa_overview_sqlquery_objex"/><fox:destination internal-destination="jpa_overview_sqlquery_obj_paramex"/></fox:outline><fox:destination internal-destination="jpa_overview_sqlquery_obj"/></fox:outline><fox:destination internal-destination="jpa_overview_sqlquery"/><fox:outline internal-destination="jpa_overview_mapping"><fox:label>Chapter 12.  Mapping Metadata</fox:label><fox:outline internal-destination="jpa_overview_mapping_table"><fox:label>12.1.  Table</fox:label><fox:destination internal-destination="jpa_overview_mapping_classex"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_table"/><fox:outline internal-destination="jpa_overview_mapping_unq"><fox:label>12.2.  Unique Constraints</fox:label><fox:destination internal-destination="jpa_overview_mapping_unq_attrex"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_unq"/><fox:outline internal-destination="jpa_overview_mapping_column"><fox:label>12.3.  Column</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_mapping_column"/><fox:outline internal-destination="jpa_overview_mapping_id"><fox:label>12.4.  Identity Mapping</fox:label><fox:destination internal-destination="jpa_overview_mapping_identityex"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_id"/><fox:outline internal-destination="jpa_overview_mapping_sequence"><fox:label>12.5.  Generators</fox:label><fox:outline internal-destination="jpa_overview_mapping_sequence_seqgen"><fox:label>12.5.1.  Sequence Generator</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_mapping_sequence_seqgen"/><fox:outline internal-destination="jpa_overview_mapping_sequence_tablegen"><fox:label>12.5.2.  TableGenerator</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_mapping_sequence_tablegen"/><fox:outline internal-destination="jpa_overview_mapping_sequence_genex"><fox:label>12.5.3.  Example</fox:label><fox:destination internal-destination="jpa_overview_mapping_sequenceex"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_sequence_genex"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_sequence"/><fox:outline internal-destination="jpa_overview_mapping_inher"><fox:label>12.6.  Inheritance</fox:label><fox:outline internal-destination="jpa_overview_mapping_inher_single"><fox:label>12.6.1.  Single Table</fox:label><fox:destination internal-destination="jpa_overview_mapping_inher_singleex"/><fox:outline internal-destination="jpa_overview_mapping_inher_single_adv"><fox:label>12.6.1.1.  Advantages</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_mapping_inher_single_adv"/><fox:outline internal-destination="jpa_overview_mapping_inher_single_disadv"><fox:label>12.6.1.2.  Disadvantages</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_mapping_inher_single_disadv"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_inher_single"/><fox:outline internal-destination="jpa_overview_mapping_inher_joined"><fox:label>12.6.2.  Joined</fox:label><fox:destination internal-destination="jpa_overview_mapping_inher_joinedex"/><fox:outline internal-destination="jpa_overview_mapping_inher_joined_adv"><fox:label>12.6.2.1.  Advantages</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_mapping_inher_joined_adv"/><fox:outline internal-destination="jpa_overview_mapping_inher_joined_disadv"><fox:label>12.6.2.2.  Disadvantages</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_mapping_inher_joined_disadv"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_inher_joined"/><fox:outline internal-destination="jpa_overview_mapping_inher_tpc"><fox:label>12.6.3.  Table Per Class</fox:label><fox:destination internal-destination="jpa_overview_mapping_inher_tpcex"/><fox:outline internal-destination="jpa_overview_mapping_inher_tpc_adv"><fox:label>12.6.3.1.  Advantages</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_mapping_inher_tpc_adv"/><fox:outline internal-destination="jpa_overview_mapping_inher_tpc_disadv"><fox:label>12.6.3.2.  Disadvantages</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_mapping_inher_tpc_disadv"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_inher_tpc"/><fox:outline internal-destination="jpa_overview_mapping_inher_together"><fox:label>12.6.4.  Putting it All Together</fox:label><fox:destination internal-destination="jpa_overview_mapping_inher_togetherex"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_inher_together"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_inher"/><fox:outline internal-destination="jpa_overview_mapping_discrim"><fox:label>12.7.  Discriminator</fox:label><fox:destination internal-destination="jpa_overview_mapping_discrimex"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_discrim"/><fox:outline internal-destination="jpa_overview_mapping_field"><fox:label>12.8.  Field Mapping</fox:label><fox:outline internal-destination="jpa_overview_mapping_basic"><fox:label>12.8.1.  Basic Mapping</fox:label><fox:outline internal-destination="jpa_overview_mapping_lob"><fox:label>12.8.1.1.  LOBs</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_mapping_lob"/><fox:outline internal-destination="jpa_overview_mapping_enum"><fox:label>12.8.1.2.  Enumerated</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_mapping_enum"/><fox:outline internal-destination="jpa_overview_mapping_temporal"><fox:label>12.8.1.3.  Temporal Types</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_mapping_temporal"/><fox:outline internal-destination="jpa_overview_mapping_basic_example"><fox:label>12.8.1.4.  The Updated Mappings</fox:label><fox:destination internal-destination="jpa_overview_mapping_basicex"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_basic_example"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_basic"/><fox:outline internal-destination="jpa_overview_mapping_secondary"><fox:label>12.8.2.  Secondary Tables</fox:label><fox:destination internal-destination="jpa_overview_mapping_secondaryex"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_secondary"/><fox:outline internal-destination="jpa_overview_mapping_embed"><fox:label>12.8.3.  Embedded Mapping</fox:label><fox:destination internal-destination="jpa_overview_mapping_embedex"/><fox:destination internal-destination="jpa_overview_mapping_joined_overex"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_embed"/><fox:outline internal-destination="jpa_overview_mapping_rel"><fox:label>12.8.4.  Direct Relations</fox:label><fox:destination internal-destination="jpa_overview_mapping_relex"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_rel"/><fox:outline internal-destination="jpa_overview_mapping_assoccoll"><fox:label>12.8.5.  Join Table</fox:label><fox:destination internal-destination="jpa_overview_mapping_assoccollex"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_assoccoll"/><fox:outline internal-destination="jpa_overview_mapping_bidi"><fox:label>12.8.6.  Bidirectional Mapping</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_mapping_bidi"/><fox:outline internal-destination="jpa_overview_mapping_map"><fox:label>12.8.7.  Map Mapping</fox:label><fox:destination internal-destination="jpa_overview_mapping_mapex"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_map"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_field"/><fox:outline internal-destination="jpa_overview_mapping_full"><fox:label>12.9.  The Complete Mappings</fox:label><fox:destination internal-destination="jpa_overview_mapping_fullex"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping_full"/></fox:outline><fox:destination internal-destination="jpa_overview_mapping"/><fox:outline internal-destination="jpa_overview_conclusion"><fox:label>Chapter 13.  Conclusion</fox:label></fox:outline><fox:destination internal-destination="jpa_overview_conclusion"/></fox:outline><fox:destination xmlns:fox="http://xml.apache.org/fop/extensions" internal-destination="jpa_overview"/><fox:outline xmlns:fox="http://xml.apache.org/fop/extensions" internal-destination="ref_guide"><fox:label>Part 3. Reference Guide</fox:label><fox:outline internal-destination="ref_guide_intro"><fox:label>Chapter 1.  Introduction</fox:label><fox:outline internal-destination="ref_guide_intro_audience"><fox:label>1.1.  Intended Audience</fox:label></fox:outline><fox:destination internal-destination="ref_guide_intro_audience"/></fox:outline><fox:destination internal-destination="ref_guide_intro"/><fox:outline internal-destination="ref_guide_conf"><fox:label>Chapter 2.  Configuration</fox:label><fox:outline internal-destination="ref_guide_conf_intro"><fox:label>2.1.  Introduction</fox:label></fox:outline><fox:destination internal-destination="ref_guide_conf_intro"/><fox:outline internal-destination="ref_guide_conf_specify"><fox:label>2.2.  Runtime Configuration</fox:label></fox:outline><fox:destination internal-destination="ref_guide_conf_specify"/><fox:outline internal-destination="ref_guide_conf_devtools"><fox:label>2.3.  Command Line Configuration</fox:label><fox:outline internal-destination="ref_guide_conf_devtools_format"><fox:label>2.3.1.  Code Formatting</fox:label><fox:destination internal-destination="ref_guide_conf_devtools_format_ex"/></fox:outline><fox:destination internal-destination="ref_guide_conf_devtools_format"/></fox:outline><fox:destination internal-destination="ref_guide_conf_devtools"/><fox:outline internal-destination="ref_guide_conf_plugins"><fox:label>2.4.  Plugin Configuration</fox:label></fox:outline><fox:destination internal-destination="ref_guide_conf_plugins"/><fox:outline internal-destination="ref_guide_conf_openjpa"><fox:label>2.5.  OpenJPA Properties</fox:label><fox:outline internal-destination="openjpa.AutoClear"><fox:label>2.5.1.  openjpa.AutoClear</fox:label></fox:outline><fox:destination internal-destination="openjpa.AutoClear"/><fox:outline internal-destination="openjpa.AutoDetach"><fox:label>2.5.2.  openjpa.AutoDetach</fox:label></fox:outline><fox:destination internal-destination="openjpa.AutoDetach"/><fox:outline internal-destination="openjpa.BrokerFactory"><fox:label>2.5.3.  openjpa.BrokerFactory</fox:label></fox:outline><fox:destination internal-destination="openjpa.BrokerFactory"/><fox:outline internal-destination="openjpa.BrokerImpl"><fox:label>2.5.4.  openjpa.BrokerImpl</fox:label></fox:outline><fox:destination internal-destination="openjpa.BrokerImpl"/><fox:outline internal-destination="openjpa.ClassResolver"><fox:label>2.5.5.  openjpa.ClassResolver</fox:label></fox:outline><fox:destination internal-destination="openjpa.ClassResolver"/><fox:outline internal-destination="openjpa.Compatibility"><fox:label>2.5.6.  openjpa.Compatibility</fox:label></fox:outline><fox:destination internal-destination="openjpa.Compatibility"/><fox:outline internal-destination="openjpa.ConnectionDriverName"><fox:label>2.5.7.  openjpa.ConnectionDriverName</fox:label></fox:outline><fox:destination internal-destination="openjpa.ConnectionDriverName"/><fox:outline internal-destination="openjpa.Connection2DriverName"><fox:label>2.5.8.  openjpa.Connection2DriverName</fox:label></fox:outline><fox:destination internal-destination="openjpa.Connection2DriverName"/><fox:outline internal-destination="openjpa.ConnectionFactory"><fox:label>2.5.9.  openjpa.ConnectionFactory</fox:label></fox:outline><fox:destination internal-destination="openjpa.ConnectionFactory"/><fox:outline internal-destination="openjpa.ConnectionFactory2"><fox:label>2.5.10.  openjpa.ConnectionFactory2</fox:label></fox:outline><fox:destination internal-destination="openjpa.ConnectionFactory2"/><fox:outline internal-destination="openjpa.ConnectionFactoryName"><fox:label>2.5.11.  openjpa.ConnectionFactoryName</fox:label></fox:outline><fox:destination internal-destination="openjpa.ConnectionFactoryName"/><fox:outline internal-destination="openjpa.ConnectionFactory2Name"><fox:label>2.5.12.  openjpa.ConnectionFactory2Name</fox:label></fox:outline><fox:destination internal-destination="openjpa.ConnectionFactory2Name"/><fox:outline internal-destination="openjpa.ConnectionFactoryMode"><fox:label>2.5.13.  openjpa.ConnectionFactoryMode</fox:label></fox:outline><fox:destination internal-destination="openjpa.ConnectionFactoryMode"/><fox:outline internal-destination="openjpa.ConnectionFactoryProperties"><fox:label>2.5.14.  openjpa.ConnectionFactoryProperties</fox:label></fox:outline><fox:destination internal-destination="openjpa.ConnectionFactoryProperties"/><fox:outline internal-destination="openjpa.ConnectionFactory2Properties"><fox:label>2.5.15.  openjpa.ConnectionFactory2Properties</fox:label></fox:outline><fox:destination internal-destination="openjpa.ConnectionFactory2Properties"/><fox:outline internal-destination="openjpa.ConnectionPassword"><fox:label>2.5.16.  openjpa.ConnectionPassword</fox:label></fox:outline><fox:destination internal-destination="openjpa.ConnectionPassword"/><fox:outline internal-destination="openjpa.Connection2Password"><fox:label>2.5.17.  openjpa.Connection2Password</fox:label></fox:outline><fox:destination internal-destination="openjpa.Connection2Password"/><fox:outline internal-destination="openjpa.ConnectionProperties"><fox:label>2.5.18.  openjpa.ConnectionProperties</fox:label></fox:outline><fox:destination internal-destination="openjpa.ConnectionProperties"/><fox:outline internal-destination="openjpa.Connection2Properties"><fox:label>2.5.19.  openjpa.Connection2Properties</fox:label></fox:outline><fox:destination internal-destination="openjpa.Connection2Properties"/><fox:outline internal-destination="openjpa.ConnectionURL"><fox:label>2.5.20.  openjpa.ConnectionURL</fox:label></fox:outline><fox:destination internal-destination="openjpa.ConnectionURL"/><fox:outline internal-destination="openjpa.Connection2URL"><fox:label>2.5.21.  openjpa.Connection2URL</fox:label></fox:outline><fox:destination internal-destination="openjpa.Connection2URL"/><fox:outline internal-destination="openjpa.ConnectionUserName"><fox:label>2.5.22.  openjpa.ConnectionUserName</fox:label></fox:outline><fox:destination internal-destination="openjpa.ConnectionUserName"/><fox:outline internal-destination="openjpa.Connection2UserName"><fox:label>2.5.23.  openjpa.Connection2UserName</fox:label></fox:outline><fox:destination internal-destination="openjpa.Connection2UserName"/><fox:outline internal-destination="openjpa.ConnectionRetainMode"><fox:label>2.5.24.  openjpa.ConnectionRetainMode</fox:label></fox:outline><fox:destination internal-destination="openjpa.ConnectionRetainMode"/><fox:outline internal-destination="openjpa.DataCache"><fox:label>2.5.25.  openjpa.DataCache</fox:label></fox:outline><fox:destination internal-destination="openjpa.DataCache"/><fox:outline internal-destination="openjpa.DataCacheManager"><fox:label>2.5.26.  openjpa.DataCacheManager</fox:label></fox:outline><fox:destination internal-destination="openjpa.DataCacheManager"/><fox:outline internal-destination="openjpa.DataCacheTimeout"><fox:label>2.5.27.  openjpa.DataCacheTimeout</fox:label></fox:outline><fox:destination internal-destination="openjpa.DataCacheTimeout"/><fox:outline internal-destination="openjpa.DetachState"><fox:label>2.5.28.  openjpa.DetachState</fox:label></fox:outline><fox:destination internal-destination="openjpa.DetachState"/><fox:outline internal-destination="openjpa.DynamicDataStructs"><fox:label>2.5.29.  openjpa.DynamicDataStructs</fox:label></fox:outline><fox:destination internal-destination="openjpa.DynamicDataStructs"/><fox:outline internal-destination="openjpa.FetchBatchSize"><fox:label>2.5.30.  openjpa.FetchBatchSize</fox:label></fox:outline><fox:destination internal-destination="openjpa.FetchBatchSize"/><fox:outline internal-destination="openjpa.FetchGroups"><fox:label>2.5.31.  openjpa.FetchGroups</fox:label></fox:outline><fox:destination internal-destination="openjpa.FetchGroups"/><fox:outline internal-destination="openjpa.FlushBeforeQueries"><fox:label>2.5.32.  openjpa.FlushBeforeQueries</fox:label></fox:outline><fox:destination internal-destination="openjpa.FlushBeforeQueries"/><fox:outline internal-destination="openjpa.IgnoreChanges"><fox:label>2.5.33.  openjpa.IgnoreChanges</fox:label></fox:outline><fox:destination internal-destination="openjpa.IgnoreChanges"/><fox:outline internal-destination="openjpa.Id"><fox:label>2.5.34. openjpa.Id</fox:label></fox:outline><fox:destination internal-destination="openjpa.Id"/><fox:outline internal-destination="openjpa.InverseManager"><fox:label>2.5.35.  openjpa.InverseManager</fox:label></fox:outline><fox:destination internal-destination="openjpa.InverseManager"/><fox:outline internal-destination="openjpa.LockManager"><fox:label>2.5.36.  openjpa.LockManager</fox:label></fox:outline><fox:destination internal-destination="openjpa.LockManager"/><fox:outline internal-destination="openjpa.LockTimeout"><fox:label>2.5.37.  openjpa.LockTimeout</fox:label></fox:outline><fox:destination internal-destination="openjpa.LockTimeout"/><fox:outline internal-destination="openjpa.Log"><fox:label>2.5.38.  openjpa.Log</fox:label></fox:outline><fox:destination internal-destination="openjpa.Log"/><fox:outline internal-destination="openjpa.ManagedRuntime"><fox:label>2.5.39.  openjpa.ManagedRuntime</fox:label></fox:outline><fox:destination internal-destination="openjpa.ManagedRuntime"/><fox:outline internal-destination="openjpa.Mapping"><fox:label>2.5.40.  openjpa.Mapping</fox:label></fox:outline><fox:destination internal-destination="openjpa.Mapping"/><fox:outline internal-destination="openjpa.MaxFetchDepth"><fox:label>2.5.41.  openjpa.MaxFetchDepth</fox:label></fox:outline><fox:destination internal-destination="openjpa.MaxFetchDepth"/><fox:outline internal-destination="openjpa.MetaDataFactory"><fox:label>2.5.42.  openjpa.MetaDataFactory</fox:label></fox:outline><fox:destination internal-destination="openjpa.MetaDataFactory"/><fox:outline internal-destination="openjpa.Multithreaded"><fox:label>2.5.43.  openjpa.Multithreaded</fox:label></fox:outline><fox:destination internal-destination="openjpa.Multithreaded"/><fox:outline internal-destination="openjpa.Optimistic"><fox:label>2.5.44.  openjpa.Optimistic</fox:label></fox:outline><fox:destination internal-destination="openjpa.Optimistic"/><fox:outline internal-destination="openjpa.OrphanedKeyAction"><fox:label>2.5.45.  openjpa.OrphanedKeyAction</fox:label></fox:outline><fox:destination internal-destination="openjpa.OrphanedKeyAction"/><fox:outline internal-destination="openjpa.NontransactionalRead"><fox:label>2.5.46.  openjpa.NontransactionalRead</fox:label></fox:outline><fox:destination internal-destination="openjpa.NontransactionalRead"/><fox:outline internal-destination="openjpa.NontransactionalWrite"><fox:label>2.5.47.  openjpa.NontransactionalWrite</fox:label></fox:outline><fox:destination internal-destination="openjpa.NontransactionalWrite"/><fox:outline internal-destination="openjpa.ProxyManager"><fox:label>2.5.48.  openjpa.ProxyManager</fox:label></fox:outline><fox:destination internal-destination="openjpa.ProxyManager"/><fox:outline internal-destination="openjpa.QueryCache"><fox:label>2.5.49.  openjpa.QueryCache</fox:label></fox:outline><fox:destination internal-destination="openjpa.QueryCache"/><fox:outline internal-destination="openjpa.QueryCompilationCache"><fox:label>2.5.50.  openjpa.QueryCompilationCache</fox:label></fox:outline><fox:destination internal-destination="openjpa.QueryCompilationCache"/><fox:outline internal-destination="openjpa.ReadLockLevel"><fox:label>2.5.51.  openjpa.ReadLockLevel</fox:label></fox:outline><fox:destination internal-destination="openjpa.ReadLockLevel"/><fox:outline internal-destination="openjpa.RemoteCommitProvider"><fox:label>2.5.52.  openjpa.RemoteCommitProvider</fox:label></fox:outline><fox:destination internal-destination="openjpa.RemoteCommitProvider"/><fox:outline internal-destination="openjpa.RestoreState"><fox:label>2.5.53.  openjpa.RestoreState</fox:label></fox:outline><fox:destination internal-destination="openjpa.RestoreState"/><fox:outline internal-destination="openjpa.RetainState"><fox:label>2.5.54.  openjpa.RetainState</fox:label></fox:outline><fox:destination internal-destination="openjpa.RetainState"/><fox:outline internal-destination="openjpa.RetryClassRegistration"><fox:label>2.5.55.  openjpa.RetryClassRegistration</fox:label></fox:outline><fox:destination internal-destination="openjpa.RetryClassRegistration"/><fox:outline internal-destination="openjpa.SavepointManager"><fox:label>2.5.56.  openjpa.SavepointManager</fox:label></fox:outline><fox:destination internal-destination="openjpa.SavepointManager"/><fox:outline internal-destination="openjpa.Sequence"><fox:label>2.5.57.  openjpa.Sequence</fox:label></fox:outline><fox:destination internal-destination="openjpa.Sequence"/><fox:outline internal-destination="openjpa.TransactionMode"><fox:label>2.5.58.  openjpa.TransactionMode</fox:label></fox:outline><fox:destination internal-destination="openjpa.TransactionMode"/><fox:outline internal-destination="openjpa.WriteLockLevel"><fox:label>2.5.59.  openjpa.WriteLockLevel</fox:label></fox:outline><fox:destination internal-destination="openjpa.WriteLockLevel"/></fox:outline><fox:destination internal-destination="ref_guide_conf_openjpa"/><fox:outline internal-destination="ref_guide_conf_jdbc"><fox:label>2.6.  OpenJPA JDBC Properties</fox:label><fox:outline internal-destination="openjpa.jdbc.ConnectionDecorators"><fox:label>2.6.1.  openjpa.jdbc.ConnectionDecorators</fox:label></fox:outline><fox:destination internal-destination="openjpa.jdbc.ConnectionDecorators"/><fox:outline internal-destination="openjpa.jdbc.DBDictionary"><fox:label>2.6.2.  openjpa.jdbc.DBDictionary</fox:label></fox:outline><fox:destination internal-destination="openjpa.jdbc.DBDictionary"/><fox:outline internal-destination="openjpa.jdbc.DriverDataSource"><fox:label>2.6.3.  openjpa.jdbc.DriverDataSource</fox:label></fox:outline><fox:destination internal-destination="openjpa.jdbc.DriverDataSource"/><fox:outline internal-destination="openjpa.jdbc.EagerFetchMode"><fox:label>2.6.4.  openjpa.jdbc.EagerFetchMode</fox:label></fox:outline><fox:destination internal-destination="openjpa.jdbc.EagerFetchMode"/><fox:outline internal-destination="openjpa.jdbc.FetchDirection"><fox:label>2.6.5.  openjpa.jdbc.FetchDirection</fox:label></fox:outline><fox:destination internal-destination="openjpa.jdbc.FetchDirection"/><fox:outline internal-destination="openjpa.jdbc.JDBCListeners"><fox:label>2.6.6.  openjpa.jdbc.JDBCListeners</fox:label></fox:outline><fox:destination internal-destination="openjpa.jdbc.JDBCListeners"/><fox:outline internal-destination="openjpa.jdbc.LRSSize"><fox:label>2.6.7.  openjpa.jdbc.LRSSize</fox:label></fox:outline><fox:destination internal-destination="openjpa.jdbc.LRSSize"/><fox:outline internal-destination="openjpa.jdbc.MappingDefaults"><fox:label>2.6.8.  openjpa.jdbc.MappingDefaults</fox:label></fox:outline><fox:destination internal-destination="openjpa.jdbc.MappingDefaults"/><fox:outline internal-destination="openjpa.jdbc.MappingFactory"><fox:label>2.6.9.  openjpa.jdbc.MappingFactory</fox:label></fox:outline><fox:destination internal-destination="openjpa.jdbc.MappingFactory"/><fox:outline internal-destination="openjpa.jdbc.ResultSetType"><fox:label>2.6.10.  openjpa.jdbc.ResultSetType</fox:label></fox:outline><fox:destination internal-destination="openjpa.jdbc.ResultSetType"/><fox:outline internal-destination="openjpa.jdbc.Schema"><fox:label>2.6.11.  openjpa.jdbc.Schema</fox:label></fox:outline><fox:destination internal-destination="openjpa.jdbc.Schema"/><fox:outline internal-destination="openjpa.jdbc.SchemaFactory"><fox:label>2.6.12.  openjpa.jdbc.SchemaFactory</fox:label></fox:outline><fox:destination internal-destination="openjpa.jdbc.SchemaFactory"/><fox:outline internal-destination="openjpa.jdbc.Schemas"><fox:label>2.6.13.  openjpa.jdbc.Schemas</fox:label></fox:outline><fox:destination internal-destination="openjpa.jdbc.Schemas"/><fox:outline internal-destination="openjpa.jdbc.SQLFactory"><fox:label>2.6.14.  openjpa.jdbc.SQLFactory</fox:label></fox:outline><fox:destination internal-destination="openjpa.jdbc.SQLFactory"/><fox:outline internal-destination="openjpa.jdbc.SubclassFetchMode"><fox:label>2.6.15.  openjpa.jdbc.SubclassFetchMode</fox:label></fox:outline><fox:destination internal-destination="openjpa.jdbc.SubclassFetchMode"/><fox:outline internal-destination="openjpa.jdbc.SynchronizeMappings"><fox:label>2.6.16.  openjpa.jdbc.SynchronizeMappings</fox:label></fox:outline><fox:destination internal-destination="openjpa.jdbc.SynchronizeMappings"/><fox:outline internal-destination="openjpa.jdbc.TransactionIsolation"><fox:label>2.6.17.  openjpa.jdbc.TransactionIsolation</fox:label></fox:outline><fox:destination internal-destination="openjpa.jdbc.TransactionIsolation"/><fox:outline internal-destination="openjpa.jdbc.UpdateManager"><fox:label>2.6.18.  openjpa.jdbc.UpdateManager</fox:label></fox:outline><fox:destination internal-destination="openjpa.jdbc.UpdateManager"/></fox:outline><fox:destination internal-destination="ref_guide_conf_jdbc"/></fox:outline><fox:destination internal-destination="ref_guide_conf"/><fox:outline internal-destination="ref_guide_logging"><fox:label>Chapter 3.  Logging</fox:label><fox:outline internal-destination="ref_guide_logging_channels"><fox:label>3.1.  Logging Channels</fox:label></fox:outline><fox:destination internal-destination="ref_guide_logging_channels"/><fox:outline internal-destination="ref_guide_logging_openjpa"><fox:label>3.2.  OpenJPA Logging</fox:label><fox:destination internal-destination="ref_guide_logging_openjpa_std_ex"/><fox:destination internal-destination="ref_guide_logging_openjpa_sql_ex"/><fox:destination internal-destination="ref_guide_logging_openjpa_file"/></fox:outline><fox:destination internal-destination="ref_guide_logging_openjpa"/><fox:outline internal-destination="ref_guide_logging_noop"><fox:label>3.3.  Disabling Logging</fox:label></fox:outline><fox:destination internal-destination="ref_guide_logging_noop"/><fox:outline internal-destination="ref_guide_logging_log4j"><fox:label>3.4.  Log4J</fox:label><fox:destination internal-destination="ref_guide_logging_log4j_ex"/></fox:outline><fox:destination internal-destination="ref_guide_logging_log4j"/><fox:outline internal-destination="ref_guide_logging_commons"><fox:label>3.5.  Apache Commons Logging</fox:label><fox:outline internal-destination="ref_guide_logging_jdk14"><fox:label>3.5.1.  JDK 1.4 java.util.logging</fox:label><fox:destination internal-destination="ref_guide_logging_jdk14_propfile"/></fox:outline><fox:destination internal-destination="ref_guide_logging_jdk14"/></fox:outline><fox:destination internal-destination="ref_guide_logging_commons"/><fox:outline internal-destination="ref_guide_logging_custom"><fox:label>3.6.  Custom Log</fox:label><fox:destination internal-destination="ref_guide_logging_custom_ex"/></fox:outline><fox:destination internal-destination="ref_guide_logging_custom"/></fox:outline><fox:destination internal-destination="ref_guide_logging"/><fox:outline internal-destination="ref_guide_dbsetup"><fox:label>Chapter 4.  JDBC</fox:label><fox:outline internal-destination="ref_guide_dbsetup_builtin"><fox:label>4.1.  Using the OpenJPA DataSource</fox:label><fox:destination internal-destination="ref_guide_dbsetup_builtin_ex"/></fox:outline><fox:destination internal-destination="ref_guide_dbsetup_builtin"/><fox:outline internal-destination="ref_guide_dbsetup_thirdparty"><fox:label>4.2.  Using a Third-Party DataSource</fox:label><fox:destination internal-destination="ref_guide_dbsetup_thirdparty_ex"/><fox:outline internal-destination="ref_guide_dbsetup_thirdparty_enlist"><fox:label>4.2.1.  Managed and XA DataSources</fox:label><fox:destination internal-destination="ref_guide_enterprise_xa_conf_ex"/></fox:outline><fox:destination internal-destination="ref_guide_dbsetup_thirdparty_enlist"/></fox:outline><fox:destination internal-destination="ref_guide_dbsetup_thirdparty"/><fox:outline internal-destination="ref_guide_dbsetup_sqlconn"><fox:label>4.3.  Runtime Access to DataSource</fox:label><fox:destination internal-destination="ref_guide_dbsetup_conn_jpa"/><fox:destination internal-destination="ref_guide_dbsetup_conn_from_factory_jpa"/></fox:outline><fox:destination internal-destination="ref_guide_dbsetup_sqlconn"/><fox:outline internal-destination="ref_guide_dbsetup_dbsupport"><fox:label>4.4.  Database Support</fox:label><fox:destination internal-destination="ref_guide_dbsetup_dbdict"/><fox:outline internal-destination="ref_guide_dbsetup_dbdictprops"><fox:label>4.4.1.  DBDictionary Properties</fox:label><fox:destination internal-destination="DBDictionary.DriverVendor"/><fox:destination internal-destination="DBDictionary.CatalogSeparator"/><fox:destination internal-destination="DBDictionary.CreatePrimaryKeys"/><fox:destination internal-destination="DBDictionary.ConstraintNameMode"/><fox:destination internal-destination="DBDictionary.MaxTableNameLength"/><fox:destination internal-destination="DBDictionary.MaxColumnNameLength"/><fox:destination internal-destination="DBDictionary.MaxConstraintNameLength"/><fox:destination internal-destination="DBDictionary.MaxIndexNameLength"/><fox:destination internal-destination="DBDictionary.MaxAutoAssignNameLength"/><fox:destination internal-destination="DBDictionary.MaxIndexesPerTable"/><fox:destination internal-destination="DBDictionary.SupportsForeignKeys"/><fox:destination internal-destination="DBDictionary.SupportsTimestampNanos"/><fox:destination internal-destination="DBDictionary.SupportsUniqueConstraints"/><fox:destination internal-destination="DBDictionary.SupportsDeferredConstraints"/><fox:destination internal-destination="DBDictionary.SupportsRestrictDeleteAction"/><fox:destination internal-destination="DBDictionary.SupportsCascadeDeleteAction"/><fox:destination internal-destination="DBDictionary.SupportsNullDeleteAction"/><fox:destination internal-destination="DBDictionary.SupportsDefaultDeleteAction"/><fox:destination internal-destination="DBDictionary.SupportsAlterTableWithAddColumn"/><fox:destination internal-destination="DBDictionary.SupportsAlterTableWithDropColumn"/><fox:destination internal-destination="DBDictionary.ReservedWords"/><fox:destination internal-destination="DBDictionary.SystemTables"/><fox:destination internal-destination="DBDictionary.SystemSchemas"/><fox:destination internal-destination="DBDictionary.SchemaCase"/><fox:destination internal-destination="DBDictionary.ValidationSQL"/><fox:destination internal-destination="DBDictionary.InitializationSQL"/><fox:destination internal-destination="DBDictionary.JoinSyntax"/><fox:destination internal-destination="DBDictionary.CrossJoinClause"/><fox:destination internal-destination="DBDictionary.InnerJoinClause"/><fox:destination internal-destination="DBDictionary.OuterJoinClause"/><fox:destination internal-destination="DBDictionary.RequiresConditionForCrossJoin"/><fox:destination internal-destination="DBDictionary.ToUpperCaseFunction"/><fox:destination internal-destination="DBDictionary.ToLowerCaseFunction"/><fox:destination internal-destination="DBDictionary.StringLengthFunction"/><fox:destination internal-destination="DBDictionary.SubstringFunctionName"/><fox:destination internal-destination="DBDictionary.DistinctCountColumnSeparator"/><fox:destination internal-destination="DBDictionary.ForUpdateClause"/><fox:destination internal-destination="DBDictionary.TableForUpdateClause"/><fox:destination internal-destination="DBDictionary.SupportsSelectForUpdate"/><fox:destination internal-destination="DBDictionary.SupportsLockingWithDistinctClause"/><fox:destination internal-destination="DBDictionary.SupportsLockingWithOuterJoin"/><fox:destination internal-destination="DBDictionary.SupportsLockingWithInnerJoin"/><fox:destination internal-destination="DBDictionary.SupportsLockingWithMultipleTables"/><fox:destination internal-destination="DBDictionary.SupportsLockingWithOrderClause"/><fox:destination internal-destination="DBDictionary.SupportsLockingWithSelectRange"/><fox:destination internal-destination="DBDictionary.SimulateLocking"/><fox:destination internal-destination="DBDictionary.SupportsQueryTimeout"/><fox:destination internal-destination="DBDictionary.SupportsHaving"/><fox:destination internal-destination="DBDictionary.SupportsSelectStartIndex"/><fox:destination internal-destination="DBDictionary.SupportsSelectEndIndex"/><fox:destination internal-destination="DBDictionary.SupportsSubselect"/><fox:destination internal-destination="DBDictionary.RequiresAliasForSubselect"/><fox:destination internal-destination="DBDictionary.SupportsMultipleNontransactionalResultSets"/><fox:destination internal-destination="DBDictionary.StorageLimitationsFatal"/><fox:destination internal-destination="DBDictionary.StoreLargeNumbersAsStrings"/><fox:destination internal-destination="DBDictionary.StoreCharsAsNumbers"/><fox:destination internal-destination="DBDictionary.UseGetBytesForBlobs"/><fox:destination internal-destination="DBDictionary.UseGetObjectForBlobs"/><fox:destination internal-destination="DBDictionary.UseSetBytesForBlobs"/><fox:destination internal-destination="DBDictionary.UseGetStringForClobs"/><fox:destination internal-destination="DBDictionary.UseSetStringForClobs"/><fox:destination internal-destination="DBDictionary.CharacterColumnSize"/><fox:destination internal-destination="DBDictionary.ArrayTypeName"/><fox:destination internal-destination="DBDictionary.BigintTypeName"/><fox:destination internal-destination="DBDictionary.BinaryTypeName"/><fox:destination internal-destination="DBDictionary.BitTypeName"/><fox:destination internal-destination="DBDictionary.BlobTypeName"/><fox:destination internal-destination="DBDictionary.CharTypeName"/><fox:destination internal-destination="DBDictionary.ClobTypeName"/><fox:destination internal-destination="DBDictionary.DateTypeName"/><fox:destination internal-destination="DBDictionary.DecimalTypeName"/><fox:destination internal-destination="DBDictionary.DistinctTypeName"/><fox:destination internal-destination="DBDictionary.DoubleTypeName"/><fox:destination internal-destination="DBDictionary.FloatTypeName"/><fox:destination internal-destination="DBDictionary.IntegerTypeName"/><fox:destination internal-destination="DBDictionary.JavaObjectTypeName"/><fox:destination internal-destination="DBDictionary.LongVarbinaryTypeName"/><fox:destination internal-destination="DBDictionary.LongVarcharTypeName"/><fox:destination internal-destination="DBDictionary.NullTypeName"/><fox:destination internal-destination="DBDictionary.NumericTypeName"/><fox:destination internal-destination="DBDictionary.OtherTypeName"/><fox:destination internal-destination="DBDictionary.RealTypeName"/><fox:destination internal-destination="DBDictionary.RefTypeName"/><fox:destination internal-destination="DBDictionary.SmallintTypeName"/><fox:destination internal-destination="DBDictionary.StructTypeName"/><fox:destination internal-destination="DBDictionary.TimeTypeName"/><fox:destination internal-destination="DBDictionary.TimestampTypeName"/><fox:destination internal-destination="DBDictionary.TinyintTypeName"/><fox:destination internal-destination="DBDictionary.VarbinaryTypeName"/><fox:destination internal-destination="DBDictionary.VarcharTypeName"/><fox:destination internal-destination="DBDictionary.UseSchemaName"/><fox:destination internal-destination="DBDictionary.TableTypes"/><fox:destination internal-destination="DBDictionary.SupportsSchemaForGetTables"/><fox:destination internal-destination="DBDictionary.SupportsSchemaForGetColumns"/><fox:destination internal-destination="DBDictionary.SupportsNullTableForGetColumns"/><fox:destination internal-destination="DBDictionary.SupportsNullTableForGetPrimaryKeys"/><fox:destination internal-destination="DBDictionary.SupportsNullTableForGetIndexInfo"/><fox:destination internal-destination="DBDictionary.SupportsNullTableForGetImportedKeys"/><fox:destination internal-destination="DBDictionary.UseGetBestRowIdentifierForPrimaryKeys"/><fox:destination internal-destination="DBDictionary.RequiresAutoCommitForMetadata"/><fox:destination internal-destination="DBDictionary.AutoAssignClause"/><fox:destination internal-destination="DBDictionary.AutoAssignTypeName"/><fox:destination internal-destination="DBDictionary.LastGeneratedKeyQuery"/><fox:destination internal-destination="DBDictionary.NextSequenceQuery"/></fox:outline><fox:destination internal-destination="ref_guide_dbsetup_dbdictprops"/><fox:outline internal-destination="ref_guide_dbsetup_dbsupport_mysql"><fox:label>4.4.2.  MySQLDictionary Properties</fox:label><fox:destination internal-destination="MySQLDictionary.DriverDeserializesBlobs"/><fox:destination internal-destination="MySQLDictionary.TableType"/><fox:destination internal-destination="MySQLDictionary.UseClobs"/><fox:destination internal-destination="MySQLDictionary.OptimizeMultiTableDeletes"/></fox:outline><fox:destination internal-destination="ref_guide_dbsetup_dbsupport_mysql"/><fox:outline internal-destination="ref_guide_dbsetup_dbsupport_oracle"><fox:label>4.4.3.  OracleDictionary Properties</fox:label><fox:destination internal-destination="OracleDictionary.UseTriggersForAutoAssign"/><fox:destination internal-destination="OracleDictionary.AutoAssignSequenceName"/><fox:destination internal-destination="OracleDictionary.MaxEmbeddedBlobSize"/><fox:destination internal-destination="OracleDictionary.MaxEmbeddedClobSize"/><fox:destination internal-destination="OracleDictionary.UseSetFormOfUseForUnicode"/></fox:outline><fox:destination internal-destination="ref_guide_dbsetup_dbsupport_oracle"/></fox:outline><fox:destination internal-destination="ref_guide_dbsetup_dbsupport"/><fox:outline internal-destination="ref_guide_dbsetup_isolation"><fox:label>4.5.  Setting the Transaction Isolation</fox:label><fox:destination internal-destination="ref_guide_dbsetup_isoex"/></fox:outline><fox:destination internal-destination="ref_guide_dbsetup_isolation"/><fox:outline internal-destination="ref_guide_dbsetup_sql92"><fox:label>4.6.  Setting the SQL Join Syntax</fox:label><fox:destination internal-destination="ref_guide_dbsetup_sql92_conf"/><fox:destination internal-destination="ref_guide_dbsetup_sql92_fetch"/></fox:outline><fox:destination internal-destination="ref_guide_dbsetup_sql92"/><fox:outline internal-destination="ref_guide_dbsetup_multidb"><fox:label>4.7.  Accessing Multiple Databases</fox:label></fox:outline><fox:destination internal-destination="ref_guide_dbsetup_multidb"/><fox:outline internal-destination="ref_guide_dbsetup_retain"><fox:label>4.8.  Configuring the Use of JDBC Connections</fox:label><fox:destination internal-destination="ref_guide_dbsetup_sql92_retain_conf"/><fox:destination internal-destination="ref_guide_dbsetup_sql92_retain_runtime"/></fox:outline><fox:destination internal-destination="ref_guide_dbsetup_retain"/><fox:outline internal-destination="ref_guide_dbsetup_lrs"><fox:label>4.9.  Large Result Sets</fox:label><fox:destination internal-destination="ref_guide_dbsetup_lrs_def"/><fox:destination internal-destination="ref_guide_dbsetup_lrs_runtime"/></fox:outline><fox:destination internal-destination="ref_guide_dbsetup_lrs"/><fox:outline internal-destination="ref_guide_schema_def"><fox:label>4.10.  Default Schema</fox:label></fox:outline><fox:destination internal-destination="ref_guide_schema_def"/><fox:outline internal-destination="ref_guide_schema_info"><fox:label>4.11.  Schema Reflection</fox:label><fox:outline internal-destination="ref_guide_schema_info_list"><fox:label>4.11.1.  Schemas List</fox:label></fox:outline><fox:destination internal-destination="ref_guide_schema_info_list"/><fox:outline internal-destination="ref_guide_schema_info_factory"><fox:label>4.11.2.  Schema Factory</fox:label></fox:outline><fox:destination internal-destination="ref_guide_schema_info_factory"/></fox:outline><fox:destination internal-destination="ref_guide_schema_info"/><fox:outline internal-destination="ref_guide_schema_schematool"><fox:label>4.12.  Schema Tool</fox:label><fox:destination internal-destination="ref_guide_schema_schematool_create"/><fox:destination internal-destination="ref_guide_schema_schematool_script"/><fox:destination internal-destination="ref_guide_schema_schematool_table_cleanup"/><fox:destination internal-destination="ref_guide_schema_schematool_drop"/><fox:destination internal-destination="ref_guide_schema_schematool_reflect"/></fox:outline><fox:destination internal-destination="ref_guide_schema_schematool"/><fox:outline internal-destination="ref_guide_schema_xml"><fox:label>4.13.  XML Schema Format</fox:label><fox:destination internal-destination="ref_guide_schema_xml_basic"/><fox:destination internal-destination="ref_guide_schema_xml_full"/></fox:outline><fox:destination internal-destination="ref_guide_schema_xml"/></fox:outline><fox:destination internal-destination="ref_guide_dbsetup"/><fox:outline internal-destination="ref_guide_pc"><fox:label>Chapter 5.  Persistent Classes</fox:label><fox:outline internal-destination="ref_guide_pc_pcclasses"><fox:label>5.1.  Persistent Class List</fox:label></fox:outline><fox:destination internal-destination="ref_guide_pc_pcclasses"/><fox:outline internal-destination="ref_guide_pc_enhance"><fox:label>5.2.  Enhancement</fox:label><fox:outline internal-destination="ref_guide_pc_enhance_build"><fox:label>5.2.1.  Enhancing at Build Time</fox:label><fox:destination internal-destination="ref_guide_pc_enhance_enhancer"/></fox:outline><fox:destination internal-destination="ref_guide_pc_enhance_build"/><fox:outline internal-destination="ref_guide_pc_enhance_runtime_container"><fox:label>5.2.2.  Enhancing JPA Entities on Deployment</fox:label></fox:outline><fox:destination internal-destination="ref_guide_pc_enhance_runtime_container"/><fox:outline internal-destination="ref_guide_pc_enhance_runtime"><fox:label>5.2.3.  Enhancing at Runtime</fox:label><fox:destination internal-destination="ref_guide_pc_enhance_runtime_ex"/><fox:destination internal-destination="ref_guide_pc_enhance_runtime_opt_ex"/></fox:outline><fox:destination internal-destination="ref_guide_pc_enhance_runtime"/><fox:outline internal-destination="ref_guide_pc_enhance_unenhanced_types"><fox:label>5.2.4.  Omitting the OpenJPA enhancer</fox:label></fox:outline><fox:destination internal-destination="ref_guide_pc_enhance_unenhanced_types"/></fox:outline><fox:destination internal-destination="ref_guide_pc_enhance"/><fox:outline internal-destination="ref_guide_pc_oid"><fox:label>5.3.  Object Identity</fox:label><fox:outline internal-destination="ref_guide_pc_oid_datastore"><fox:label>5.3.1.  Datastore Identity</fox:label><fox:destination internal-destination="ref_guide_pc_oid_datastoreentityex"/></fox:outline><fox:destination internal-destination="ref_guide_pc_oid_datastore"/><fox:outline internal-destination="ref_guide_pc_oid_entitypk"><fox:label>5.3.2.  Entities as Identity Fields</fox:label><fox:destination internal-destination="ref_guide_pc_oid_entitypk_simplefind"/><fox:destination internal-destination="ref_guide_pc_oid_entitypk_idcls"/></fox:outline><fox:destination internal-destination="ref_guide_pc_oid_entitypk"/><fox:outline internal-destination="ref_guide_pc_oid_application"><fox:label>5.3.3.  Application Identity Tool</fox:label><fox:destination internal-destination="ref_guide_pc_appid_appidtool"/></fox:outline><fox:destination internal-destination="ref_guide_pc_oid_application"/><fox:outline internal-destination="ref_guide_pc_oid_pkgen_autoinc"><fox:label>5.3.4.  Autoassign / Identity Strategy Caveats</fox:label></fox:outline><fox:destination internal-destination="ref_guide_pc_oid_pkgen_autoinc"/></fox:outline><fox:destination internal-destination="ref_guide_pc_oid"/><fox:outline internal-destination="ref_guide_inverses"><fox:label>5.4.  Managed Inverses</fox:label><fox:destination internal-destination="ref_guide_inverses_logicalex"/><fox:destination internal-destination="ref_guide_inversesex"/><fox:destination internal-destination="ref_guide_inverses_logex"/></fox:outline><fox:destination internal-destination="ref_guide_inverses"/><fox:outline internal-destination="ref_guide_pc_scos"><fox:label>5.5.  Persistent Fields</fox:label><fox:outline internal-destination="ref_guide_pc_scos_restore"><fox:label>5.5.1.  Restoring State</fox:label></fox:outline><fox:destination internal-destination="ref_guide_pc_scos_restore"/><fox:outline internal-destination="ref_guide_pc_scos_order"><fox:label>5.5.2.  Typing and Ordering</fox:label><fox:destination internal-destination="ref_guide_pc_scos_order_initialvals"/></fox:outline><fox:destination internal-destination="ref_guide_pc_scos_order"/><fox:outline internal-destination="ref_guide_pc_calendar_timezone"><fox:label>5.5.3.  Calendar Fields and TimeZones</fox:label></fox:outline><fox:destination internal-destination="ref_guide_pc_calendar_timezone"/><fox:outline internal-destination="ref_guide_pc_scos_proxy"><fox:label>5.5.4.  Proxies</fox:label><fox:outline internal-destination="ref_guide_pc_scos_proxy_smart"><fox:label>5.5.4.1.  Smart Proxies</fox:label></fox:outline><fox:destination internal-destination="ref_guide_pc_scos_proxy_smart"/><fox:outline internal-destination="ref_guide_pc_scos_proxy_lrs"><fox:label>5.5.4.2.  Large Result Set Proxies</fox:label><fox:destination internal-destination="ref_guide_pc_scos_proxy_lrs_itr"/><fox:destination internal-destination="ref_guide_pc_scos_proxy_lrs_extension"/></fox:outline><fox:destination internal-destination="ref_guide_pc_scos_proxy_lrs"/><fox:outline internal-destination="ref_guide_pc_scos_proxy_custom"><fox:label>5.5.4.3.  Custom Proxies</fox:label><fox:destination internal-destination="ref_guide_pc_scos_proxy_custom_ex"/></fox:outline><fox:destination internal-destination="ref_guide_pc_scos_proxy_custom"/></fox:outline><fox:destination internal-destination="ref_guide_pc_scos_proxy"/><fox:outline internal-destination="ref_guide_pc_extern"><fox:label>5.5.5.  Externalization</fox:label><fox:destination internal-destination="ref_guide_pc_externex"/><fox:destination internal-destination="ref_guide_pc_extern_queryex"/><fox:outline internal-destination="ref_guide_pc_extern_values"><fox:label>5.5.5.1.  External Values</fox:label><fox:destination internal-destination="externvalues_ex"/></fox:outline><fox:destination internal-destination="ref_guide_pc_extern_values"/></fox:outline><fox:destination internal-destination="ref_guide_pc_extern"/></fox:outline><fox:destination internal-destination="ref_guide_pc_scos"/><fox:outline internal-destination="ref_guide_fetch"><fox:label>5.6.  Fetch Groups</fox:label><fox:outline internal-destination="ref_guide_fetch_custom"><fox:label>5.6.1.  Custom Fetch Groups</fox:label><fox:destination internal-destination="ref_guide_fetch_customgroups"/><fox:destination internal-destination="ref_guide_fetch_loadgroup"/></fox:outline><fox:destination internal-destination="ref_guide_fetch_custom"/><fox:outline internal-destination="ref_guide_fetch_conf"><fox:label>5.6.2.  Custom Fetch Group Configuration</fox:label><fox:destination internal-destination="ref_guide_fetch_conf_query"/></fox:outline><fox:destination internal-destination="ref_guide_fetch_conf"/><fox:outline internal-destination="ref_guide_fetch_single_field"><fox:label>5.6.3.  Per-field Fetch Configuration</fox:label><fox:destination internal-destination="ref_guide_fetch-conf_per_field"/></fox:outline><fox:destination internal-destination="ref_guide_fetch_single_field"/><fox:outline internal-destination="ref_guide_fetch_impl"><fox:label>5.6.4.  Implementation Notes</fox:label></fox:outline><fox:destination internal-destination="ref_guide_fetch_impl"/></fox:outline><fox:destination internal-destination="ref_guide_fetch"/><fox:outline internal-destination="ref_guide_perfpack_eager"><fox:label>5.7.  Eager Fetching</fox:label><fox:outline internal-destination="ref_guide_perfpack_eager_conf"><fox:label>5.7.1.  Configuring Eager Fetching</fox:label><fox:destination internal-destination="ref_guide_perfpack_eager_def"/><fox:destination internal-destination="ref_guide_perfpack_eager_runtime"/></fox:outline><fox:destination internal-destination="ref_guide_perfpack_eager_conf"/><fox:outline internal-destination="ref_guide_perfpack_eager_consider"><fox:label>5.7.2.  Eager Fetching Considerations and Limitations</fox:label></fox:outline><fox:destination internal-destination="ref_guide_perfpack_eager_consider"/></fox:outline><fox:destination internal-destination="ref_guide_perfpack_eager"/></fox:outline><fox:destination internal-destination="ref_guide_pc"/><fox:outline internal-destination="ref_guide_meta"><fox:label>Chapter 6.  Metadata</fox:label><fox:outline internal-destination="ref_guide_meta_factory"><fox:label>6.1.  Metadata Factory</fox:label><fox:destination internal-destination="ref_guide_meta_stdfactoryex"/><fox:destination internal-destination="ref_guide_meta_customfactoryex"/></fox:outline><fox:destination internal-destination="ref_guide_meta_factory"/><fox:outline internal-destination="ref_guide_meta_jpa"><fox:label>6.2.  Additional JPA Metadata</fox:label><fox:outline internal-destination="ref_guide_meta_jpa_datastoreid"><fox:label>6.2.1.  Datastore Identity</fox:label></fox:outline><fox:destination internal-destination="ref_guide_meta_jpa_datastoreid"/><fox:outline internal-destination="ref_guide_meta_jpa_version"><fox:label>6.2.2.  Surrogate Version</fox:label></fox:outline><fox:destination internal-destination="ref_guide_meta_jpa_version"/><fox:outline internal-destination="ref_guide_meta_jpa_persistent"><fox:label>6.2.3.  Persistent Field Values</fox:label></fox:outline><fox:destination internal-destination="ref_guide_meta_jpa_persistent"/><fox:outline internal-destination="ref_guide_meta_jpa_persistent_coll"><fox:label>6.2.4. Persistent Collection Fields</fox:label></fox:outline><fox:destination internal-destination="ref_guide_meta_jpa_persistent_coll"/><fox:outline internal-destination="ref_guide_meta_jpa_persistent_map"><fox:label>6.2.5. Persistent Map Fields</fox:label></fox:outline><fox:destination internal-destination="ref_guide_meta_jpa_persistent_map"/></fox:outline><fox:destination internal-destination="ref_guide_meta_jpa"/><fox:outline internal-destination="ref_guide_meta_ext"><fox:label>6.3.  Metadata Extensions</fox:label><fox:outline internal-destination="ref_guide_meta_class"><fox:label>6.3.1.  Class Extensions</fox:label><fox:outline internal-destination="fetch-groups"><fox:label>6.3.1.1.  Fetch Groups</fox:label></fox:outline><fox:destination internal-destination="fetch-groups"/><fox:outline internal-destination="data-cache"><fox:label>6.3.1.2.  Data Cache</fox:label></fox:outline><fox:destination internal-destination="data-cache"/><fox:outline internal-destination="detached-state-field"><fox:label>6.3.1.3.  Detached State</fox:label></fox:outline><fox:destination internal-destination="detached-state-field"/></fox:outline><fox:destination internal-destination="ref_guide_meta_class"/><fox:outline internal-destination="ref_guide_meta_field"><fox:label>6.3.2.  Field Extensions</fox:label><fox:outline internal-destination="dependent"><fox:label>6.3.2.1.  Dependent</fox:label></fox:outline><fox:destination internal-destination="dependent"/><fox:outline internal-destination="load-fetch-group"><fox:label>6.3.2.2.  Load Fetch Group</fox:label></fox:outline><fox:destination internal-destination="load-fetch-group"/><fox:outline internal-destination="lrs"><fox:label>6.3.2.3.  LRS</fox:label></fox:outline><fox:destination internal-destination="lrs"/><fox:outline internal-destination="inverse-logical"><fox:label>6.3.2.4.  Inverse-Logical</fox:label></fox:outline><fox:destination internal-destination="inverse-logical"/><fox:outline internal-destination="read-only"><fox:label>6.3.2.5.  Read-Only</fox:label></fox:outline><fox:destination internal-destination="read-only"/><fox:outline internal-destination="type"><fox:label>6.3.2.6.  Type</fox:label></fox:outline><fox:destination internal-destination="type"/><fox:outline internal-destination="externalizer"><fox:label>6.3.2.7.  Externalizer</fox:label></fox:outline><fox:destination internal-destination="externalizer"/><fox:outline internal-destination="factory"><fox:label>6.3.2.8.  Factory</fox:label></fox:outline><fox:destination internal-destination="factory"/><fox:outline internal-destination="external-values"><fox:label>6.3.2.9.  External Values</fox:label></fox:outline><fox:destination internal-destination="external-values"/></fox:outline><fox:destination internal-destination="ref_guide_meta_field"/><fox:outline internal-destination="ref_guide_meta_example"><fox:label>6.3.3.  Example</fox:label><fox:destination internal-destination="ref_guide_metaex"/></fox:outline><fox:destination internal-destination="ref_guide_meta_example"/></fox:outline><fox:destination internal-destination="ref_guide_meta_ext"/></fox:outline><fox:destination internal-destination="ref_guide_meta"/><fox:outline internal-destination="ref_guide_mapping"><fox:label>Chapter 7.  Mapping</fox:label><fox:outline internal-destination="ref_guide_mapping_mappingtool"><fox:label>7.1.  Forward Mapping</fox:label><fox:destination internal-destination="ref_guide_mapping_mappingtool_typical"/><fox:outline internal-destination="ref_guide_mapping_mappingtool_examples"><fox:label>7.1.1.  Using the Mapping Tool</fox:label><fox:destination internal-destination="ref_guide_mapping_mappingtool_buildschema"/><fox:destination internal-destination="ref_guide_mapping_mappingtool_cleanup_tables"/><fox:destination internal-destination="ref_guide_mapping_mappingtool_dropschema"/></fox:outline><fox:destination internal-destination="ref_guide_mapping_mappingtool_examples"/><fox:outline internal-destination="ref_guide_ddl_examples"><fox:label>7.1.2.  Generating DDL SQL</fox:label><fox:destination internal-destination="ref_guid_mapping_ddl_full_ddl"/><fox:destination internal-destination="ref_guid_mapping_ddl_part_ddl"/></fox:outline><fox:destination internal-destination="ref_guide_ddl_examples"/><fox:outline internal-destination="ref_guide_mapping_synch"><fox:label>7.1.3.  Runtime Forward Mapping</fox:label><fox:destination internal-destination="ref_guide_mapping_synchex"/></fox:outline><fox:destination internal-destination="ref_guide_mapping_synch"/></fox:outline><fox:destination internal-destination="ref_guide_mapping_mappingtool"/><fox:outline internal-destination="ref_guide_pc_reverse"><fox:label>7.2.  Reverse Mapping</fox:label><fox:destination internal-destination="ref_guide_pc_reverse_schemagen"/><fox:destination internal-destination="ref_guide_pc_reverse_reversemappingtool"/><fox:outline internal-destination="ref_guide_pc_reverse_custom"><fox:label>7.2.1.  Customizing Reverse Mapping</fox:label><fox:destination internal-destination="ref_guide_pc_reverse_custom_ex"/></fox:outline><fox:destination internal-destination="ref_guide_pc_reverse_custom"/></fox:outline><fox:destination internal-destination="ref_guide_pc_reverse"/><fox:outline internal-destination="ref_guide_mapping_middle"><fox:label>7.3.  Meet-in-the-Middle Mapping</fox:label><fox:destination internal-destination="ref_guide_mapping_mappingtool_validate"/></fox:outline><fox:destination internal-destination="ref_guide_mapping_middle"/><fox:outline internal-destination="ref_guide_mapping_defaults"><fox:label>7.4.  Mapping Defaults</fox:label><fox:destination internal-destination="ref_guide_mapping_defaults_conf"/></fox:outline><fox:destination internal-destination="ref_guide_mapping_defaults"/><fox:outline internal-destination="ref_guide_mapping_factory"><fox:label>7.5.  Mapping Factory</fox:label><fox:destination internal-destination="ref_guide_mapping_factory_jpa"/></fox:outline><fox:destination internal-destination="ref_guide_mapping_factory"/><fox:outline internal-destination="ref_guide_mapping_notes_nonstdjoins"><fox:label>7.6.  Non-Standard Joins</fox:label></fox:outline><fox:destination internal-destination="ref_guide_mapping_notes_nonstdjoins"/><fox:outline internal-destination="ref_guide_mapping_jpa"><fox:label>7.7.  Additional JPA Mappings</fox:label><fox:outline internal-destination="ref_guide_mapping_jpa_datastoreid"><fox:label>7.7.1.  Datastore Identity Mapping</fox:label><fox:destination internal-destination="ref_guide_mapping_jpa_datastoreidex"/></fox:outline><fox:destination internal-destination="ref_guide_mapping_jpa_datastoreid"/><fox:outline internal-destination="ref_guide_mapping_jpa_version"><fox:label>7.7.2.  Surrogate Version Mapping</fox:label></fox:outline><fox:destination internal-destination="ref_guide_mapping_jpa_version"/><fox:outline internal-destination="ref_guide_mapping_jpa_columns"><fox:label>7.7.3.  Multi-Column Mappings</fox:label></fox:outline><fox:destination internal-destination="ref_guide_mapping_jpa_columns"/><fox:outline internal-destination="ref_guide_mapping_jpa_fieldjoin"><fox:label>7.7.4.  Join Column Attribute Targets</fox:label></fox:outline><fox:destination internal-destination="ref_guide_mapping_jpa_fieldjoin"/><fox:outline internal-destination="ref_guide_mapping_jpa_embed"><fox:label>7.7.5.  Embedded Mapping</fox:label><fox:destination internal-destination="ref_guide_mapping_jpa_embedex"/></fox:outline><fox:destination internal-destination="ref_guide_mapping_jpa_embed"/><fox:outline internal-destination="ref_guide_mapping_jpa_coll"><fox:label>7.7.6.  Collections</fox:label><fox:outline internal-destination="ref_guide_mapping_jpa_coll_table"><fox:label>7.7.6.1.  Container Table</fox:label></fox:outline><fox:destination internal-destination="ref_guide_mapping_jpa_coll_table"/><fox:outline internal-destination="ref_guide_mapping_jpa_coll_joincols"><fox:label>7.7.6.2.  Element Join Columns</fox:label></fox:outline><fox:destination internal-destination="ref_guide_mapping_jpa_coll_joincols"/><fox:outline internal-destination="ref_guide_mapping_jpa_coll_order"><fox:label>7.7.6.3.  Order Column</fox:label></fox:outline><fox:destination internal-destination="ref_guide_mapping_jpa_coll_order"/></fox:outline><fox:destination internal-destination="ref_guide_mapping_jpa_coll"/><fox:outline internal-destination="ref_guide_mapping_jpa_onemany"><fox:label>7.7.7.  One-Sided One-Many Mapping</fox:label><fox:destination internal-destination="ref_guide_mapping_jpa_onemanyex"/></fox:outline><fox:destination internal-destination="ref_guide_mapping_jpa_onemany"/><fox:outline internal-destination="ref_guide_mapping_jpa_map"><fox:label>7.7.8.  Maps</fox:label></fox:outline><fox:destination internal-destination="ref_guide_mapping_jpa_map"/><fox:outline internal-destination="ref_guide_mapping_jpa_constraints"><fox:label>7.7.9.  Indexes and Constraints</fox:label><fox:outline internal-destination="ref_guide_mapping_jpa_index"><fox:label>7.7.9.1.  Indexes</fox:label></fox:outline><fox:destination internal-destination="ref_guide_mapping_jpa_index"/><fox:outline internal-destination="ref_guide_mapping_jpa_fk"><fox:label>7.7.9.2.  Foreign Keys</fox:label></fox:outline><fox:destination internal-destination="ref_guide_mapping_jpa_fk"/><fox:outline internal-destination="ref_guide_mapping_jpa_unique"><fox:label>7.7.9.3.  Unique Constraints</fox:label></fox:outline><fox:destination internal-destination="ref_guide_mapping_jpa_unique"/></fox:outline><fox:destination internal-destination="ref_guide_mapping_jpa_constraints"/><fox:outline internal-destination="ref_guide_xmlmapping"><fox:label>7.7.10.  XML Column Mapping</fox:label><fox:destination internal-destination="ref_guide_xmlmapping_myaddress"/><fox:destination internal-destination="ref_guide_xmlmapping_address"/><fox:destination internal-destination="ref_guide_xmlmapping_usaaddress"/><fox:destination internal-destination="ref_guide_xmlmapping_canaddress"/><fox:destination internal-destination="ref_guide_xmlmapping_annorder"/><fox:destination internal-destination="ref_guide_xmlmapping_createorder"/><fox:destination internal-destination="ref_guide_xmlmapping_ejbquery"/></fox:outline><fox:destination internal-destination="ref_guide_xmlmapping"/></fox:outline><fox:destination internal-destination="ref_guide_mapping_jpa"/><fox:outline internal-destination="ref_guide_mapping_limits"><fox:label>7.8.  Mapping Limitations</fox:label><fox:outline internal-destination="ref_guide_mapping_limits_tpc"><fox:label>7.8.1.  Table Per Class</fox:label></fox:outline><fox:destination internal-destination="ref_guide_mapping_limits_tpc"/></fox:outline><fox:destination internal-destination="ref_guide_mapping_limits"/><fox:outline internal-destination="ref_guide_mapping_ext"><fox:label>7.9.  Mapping Extensions</fox:label><fox:outline internal-destination="ref_guide_mapping_ext_cls"><fox:label>7.9.1.  Class Extensions</fox:label><fox:outline internal-destination="subclass-fetch-mode"><fox:label>7.9.1.1.  Subclass Fetch Mode</fox:label></fox:outline><fox:destination internal-destination="subclass-fetch-mode"/><fox:outline internal-destination="class-strategy"><fox:label>7.9.1.2.  Strategy</fox:label></fox:outline><fox:destination internal-destination="class-strategy"/><fox:outline internal-destination="discriminator-strategy"><fox:label>7.9.1.3.  Discriminator Strategy</fox:label></fox:outline><fox:destination internal-destination="discriminator-strategy"/><fox:outline internal-destination="version-strategy"><fox:label>7.9.1.4.  Version Strategy</fox:label></fox:outline><fox:destination internal-destination="version-strategy"/></fox:outline><fox:destination internal-destination="ref_guide_mapping_ext_cls"/><fox:outline internal-destination="ref_guide_mapping_ext_field"><fox:label>7.9.2.  Field Extensions</fox:label><fox:outline internal-destination="eager-fetch-mode"><fox:label>7.9.2.1.  Eager Fetch Mode</fox:label></fox:outline><fox:destination internal-destination="eager-fetch-mode"/><fox:outline internal-destination="nonpolymorphic"><fox:label>7.9.2.2.  Nonpolymorphic</fox:label></fox:outline><fox:destination internal-destination="nonpolymorphic"/><fox:outline internal-destination="class-criteria"><fox:label>7.9.2.3.  Class Criteria</fox:label></fox:outline><fox:destination internal-destination="class-criteria"/><fox:outline internal-destination="strategy"><fox:label>7.9.2.4.  Strategy</fox:label></fox:outline><fox:destination internal-destination="strategy"/></fox:outline><fox:destination internal-destination="ref_guide_mapping_ext_field"/></fox:outline><fox:destination internal-destination="ref_guide_mapping_ext"/><fox:outline internal-destination="ref_guide_mapping_custom"><fox:label>7.10.  Custom Mappings</fox:label><fox:outline internal-destination="ref_guide_mapping_custom_class"><fox:label>7.10.1.  Custom Class Mapping</fox:label></fox:outline><fox:destination internal-destination="ref_guide_mapping_custom_class"/><fox:outline internal-destination="ref_guide_mapping_custom_versdiscrim"><fox:label>7.10.2.  Custom Discriminator and Version Strategies</fox:label></fox:outline><fox:destination internal-destination="ref_guide_mapping_custom_versdiscrim"/><fox:outline internal-destination="ref_guide_mapping_custom_field"><fox:label>7.10.3.  Custom Field Mapping</fox:label><fox:outline internal-destination="ref_guide_mapping_custom_vhandler"><fox:label>7.10.3.1.  Value Handlers</fox:label></fox:outline><fox:destination internal-destination="ref_guide_mapping_custom_vhandler"/><fox:outline internal-destination="ref_guide_mapping_custom_fieldstrat"><fox:label>7.10.3.2.  Field Strategies</fox:label></fox:outline><fox:destination internal-destination="ref_guide_mapping_custom_fieldstrat"/><fox:outline internal-destination="ref_guide_mapping_custom_field_conf"><fox:label>7.10.3.3.  Configuration</fox:label></fox:outline><fox:destination internal-destination="ref_guide_mapping_custom_field_conf"/></fox:outline><fox:destination internal-destination="ref_guide_mapping_custom_field"/></fox:outline><fox:destination internal-destination="ref_guide_mapping_custom"/><fox:outline internal-destination="ref_guide_orphan"><fox:label>7.11.  Orphaned Keys</fox:label><fox:destination internal-destination="ref_guide_orphan_logex"/></fox:outline><fox:destination internal-destination="ref_guide_orphan"/></fox:outline><fox:destination internal-destination="ref_guide_mapping"/><fox:outline internal-destination="ref_guide_deploy"><fox:label>Chapter 8.  Deployment</fox:label><fox:outline internal-destination="ref_guide_deploy_factory"><fox:label>8.1.  Factory Deployment</fox:label><fox:outline internal-destination="ref_guide_deploy_factory_standalone"><fox:label>8.1.1.  Standalone Deployment</fox:label></fox:outline><fox:destination internal-destination="ref_guide_deploy_factory_standalone"/><fox:outline internal-destination="ref_guide_deploy_inject"><fox:label>8.1.2.  EntityManager Injection</fox:label></fox:outline><fox:destination internal-destination="ref_guide_deploy_inject"/></fox:outline><fox:destination internal-destination="ref_guide_deploy_factory"/><fox:outline internal-destination="ref_guide_enterprise_trans"><fox:label>8.2.  Integrating with the Transaction Manager</fox:label><fox:destination internal-destination="ref_guide_enterprise_transex"/></fox:outline><fox:destination internal-destination="ref_guide_enterprise_trans"/><fox:outline internal-destination="ref_guide_enterprise_xa"><fox:label>8.3.  XA Transactions</fox:label><fox:outline internal-destination="ref_guide_enterprise_xa_req"><fox:label>8.3.1.  Using OpenJPA with XA Transactions</fox:label></fox:outline><fox:destination internal-destination="ref_guide_enterprise_xa_req"/></fox:outline><fox:destination internal-destination="ref_guide_enterprise_xa"/></fox:outline><fox:destination internal-destination="ref_guide_deploy"/><fox:outline internal-destination="ref_guide_runtime"><fox:label>Chapter 9.  Runtime Extensions</fox:label><fox:outline internal-destination="ref_guide_runtime_arch"><fox:label>9.1.  Architecture</fox:label><fox:outline internal-destination="ref_guide_runtime_broker_finalization"><fox:label>9.1.1.  Broker Finalization</fox:label></fox:outline><fox:destination internal-destination="ref_guide_runtime_broker_finalization"/><fox:outline internal-destination="ref_guide_runtime_broker_extension"><fox:label>9.1.2.  Broker Customization and Finalization</fox:label><fox:destination internal-destination="ref_guide_runtime_pm_evictex"/></fox:outline><fox:destination internal-destination="ref_guide_runtime_broker_extension"/></fox:outline><fox:destination internal-destination="ref_guide_runtime_arch"/><fox:outline internal-destination="ref_guide_runtime_jpa"><fox:label>9.2.  JPA Extensions</fox:label><fox:outline internal-destination="ref_guide_runtime_emfactory"><fox:label>9.2.1.  OpenJPAEntityManagerFactory</fox:label></fox:outline><fox:destination internal-destination="ref_guide_runtime_emfactory"/><fox:outline internal-destination="ref_guide_runtime_em"><fox:label>9.2.2.  OpenJPAEntityManager</fox:label></fox:outline><fox:destination internal-destination="ref_guide_runtime_em"/><fox:outline internal-destination="ref_guide_runtime_jpaquery"><fox:label>9.2.3.  OpenJPAQuery</fox:label></fox:outline><fox:destination internal-destination="ref_guide_runtime_jpaquery"/><fox:outline internal-destination="ref_guide_runtime_jpaextent"><fox:label>9.2.4.  Extent</fox:label><fox:destination internal-destination="ref_guide_runtime_jpaextentex"/></fox:outline><fox:destination internal-destination="ref_guide_runtime_jpaextent"/><fox:outline internal-destination="ref_guide_runtime_jpacache"><fox:label>9.2.5.  StoreCache</fox:label></fox:outline><fox:destination internal-destination="ref_guide_runtime_jpacache"/><fox:outline internal-destination="ref_guide_runtime_jpaquerycache"><fox:label>9.2.6.  QueryResultCache</fox:label></fox:outline><fox:destination internal-destination="ref_guide_runtime_jpaquerycache"/><fox:outline internal-destination="ref_guide_runtime_jpafetch"><fox:label>9.2.7.  FetchPlan</fox:label></fox:outline><fox:destination internal-destination="ref_guide_runtime_jpafetch"/><fox:outline internal-destination="ref_guide_runtime_openjpapersistence"><fox:label>9.2.8.  OpenJPAPersistence</fox:label></fox:outline><fox:destination internal-destination="ref_guide_runtime_openjpapersistence"/></fox:outline><fox:destination internal-destination="ref_guide_runtime_jpa"/><fox:outline internal-destination="ref_guide_locking"><fox:label>9.3.  Object Locking</fox:label><fox:outline internal-destination="ref_guide_locking_default"><fox:label>9.3.1.  Configuring Default Locking</fox:label><fox:destination internal-destination="ref_guide_locking_default_conf"/></fox:outline><fox:destination internal-destination="ref_guide_locking_default"/><fox:outline internal-destination="ref_guide_locking_runtime"><fox:label>9.3.2.  Configuring Lock Levels at Runtime</fox:label><fox:destination internal-destination="ref_guide_locking_fetch"/></fox:outline><fox:destination internal-destination="ref_guide_locking_runtime"/><fox:outline internal-destination="ref_guide_locking_apis"><fox:label>9.3.3.  Object Locking APIs</fox:label><fox:destination internal-destination="ref_guide_locking_explicit"/></fox:outline><fox:destination internal-destination="ref_guide_locking_apis"/><fox:outline internal-destination="ref_guide_locking_lockmgr"><fox:label>9.3.4.  Lock Manager</fox:label><fox:destination internal-destination="ref_guide_locking_disable"/></fox:outline><fox:destination internal-destination="ref_guide_locking_lockmgr"/><fox:outline internal-destination="ref_guide_locking_rules"><fox:label>9.3.5.  Rules for Locking Behavior</fox:label></fox:outline><fox:destination internal-destination="ref_guide_locking_rules"/><fox:outline internal-destination="ref_guide_locking_issues"><fox:label>9.3.6.  Known Issues and Limitations</fox:label></fox:outline><fox:destination internal-destination="ref_guide_locking_issues"/></fox:outline><fox:destination internal-destination="ref_guide_locking"/><fox:outline internal-destination="ref_guide_savepoints"><fox:label>9.4.  Savepoints</fox:label><fox:outline internal-destination="reg_guide_savepoints_using"><fox:label>9.4.1.  Using Savepoints</fox:label><fox:destination internal-destination="ref_guide_savepoints_example"/></fox:outline><fox:destination internal-destination="reg_guide_savepoints_using"/><fox:outline internal-destination="ref_guide_savepoints_conf"><fox:label>9.4.2.  Configuring Savepoints</fox:label></fox:outline><fox:destination internal-destination="ref_guide_savepoints_conf"/></fox:outline><fox:destination internal-destination="ref_guide_savepoints"/><fox:outline internal-destination="ref_guide_enterprise_methodql"><fox:label>9.5.  MethodQL</fox:label></fox:outline><fox:destination internal-destination="ref_guide_enterprise_methodql"/><fox:outline internal-destination="ref_guide_sequence"><fox:label>9.6.  Generators</fox:label><fox:destination internal-destination="ref_guide_sequence_named"/><fox:destination internal-destination="ref_guide_sequence_systemex"/><fox:outline internal-destination="ref_guide_sequence_runtime"><fox:label>9.6.1.  Runtime Access</fox:label></fox:outline><fox:destination internal-destination="ref_guide_sequence_runtime"/></fox:outline><fox:destination internal-destination="ref_guide_sequence"/><fox:outline internal-destination="ref_guide_runtime_pm_event"><fox:label>9.7.  Transaction Events</fox:label></fox:outline><fox:destination internal-destination="ref_guide_runtime_pm_event"/><fox:outline internal-destination="ref_guide_enterprise_abstractstore"><fox:label>9.8.  Non-Relational Stores</fox:label></fox:outline><fox:destination internal-destination="ref_guide_enterprise_abstractstore"/></fox:outline><fox:destination internal-destination="ref_guide_runtime"/><fox:outline internal-destination="ref_guide_caching"><fox:label>Chapter 10.  Caching</fox:label><fox:outline internal-destination="ref_guide_cache"><fox:label>10.1.  Data Cache</fox:label><fox:outline internal-destination="ref_guide_cache_conf"><fox:label>10.1.1.  Data Cache Configuration</fox:label><fox:destination internal-destination="ref_guide_cache_conf_sjvm"/><fox:destination internal-destination="ref_guide_cache_conf_size"/><fox:destination internal-destination="ex_timeout_cache"/></fox:outline><fox:destination internal-destination="ref_guide_cache_conf"/><fox:outline internal-destination="ref_guide_cache_use"><fox:label>10.1.2.  Data Cache Usage</fox:label><fox:destination internal-destination="ref_guide_cache_access_jpa"/><fox:destination internal-destination="ref_guide_cache_use_jpa"/><fox:destination internal-destination="ref_guide_cache_pmevict"/></fox:outline><fox:destination internal-destination="ref_guide_cache_use"/><fox:outline internal-destination="ref_guide_cache_query"><fox:label>10.1.3.  Query Cache</fox:label><fox:destination internal-destination="ref_guide_cache_queryaccess"/><fox:destination internal-destination="ref_guide_cache_cachesize"/><fox:destination internal-destination="ref_guide_cache_disablequery"/><fox:destination internal-destination="ref_guide_cache_query_classchange"/><fox:destination internal-destination="ref_guide_cache_query_pin"/><fox:destination internal-destination="ref_guide_cache_query_disable"/></fox:outline><fox:destination internal-destination="ref_guide_cache_query"/><fox:outline internal-destination="ref_guide_cache_extension"><fox:label>10.1.4.  Cache Extension</fox:label></fox:outline><fox:destination internal-destination="ref_guide_cache_extension"/><fox:outline internal-destination="ref_guide_cache_notes"><fox:label>10.1.5.  Important Notes</fox:label></fox:outline><fox:destination internal-destination="ref_guide_cache_notes"/><fox:outline internal-destination="datastore_cache_issues"><fox:label>10.1.6.  Known Issues and Limitations</fox:label><fox:destination internal-destination="ref_guide_cache_limits_extent"/></fox:outline><fox:destination internal-destination="datastore_cache_issues"/></fox:outline><fox:destination internal-destination="ref_guide_cache"/><fox:outline internal-destination="ref_guide_cache_querycomp"><fox:label>10.2.  Query Compilation Cache</fox:label></fox:outline><fox:destination internal-destination="ref_guide_cache_querycomp"/></fox:outline><fox:destination internal-destination="ref_guide_caching"/><fox:outline internal-destination="ref_guide_remote"><fox:label>Chapter 11.  Remote and Offline Operation</fox:label><fox:outline internal-destination="ref_guide_detach"><fox:label>11.1.  Detach and Attach</fox:label><fox:outline internal-destination="ref_guide_detach_behavior"><fox:label>11.1.1.  Detach Behavior</fox:label></fox:outline><fox:destination internal-destination="ref_guide_detach_behavior"/><fox:outline internal-destination="ref_guide_attach_behavior"><fox:label>11.1.2.  Attach Behavior</fox:label></fox:outline><fox:destination internal-destination="ref_guide_attach_behavior"/><fox:outline internal-destination="ref_guide_detach_graph"><fox:label>11.1.3.  Defining the Detached Object Graph</fox:label><fox:destination internal-destination="ref_guide_detach_graph_confex"/><fox:outline internal-destination="ref_guide_detach_field"><fox:label>11.1.3.1.  Detached State Field</fox:label></fox:outline><fox:destination internal-destination="ref_guide_detach_field"/></fox:outline><fox:destination internal-destination="ref_guide_detach_graph"/></fox:outline><fox:destination internal-destination="ref_guide_detach"/><fox:outline internal-destination="ref_guide_event"><fox:label>11.2.  Remote Event Notification Framework</fox:label><fox:outline internal-destination="ref_guide_event_conf"><fox:label>11.2.1.  Remote Commit Provider Configuration</fox:label><fox:outline internal-destination="ref_guide_event_conf_jms"><fox:label>11.2.1.1.  JMS</fox:label></fox:outline><fox:destination internal-destination="ref_guide_event_conf_jms"/><fox:outline internal-destination="ref_guide_event_conf_tcp"><fox:label>11.2.1.2.  TCP</fox:label><fox:destination internal-destination="ref_guide_event_conf_tcpex"/></fox:outline><fox:destination internal-destination="ref_guide_event_conf_tcp"/><fox:outline internal-destination="ref_guide_event_conf_common"><fox:label>11.2.1.3.  Common Properties</fox:label></fox:outline><fox:destination internal-destination="ref_guide_event_conf_common"/></fox:outline><fox:destination internal-destination="ref_guide_event_conf"/><fox:outline internal-destination="ref_guide_event_customization"><fox:label>11.2.2.  Customization</fox:label></fox:outline><fox:destination internal-destination="ref_guide_event_customization"/></fox:outline><fox:destination internal-destination="ref_guide_event"/></fox:outline><fox:destination internal-destination="ref_guide_remote"/><fox:outline internal-destination="ref_guide_integration"><fox:label>Chapter 12.  Third Party Integration</fox:label><fox:outline internal-destination="ref_guide_integration_ant"><fox:label>12.1.  Apache Ant</fox:label><fox:outline internal-destination="ref_guide_integration_conf"><fox:label>12.1.1.  Common Ant Configuration Options</fox:label><fox:destination internal-destination="ref_guide_integration_conf_config"/><fox:destination internal-destination="ref_guide_integration_props"/><fox:destination internal-destination="ref_guide_integration_propsfile"/><fox:destination internal-destination="ref_guide_integration_conf_classpath"/><fox:destination internal-destination="ref_guide_integration_conf_codeformat"/></fox:outline><fox:destination internal-destination="ref_guide_integration_conf"/><fox:outline internal-destination="ref_guide_integration_enhance"><fox:label>12.1.2.  Enhancer Ant Task</fox:label><fox:destination internal-destination="ref_guide_integration_enhance_task"/></fox:outline><fox:destination internal-destination="ref_guide_integration_enhance"/><fox:outline internal-destination="ref_guide_integration_appidtool"><fox:label>12.1.3.  Application Identity Tool Ant Task</fox:label><fox:destination internal-destination="ref_guide_integration_appidtool_task"/></fox:outline><fox:destination internal-destination="ref_guide_integration_appidtool"/><fox:outline internal-destination="ref_guide_integration_mappingtool"><fox:label>12.1.4.  Mapping Tool Ant Task</fox:label><fox:destination internal-destination="ref_guide_integration_mappingtool_task"/></fox:outline><fox:destination internal-destination="ref_guide_integration_mappingtool"/><fox:outline internal-destination="ref_guide_integration_revmappingtool"><fox:label>12.1.5.  Reverse Mapping Tool Ant Task</fox:label><fox:destination internal-destination="ref_guide_integration_revmappingtool_task"/></fox:outline><fox:destination internal-destination="ref_guide_integration_revmappingtool"/><fox:outline internal-destination="ref_guide_integration_schematool"><fox:label>12.1.6.  Schema Tool Ant Task</fox:label><fox:destination internal-destination="ref_guide_integration_schematool_task"/></fox:outline><fox:destination internal-destination="ref_guide_integration_schematool"/></fox:outline><fox:destination internal-destination="ref_guide_integration_ant"/></fox:outline><fox:destination internal-destination="ref_guide_integration"/><fox:outline internal-destination="ref_guide_optimization"><fox:label>Chapter 13.  Optimization Guidelines</fox:label></fox:outline><fox:destination internal-destination="ref_guide_optimization"/></fox:outline><fox:destination xmlns:fox="http://xml.apache.org/fop/extensions" internal-destination="ref_guide"/><fox:outline xmlns:fox="http://xml.apache.org/fop/extensions" internal-destination="jpa_resources"><fox:label>Appendix 1.  JPA Resources</fox:label></fox:outline><fox:destination xmlns:fox="http://xml.apache.org/fop/extensions" internal-destination="jpa_resources"/><fox:outline xmlns:fox="http://xml.apache.org/fop/extensions" internal-destination="supported_databases"><fox:label>Appendix 2.  Supported Databases</fox:label><fox:outline internal-destination="dbsupport_derby"><fox:label>2.1.  Apache Derby</fox:label><fox:destination internal-destination="example_props_derby"/></fox:outline><fox:destination internal-destination="dbsupport_derby"/><fox:outline internal-destination="dbsupport_interbase"><fox:label>2.2.  Borland Interbase</fox:label><fox:destination internal-destination="example_props_interbase"/><fox:outline internal-destination="dbsupport_interbase_issues"><fox:label>2.2.1.  Known issues with Interbase</fox:label></fox:outline><fox:destination internal-destination="dbsupport_interbase_issues"/></fox:outline><fox:destination internal-destination="dbsupport_interbase"/><fox:outline internal-destination="dbsupport_jdatastore"><fox:label>2.3.  JDataStore</fox:label><fox:destination internal-destination="example_props_jdatastore"/></fox:outline><fox:destination internal-destination="dbsupport_jdatastore"/><fox:outline internal-destination="dbsupport_db2"><fox:label>2.4.  IBM DB2</fox:label><fox:destination internal-destination="example_props_db2"/><fox:outline internal-destination="dbsupport_db2_issues"><fox:label>2.4.1.  Known issues with DB2</fox:label></fox:outline><fox:destination internal-destination="dbsupport_db2_issues"/></fox:outline><fox:destination internal-destination="dbsupport_db2"/><fox:outline internal-destination="dbsupport_empress"><fox:label>2.5.  Empress</fox:label><fox:destination internal-destination="example_props_empress"/><fox:outline internal-destination="dbsupport_empress_issues"><fox:label>2.5.1.  Known issues with Empress</fox:label></fox:outline><fox:destination internal-destination="dbsupport_empress_issues"/></fox:outline><fox:destination internal-destination="dbsupport_empress"/><fox:outline internal-destination="dbsupport_h2"><fox:label>2.6.  H2 Database Engine</fox:label><fox:destination internal-destination="example_props_h2"/><fox:outline internal-destination="dbsupport_h2_issues"><fox:label>2.6.1.  Known issues with H2 Database Engine</fox:label></fox:outline><fox:destination internal-destination="dbsupport_h2_issues"/></fox:outline><fox:destination internal-destination="dbsupport_h2"/><fox:outline internal-destination="dbsupport_hypersonic"><fox:label>2.7.  Hypersonic</fox:label><fox:destination internal-destination="example_props_hypersonic"/><fox:outline internal-destination="dbsupport_hypersonic_issues"><fox:label>2.7.1.  Known issues with Hypersonic</fox:label></fox:outline><fox:destination internal-destination="dbsupport_hypersonic_issues"/></fox:outline><fox:destination internal-destination="dbsupport_hypersonic"/><fox:outline internal-destination="dbsupport_firebird"><fox:label>2.8.  Firebird</fox:label><fox:destination internal-destination="example_props_firebird"/><fox:outline internal-destination="dbsupport_firebird_issues"><fox:label>2.8.1.  Known issues with Firebird</fox:label></fox:outline><fox:destination internal-destination="dbsupport_firebird_issues"/></fox:outline><fox:destination internal-destination="dbsupport_firebird"/><fox:outline internal-destination="dbsupport_informix"><fox:label>2.9.  Informix</fox:label><fox:destination internal-destination="example_props_informix"/><fox:outline internal-destination="dbsupport_informix_issues"><fox:label>2.9.1.  Known issues with Informix</fox:label></fox:outline><fox:destination internal-destination="dbsupport_informix_issues"/></fox:outline><fox:destination internal-destination="dbsupport_informix"/><fox:outline internal-destination="dbsupport_intersystems_cache"><fox:label>2.10.  InterSystems Cache</fox:label><fox:destination internal-destination="example_props_intersystems_cache"/><fox:outline internal-destination="dbsupport_intersystems_cache_issues"><fox:label>2.10.1.  Known issues with InterSystems Cache</fox:label></fox:outline><fox:destination internal-destination="dbsupport_intersystems_cache_issues"/></fox:outline><fox:destination internal-destination="dbsupport_intersystems_cache"/><fox:outline internal-destination="dbsupport_access"><fox:label>2.11.  Microsoft Access</fox:label><fox:destination internal-destination="example_props_access"/><fox:outline internal-destination="dbsupport_access_issues"><fox:label>2.11.1.  Known issues with Microsoft Access</fox:label></fox:outline><fox:destination internal-destination="dbsupport_access_issues"/></fox:outline><fox:destination internal-destination="dbsupport_access"/><fox:outline internal-destination="dbsupport_sqlserver"><fox:label>2.12.  Microsoft SQL Server</fox:label><fox:destination internal-destination="example_props_sqlserver"/><fox:outline internal-destination="dbsupport_sqlserver_issues"><fox:label>2.12.1.  Known issues with SQL Server</fox:label></fox:outline><fox:destination internal-destination="dbsupport_sqlserver_issues"/></fox:outline><fox:destination internal-destination="dbsupport_sqlserver"/><fox:outline internal-destination="dbsupport_foxpro"><fox:label>2.13.  Microsoft FoxPro</fox:label><fox:destination internal-destination="example_props_foxpro"/><fox:outline internal-destination="dbsupport_foxpro_issues"><fox:label>2.13.1.  Known issues with Microsoft FoxPro</fox:label></fox:outline><fox:destination internal-destination="dbsupport_foxpro_issues"/></fox:outline><fox:destination internal-destination="dbsupport_foxpro"/><fox:outline internal-destination="dbsupport_mysql"><fox:label>2.14.  MySQL</fox:label><fox:destination internal-destination="example_props_mysql"/><fox:outline internal-destination="dbsupport_mysql_issues"><fox:label>2.14.1.  Known issues with MySQL</fox:label></fox:outline><fox:destination internal-destination="dbsupport_mysql_issues"/></fox:outline><fox:destination internal-destination="dbsupport_mysql"/><fox:outline internal-destination="dbsupport_oracle"><fox:label>2.15.  Oracle</fox:label><fox:destination internal-destination="example_props_oracle"/><fox:outline internal-destination="dbsupport_oracle_query_hints"><fox:label>2.15.1.  Using Query Hints with Oracle</fox:label><fox:destination internal-destination="dbsupport_oracle_query_hints_ex"/></fox:outline><fox:destination internal-destination="dbsupport_oracle_query_hints"/><fox:outline internal-destination="dbsupport_oracle_issues"><fox:label>2.15.2.  Known issues with Oracle</fox:label></fox:outline><fox:destination internal-destination="dbsupport_oracle_issues"/></fox:outline><fox:destination internal-destination="dbsupport_oracle"/><fox:outline internal-destination="dbsupport_pointbase"><fox:label>2.16.  Pointbase</fox:label><fox:destination internal-destination="example_props_pointbase"/><fox:outline internal-destination="dbsupport_pointbase_issues"><fox:label>2.16.1.  Known issues with Pointbase</fox:label></fox:outline><fox:destination internal-destination="dbsupport_pointbase_issues"/></fox:outline><fox:destination internal-destination="dbsupport_pointbase"/><fox:outline internal-destination="dbsupport_postgresql"><fox:label>2.17.  PostgreSQL</fox:label><fox:destination internal-destination="example_props_postgresql"/><fox:outline internal-destination="dbsupport_postgresql_issues"><fox:label>2.17.1.  Known issues with PostgreSQL</fox:label></fox:outline><fox:destination internal-destination="dbsupport_postgresql_issues"/></fox:outline><fox:destination internal-destination="dbsupport_postgresql"/><fox:outline internal-destination="dbsupport_sybase"><fox:label>2.18.  Sybase Adaptive Server</fox:label><fox:destination internal-destination="example_props_sybase"/><fox:outline internal-destination="dbsupport_sybase_issues"><fox:label>2.18.1.  Known issues with Sybase</fox:label></fox:outline><fox:destination internal-destination="dbsupport_sybase_issues"/></fox:outline><fox:destination internal-destination="dbsupport_sybase"/></fox:outline><fox:destination xmlns:fox="http://xml.apache.org/fop/extensions" internal-destination="supported_databases"/><fox:destination xmlns:fox="http://xml.apache.org/fop/extensions" internal-destination="manual"/><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="titlepage" language="en" format="1" initial-page-number="1" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"/></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"/></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="manual"><fo:block><fo:block><fo:block font-family="sans-serif,Symbol,ZapfDingbats" font-weight="bold" font-size="24.8832pt" text-align="center" padding-top="3cm" space-before="18.6624pt"><fo:block keep-with-next.within-column="always" hyphenate="false">Apache OpenJPA User's Guide</fo:block></fo:block></fo:block><fo:block><fo:block break-after="page"/><fo:block font-size="14.4pt" font-weight="bold" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block>Apache OpenJPA User's Guide</fo:block></fo:block></fo:block><fo:block break-after="page"/></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="lot" language="en" format="i" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>Apache OpenJPA User's Guide</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>Apache OpenJPA User's Guide</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" id="toc...manual"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="introduction">1. Introduction</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="introduction"><fo:page-number-citation ref-id="introduction"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.introduction" margin-left="24pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa_intro">1.
OpenJPA
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa_intro"><fo:page-number-citation ref-id="openjpa_intro"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.openjpa_intro" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa_intro_about">1.1.
About This Document
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa_intro_about"><fo:page-number-citation ref-id="openjpa_intro_about"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview">2. Java Persistence API</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview"><fo:page-number-citation ref-id="jpa_overview"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview" margin-left="24pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_intro">1.
Introduction
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_intro"><fo:page-number-citation ref-id="jpa_overview_intro"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_intro" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_intro_audience">1.1.
Intended Audience
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_intro_audience"><fo:page-number-citation ref-id="jpa_overview_intro_audience"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_intro_transpers">1.2.
Lightweight Persistence
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_intro_transpers"><fo:page-number-citation ref-id="jpa_overview_intro_transpers"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_why">2.
Why JPA?
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_why"><fo:page-number-citation ref-id="jpa_overview_why"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_arch">3.
Java Persistence API Architecture
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_arch"><fo:page-number-citation ref-id="jpa_overview_arch"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_arch" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_arch_exceptions">3.1.
JPA Exceptions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_arch_exceptions"><fo:page-number-citation ref-id="jpa_overview_arch_exceptions"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc">4.
Entity
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc"><fo:page-number-citation ref-id="jpa_overview_pc"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_pc" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_restrict">4.1.
Restrictions on Persistent Classes
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_restrict"><fo:page-number-citation ref-id="jpa_overview_pc_restrict"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_pc_restrict" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_no_arg">4.1.1.
Default or No-Arg Constructor
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_no_arg"><fo:page-number-citation ref-id="jpa_overview_pc_no_arg"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_final">4.1.2.
Final
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_final"><fo:page-number-citation ref-id="jpa_overview_pc_final"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_id">4.1.3.
Identity Fields
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_id"><fo:page-number-citation ref-id="jpa_overview_pc_id"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_version">4.1.4.
Version Field
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_version"><fo:page-number-citation ref-id="jpa_overview_pc_version"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_restrict_inheritance">4.1.5.
Inheritance
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_restrict_inheritance"><fo:page-number-citation ref-id="jpa_overview_pc_restrict_inheritance"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_restrict_fields">4.1.6.
Persistent Fields
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_restrict_fields"><fo:page-number-citation ref-id="jpa_overview_pc_restrict_fields"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_restrict_conclusion">4.1.7.
Conclusions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_restrict_conclusion"><fo:page-number-citation ref-id="jpa_overview_pc_restrict_conclusion"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_identity">4.2.
Entity Identity
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_identity"><fo:page-number-citation ref-id="jpa_overview_pc_identity"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_pc_identity" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_identitycls">4.2.1.
Identity Class
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_identitycls"><fo:page-number-citation ref-id="jpa_overview_pc_identitycls"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_pc_identitycls" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_identity_hierarchy">4.2.1.1.
Identity Hierarchies
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_identity_hierarchy"><fo:page-number-citation ref-id="jpa_overview_pc_identity_hierarchy"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_callbacks">4.3.
Lifecycle Callbacks
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_callbacks"><fo:page-number-citation ref-id="jpa_overview_pc_callbacks"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_pc_callbacks" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_callbacks_methods">4.3.1.
Callback Methods
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_callbacks_methods"><fo:page-number-citation ref-id="jpa_overview_pc_callbacks_methods"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_callbacks_using">4.3.2.
Using Callback Methods
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_callbacks_using"><fo:page-number-citation ref-id="jpa_overview_callbacks_using"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_entity_listeners_using">4.3.3.
Using Entity Listeners
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_entity_listeners_using"><fo:page-number-citation ref-id="jpa_overview_entity_listeners_using"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_entity_listeners_exclude">4.3.4.
Entity Listeners Hierarchy
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_entity_listeners_exclude"><fo:page-number-citation ref-id="jpa_overview_entity_listeners_exclude"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_conclusion">4.4.
Conclusions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_conclusion"><fo:page-number-citation ref-id="jpa_overview_pc_conclusion"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta">5.
Metadata
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta"><fo:page-number-citation ref-id="jpa_overview_meta"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_meta" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_class">5.1.
Class Metadata
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_class"><fo:page-number-citation ref-id="jpa_overview_meta_class"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_meta_class" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_entity">5.1.1.
Entity
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_entity"><fo:page-number-citation ref-id="jpa_overview_meta_entity"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_idclass">5.1.2.
Id Class
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_idclass"><fo:page-number-citation ref-id="jpa_overview_meta_idclass"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_embeddablesuper">5.1.3.
Mapped Superclass
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_embeddablesuper"><fo:page-number-citation ref-id="jpa_overview_meta_embeddablesuper"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_embeddable">5.1.4.
Embeddable
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_embeddable"><fo:page-number-citation ref-id="jpa_overview_meta_embeddable"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_entity_listeners">5.1.5.
EntityListeners
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_entity_listeners"><fo:page-number-citation ref-id="jpa_overview_meta_entity_listeners"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_classex">5.1.6.
Example
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_classex"><fo:page-number-citation ref-id="jpa_overview_meta_classex"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_field">5.2.
Field and Property Metadata
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_field"><fo:page-number-citation ref-id="jpa_overview_meta_field"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_meta_field" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_transient">5.2.1.
Transient
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_transient"><fo:page-number-citation ref-id="jpa_overview_meta_transient"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_id">5.2.2.
Id
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_id"><fo:page-number-citation ref-id="jpa_overview_meta_id"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_gen">5.2.3.
Generated Value
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_gen"><fo:page-number-citation ref-id="jpa_overview_meta_gen"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_embedid">5.2.4.
Embedded Id
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_embedid"><fo:page-number-citation ref-id="jpa_overview_meta_embedid"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_version">5.2.5.
Version
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_version"><fo:page-number-citation ref-id="jpa_overview_meta_version"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_basic">5.2.6.
Basic
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_basic"><fo:page-number-citation ref-id="jpa_overview_meta_basic"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_meta_basic" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_fetch">5.2.6.1.
Fetch Type
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_fetch"><fo:page-number-citation ref-id="jpa_overview_meta_fetch"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_embedded">5.2.7.
Embedded
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_embedded"><fo:page-number-citation ref-id="jpa_overview_meta_embedded"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_manytoone">5.2.8.
Many To One
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_manytoone"><fo:page-number-citation ref-id="jpa_overview_meta_manytoone"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_meta_manytoone" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_cascade">5.2.8.1.
Cascade Type
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_cascade"><fo:page-number-citation ref-id="jpa_overview_meta_cascade"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_onetomany">5.2.9.
One To Many
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_onetomany"><fo:page-number-citation ref-id="jpa_overview_meta_onetomany"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_meta_onetomany" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_mappedby">5.2.9.1.
Bidirectional Relations
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_mappedby"><fo:page-number-citation ref-id="jpa_overview_meta_mappedby"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_onetoone">5.2.10.
One To One
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_onetoone"><fo:page-number-citation ref-id="jpa_overview_meta_onetoone"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_manytomany">5.2.11.
Many To Many
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_manytomany"><fo:page-number-citation ref-id="jpa_overview_meta_manytomany"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_orderby">5.2.12.
Order By
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_orderby"><fo:page-number-citation ref-id="jpa_overview_meta_orderby"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_mapkey">5.2.13.
Map Key
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_mapkey"><fo:page-number-citation ref-id="jpa_overview_meta_mapkey"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_fielddefaults">5.2.14.
Persistent Field Defaults
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_fielddefaults"><fo:page-number-citation ref-id="jpa_overview_meta_fielddefaults"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_xml">5.3.
XML Schema
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_xml"><fo:page-number-citation ref-id="jpa_overview_meta_xml"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_complete">5.4.
Conclusion
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_complete"><fo:page-number-citation ref-id="jpa_overview_meta_complete"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_persistence">6.
Persistence
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_persistence"><fo:page-number-citation ref-id="jpa_overview_persistence"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_persistence" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_persistence_xml">6.1.
persistence.xml
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_persistence_xml"><fo:page-number-citation ref-id="jpa_overview_persistence_xml"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_persistence_use">6.2.
Non-EE Use
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_persistence_use"><fo:page-number-citation ref-id="jpa_overview_persistence_use"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_emfactory">7.
EntityManagerFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_emfactory"><fo:page-number-citation ref-id="jpa_overview_emfactory"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_emfactory" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_emfactory_obtain">7.1.
Obtaining an EntityManagerFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_emfactory_obtain"><fo:page-number-citation ref-id="jpa_overview_emfactory_obtain"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_emfactory_em">7.2.
Obtaining EntityManagers
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_emfactory_em"><fo:page-number-citation ref-id="jpa_overview_emfactory_em"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_emfactory_perscontext">7.3.
Persistence Context
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_emfactory_perscontext"><fo:page-number-citation ref-id="jpa_overview_emfactory_perscontext"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_emfactory_perscontext" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_emfactory_perscontext_trans">7.3.1.
Transaction Persistence Context
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_emfactory_perscontext_trans"><fo:page-number-citation ref-id="jpa_overview_emfactory_perscontext_trans"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_emfactory_perscontext_extend">7.3.2.
Extended Persistence Context
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_emfactory_perscontext_extend"><fo:page-number-citation ref-id="jpa_overview_emfactory_perscontext_extend"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_emfactory_close">7.4.
Closing the EntityManagerFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_emfactory_close"><fo:page-number-citation ref-id="jpa_overview_emfactory_close"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em">8.
EntityManager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em"><fo:page-number-citation ref-id="jpa_overview_em"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_em" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em_trans">8.1.
Transaction Association
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em_trans"><fo:page-number-citation ref-id="jpa_overview_em_trans"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em_lifecycle">8.2.
Entity Lifecycle Management
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em_lifecycle"><fo:page-number-citation ref-id="jpa_overview_em_lifecycle"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em_lifeexamples">8.3.
Lifecycle Examples
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em_lifeexamples"><fo:page-number-citation ref-id="jpa_overview_em_lifeexamples"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em_identity">8.4.
Entity Identity Management
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em_identity"><fo:page-number-citation ref-id="jpa_overview_em_identity"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em_cache">8.5.
Cache Management
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em_cache"><fo:page-number-citation ref-id="jpa_overview_em_cache"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em_query">8.6.
Query Factory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em_query"><fo:page-number-citation ref-id="jpa_overview_em_query"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em_closing">8.7.
Closing
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em_closing"><fo:page-number-citation ref-id="jpa_overview_em_closing"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_trans">9.
Transaction
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_trans"><fo:page-number-citation ref-id="jpa_overview_trans"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_trans" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_trans_types">9.1.
Transaction Types
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_trans_types"><fo:page-number-citation ref-id="jpa_overview_trans_types"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_trans_local">9.2.
The EntityTransaction Interface
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_trans_local"><fo:page-number-citation ref-id="jpa_overview_trans_local"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query">10.
JPA Query
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query"><fo:page-number-citation ref-id="jpa_overview_query"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_query" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_query_api">10.1.
JPQL API
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_query_api"><fo:page-number-citation ref-id="jpa_query_api"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_query_api" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_basic">10.1.1.
Query Basics
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_basic"><fo:page-number-citation ref-id="jpa_overview_query_basic"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_relations">10.1.2.
Relation Traversal
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_relations"><fo:page-number-citation ref-id="jpa_overview_query_relations"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_join_fetch">10.1.3.
Fetch Joins
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_join_fetch"><fo:page-number-citation ref-id="jpa_overview_join_fetch"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_functions">10.1.4.
JPQL Functions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_functions"><fo:page-number-citation ref-id="jpa_overview_query_functions"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_inheritance">10.1.5.
Polymorphic Queries
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_inheritance"><fo:page-number-citation ref-id="jpa_overview_query_inheritance"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_params">10.1.6.
Query Parameters
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_params"><fo:page-number-citation ref-id="jpa_overview_query_params"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_hints">10.1.7.
Query Hints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_hints"><fo:page-number-citation ref-id="jpa_overview_query_hints"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_query_hints" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_hints_locking">10.1.7.1.
Locking Hints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_hints_locking"><fo:page-number-citation ref-id="jpa_hints_locking"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_hints_resultset">10.1.7.2.
Result Set Size Hint
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_hints_resultset"><fo:page-number-citation ref-id="jpa_hints_resultset"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_hints_isolation">10.1.7.3.
Isolation Level Hint
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_hints_isolation"><fo:page-number-citation ref-id="jpa_hints_isolation"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_hints_fetchplan">10.1.7.4.
Other Fetchplan Hints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_hints_fetchplan"><fo:page-number-citation ref-id="jpa_hints_fetchplan"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="d0e6431">10.1.7.5.
Oracle Query Hints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="d0e6431"><fo:page-number-citation ref-id="d0e6431"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_hints_named">10.1.7.6.
Named Query Hints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_hints_named"><fo:page-number-citation ref-id="jpa_hints_named"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_ordering">10.1.8.
Ordering
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_ordering"><fo:page-number-citation ref-id="jpa_overview_query_ordering"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_aggregates">10.1.9.
Aggregates
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_aggregates"><fo:page-number-citation ref-id="jpa_overview_query_aggregates"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_named">10.1.10.
Named Queries
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_named"><fo:page-number-citation ref-id="jpa_overview_query_named"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_delete">10.1.11.
Delete By Query
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_delete"><fo:page-number-citation ref-id="jpa_overview_query_delete"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_update">10.1.12.
Update By Query
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_update"><fo:page-number-citation ref-id="jpa_overview_query_update"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref">10.2.
JPQL Language Reference
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref"><fo:page-number-citation ref-id="jpa_langref"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_langref" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_stmnttypes">10.2.1.
JPQL Statement Types
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_stmnttypes"><fo:page-number-citation ref-id="jpa_langref_stmnttypes"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_langref_stmnttypes" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_select">10.2.1.1.
JPQL Select Statement
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_select"><fo:page-number-citation ref-id="jpa_langref_select"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_bulk">10.2.1.2.
JPQL Update and Delete Statements
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_bulk"><fo:page-number-citation ref-id="jpa_langref_bulk"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_schematypes">10.2.2.
JPQL Abstract Schema Types and Query Domains
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_schematypes"><fo:page-number-citation ref-id="jpa_langref_schematypes"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_langref_schematypes" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_schemanaming">10.2.2.1.
JPQL Entity Naming
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_schemanaming"><fo:page-number-citation ref-id="jpa_langref_schemanaming"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_schemaexample">10.2.2.2.
JPQL Schema Example
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_schemaexample"><fo:page-number-citation ref-id="jpa_langref_schemaexample"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_fromclause">10.2.3.
JPQL FROM Clause and Navigational Declarations
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_fromclause"><fo:page-number-citation ref-id="jpa_langref_fromclause"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_langref_fromclause" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_from_identifiers">10.2.3.1.
JPQL FROM Identifiers
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_from_identifiers"><fo:page-number-citation ref-id="jpa_langref_from_identifiers"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_from_vars">10.2.3.2.
JPQL Identification Variables
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_from_vars"><fo:page-number-citation ref-id="jpa_langref_from_vars"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_range">10.2.3.3.
JPQL Range Declarations
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_range"><fo:page-number-citation ref-id="jpa_langref_range"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_path">10.2.3.4.
JPQL Path Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_path"><fo:page-number-citation ref-id="jpa_langref_path"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_Joins">10.2.3.5.
JPQL Joins
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_Joins"><fo:page-number-citation ref-id="jpa_langref_Joins"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_langref_Joins" margin-left="120pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_inner_joins">10.2.3.5.1.
JPQL Inner Joins (Relationship Joins)
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_inner_joins"><fo:page-number-citation ref-id="jpa_langref_inner_joins"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_outer_joins">10.2.3.5.2.
JPQL Outer Joins
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_outer_joins"><fo:page-number-citation ref-id="jpa_langref_outer_joins"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_fetch_joins">10.2.3.5.3.
JPQL Fetch Joins
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_fetch_joins"><fo:page-number-citation ref-id="jpa_langref_fetch_joins"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_collection_dec">10.2.3.6.
JPQL Collection Member Declarations
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_collection_dec"><fo:page-number-citation ref-id="jpa_langref_collection_dec"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_polymorph">10.2.3.7.
JPQL Polymorphism
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_polymorph"><fo:page-number-citation ref-id="jpa_langref_polymorph"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_where">10.2.4.
JPQL WHERE Clause
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_where"><fo:page-number-citation ref-id="jpa_langref_where"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_cond">10.2.5.
JPQL Conditional Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_cond"><fo:page-number-citation ref-id="jpa_langref_cond"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_langref_cond" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_lit">10.2.5.1.
JPQL Literals
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_lit"><fo:page-number-citation ref-id="jpa_langref_lit"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_idvar">10.2.5.2.
JPQL Identification Variables
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_idvar"><fo:page-number-citation ref-id="jpa_langref_idvar"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_path_exp">10.2.5.3.
JPQL Path Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_path_exp"><fo:page-number-citation ref-id="jpa_langref_path_exp"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_input_params">10.2.5.4.
JPQL Input Parameters
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_input_params"><fo:page-number-citation ref-id="jpa_langref_input_params"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_langref_input_params" margin-left="120pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_pos_params">10.2.5.4.1.
JPQL Positional Parameters
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_pos_params"><fo:page-number-citation ref-id="jpa_langref_pos_params"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_named_params">10.2.5.4.2.
JPQL Named Parameters
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_named_params"><fo:page-number-citation ref-id="jpa_langref_named_params"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_cond_comp">10.2.5.5.
JPQL Conditional Expression Composition
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_cond_comp"><fo:page-number-citation ref-id="jpa_langref_cond_comp"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_operators">10.2.5.6.
JPQL Operators and Operator Precedence
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_operators"><fo:page-number-citation ref-id="jpa_langref_operators"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_between">10.2.5.7.
JPQL Between Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_between"><fo:page-number-citation ref-id="jpa_langref_between"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_in">10.2.5.8.
JPQL In Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_in"><fo:page-number-citation ref-id="jpa_langref_in"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_like">10.2.5.9.
JPQL Like Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_like"><fo:page-number-citation ref-id="jpa_langref_like"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_null">10.2.5.10.
JPQL Null Comparison Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_null"><fo:page-number-citation ref-id="jpa_langref_null"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_empty_comp">10.2.5.11.
JPQL Empty Collection Comparison Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_empty_comp"><fo:page-number-citation ref-id="jpa_langref_empty_comp"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_collection_member">10.2.5.12.
JPQL Collection Member Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_collection_member"><fo:page-number-citation ref-id="jpa_langref_collection_member"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_exists">10.2.5.13.
JPQL Exists Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_exists"><fo:page-number-citation ref-id="jpa_langref_exists"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_all_any">10.2.5.14.
JPQL All or Any Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_all_any"><fo:page-number-citation ref-id="jpa_langref_all_any"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_subqueries">10.2.5.15.
JPQL Subqueries
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_subqueries"><fo:page-number-citation ref-id="jpa_langref_subqueries"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_functional">10.2.5.16.
JPQL Functional Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_functional"><fo:page-number-citation ref-id="jpa_langref_functional"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_langref_functional" margin-left="120pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_string_fun">10.2.5.16.1.
JPQL String Functions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_string_fun"><fo:page-number-citation ref-id="jpa_langref_string_fun"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_arithmetic">10.2.5.16.2.
JPQL Arithmetic Functions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_arithmetic"><fo:page-number-citation ref-id="jpa_langref_arithmetic"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_datetime">10.2.5.16.3.
JPQL Datetime Functions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_datetime"><fo:page-number-citation ref-id="jpa_langref_datetime"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_group">10.2.6.
JPQL GROUP BY, HAVING
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_group"><fo:page-number-citation ref-id="jpa_langref_group"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_select_clause">10.2.7.
JPQL SELECT Clause
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_select_clause"><fo:page-number-citation ref-id="jpa_langref_select_clause"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_langref_select_clause" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_resulttype">10.2.7.1.
JPQL Result Type of the SELECT Clause
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_resulttype"><fo:page-number-citation ref-id="jpa_langref_resulttype"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_constructor">10.2.7.2.
JPQL Constructor Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_constructor"><fo:page-number-citation ref-id="jpa_langref_constructor"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_null_select">10.2.7.3.
JPQL Null Values in the Query Result
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_null_select"><fo:page-number-citation ref-id="jpa_langref_null_select"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_aggregates">10.2.7.4.
JPQL Aggregate Functions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_aggregates"><fo:page-number-citation ref-id="jpa_langref_aggregates"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_langref_aggregates" margin-left="120pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_agg_examples">10.2.7.4.1.
JPQL Aggregate Examples
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_agg_examples"><fo:page-number-citation ref-id="jpa_langref_agg_examples"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_orderby">10.2.8.
JPQL ORDER BY Clause
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_orderby"><fo:page-number-citation ref-id="jpa_langref_orderby"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_bulk_ops">10.2.9.
JPQL Bulk Update and Delete
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_bulk_ops"><fo:page-number-citation ref-id="jpa_langref_bulk_ops"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_null_values">10.2.10.
JPQL Null Values
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_null_values"><fo:page-number-citation ref-id="jpa_langref_null_values"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_equality">10.2.11.
JPQL Equality and Comparison Semantics
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_equality"><fo:page-number-citation ref-id="jpa_langref_equality"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_bnf">10.2.12.
JPQL BNF
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_bnf"><fo:page-number-citation ref-id="jpa_langref_bnf"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_sqlquery">11.
SQL Queries
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_sqlquery"><fo:page-number-citation ref-id="jpa_overview_sqlquery"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_sqlquery" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_sqlquery_create">11.1.
Creating SQL Queries
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_sqlquery_create"><fo:page-number-citation ref-id="jpa_overview_sqlquery_create"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_sqlquery_obj">11.2.
Retrieving Persistent Objects with SQL
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_sqlquery_obj"><fo:page-number-citation ref-id="jpa_overview_sqlquery_obj"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping">12.
Mapping Metadata
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping"><fo:page-number-citation ref-id="jpa_overview_mapping"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_mapping" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_table">12.1.
Table
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_table"><fo:page-number-citation ref-id="jpa_overview_mapping_table"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_unq">12.2.
Unique Constraints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_unq"><fo:page-number-citation ref-id="jpa_overview_mapping_unq"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_column">12.3.
Column
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_column"><fo:page-number-citation ref-id="jpa_overview_mapping_column"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_id">12.4.
Identity Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_id"><fo:page-number-citation ref-id="jpa_overview_mapping_id"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_sequence">12.5.
Generators
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_sequence"><fo:page-number-citation ref-id="jpa_overview_mapping_sequence"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_mapping_sequence" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_sequence_seqgen">12.5.1.
Sequence Generator
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_sequence_seqgen"><fo:page-number-citation ref-id="jpa_overview_mapping_sequence_seqgen"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_sequence_tablegen">12.5.2.
TableGenerator
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_sequence_tablegen"><fo:page-number-citation ref-id="jpa_overview_mapping_sequence_tablegen"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_sequence_genex">12.5.3.
Example
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_sequence_genex"><fo:page-number-citation ref-id="jpa_overview_mapping_sequence_genex"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher">12.6.
Inheritance
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher"><fo:page-number-citation ref-id="jpa_overview_mapping_inher"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_mapping_inher" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_single">12.6.1.
Single Table
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_single"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_single"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_mapping_inher_single" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_single_adv">12.6.1.1.
Advantages
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_single_adv"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_single_adv"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_single_disadv">12.6.1.2.
Disadvantages
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_single_disadv"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_single_disadv"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_joined">12.6.2.
Joined
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_joined"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_joined"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_mapping_inher_joined" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_joined_adv">12.6.2.1.
Advantages
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_joined_adv"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_joined_adv"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_joined_disadv">12.6.2.2.
Disadvantages
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_joined_disadv"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_joined_disadv"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_tpc">12.6.3.
Table Per Class
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_tpc"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_tpc"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_mapping_inher_tpc" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_tpc_adv">12.6.3.1.
Advantages
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_tpc_adv"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_tpc_adv"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_tpc_disadv">12.6.3.2.
Disadvantages
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_tpc_disadv"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_tpc_disadv"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_together">12.6.4.
Putting it All Together
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_together"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_together"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_discrim">12.7.
Discriminator
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_discrim"><fo:page-number-citation ref-id="jpa_overview_mapping_discrim"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_field">12.8.
Field Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_field"><fo:page-number-citation ref-id="jpa_overview_mapping_field"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_mapping_field" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_basic">12.8.1.
Basic Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_basic"><fo:page-number-citation ref-id="jpa_overview_mapping_basic"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.jpa_overview_mapping_basic" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_lob">12.8.1.1.
LOBs
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_lob"><fo:page-number-citation ref-id="jpa_overview_mapping_lob"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_enum">12.8.1.2.
Enumerated
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_enum"><fo:page-number-citation ref-id="jpa_overview_mapping_enum"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_temporal">12.8.1.3.
Temporal Types
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_temporal"><fo:page-number-citation ref-id="jpa_overview_mapping_temporal"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_basic_example">12.8.1.4.
The Updated Mappings
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_basic_example"><fo:page-number-citation ref-id="jpa_overview_mapping_basic_example"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_secondary">12.8.2.
Secondary Tables
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_secondary"><fo:page-number-citation ref-id="jpa_overview_mapping_secondary"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_embed">12.8.3.
Embedded Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_embed"><fo:page-number-citation ref-id="jpa_overview_mapping_embed"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_rel">12.8.4.
Direct Relations
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_rel"><fo:page-number-citation ref-id="jpa_overview_mapping_rel"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_assoccoll">12.8.5.
Join Table
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_assoccoll"><fo:page-number-citation ref-id="jpa_overview_mapping_assoccoll"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_bidi">12.8.6.
Bidirectional Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_bidi"><fo:page-number-citation ref-id="jpa_overview_mapping_bidi"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_map">12.8.7.
Map Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_map"><fo:page-number-citation ref-id="jpa_overview_mapping_map"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_full">12.9.
The Complete Mappings
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_full"><fo:page-number-citation ref-id="jpa_overview_mapping_full"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_conclusion">13.
Conclusion
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_conclusion"><fo:page-number-citation ref-id="jpa_overview_conclusion"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide">3. Reference Guide</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide"><fo:page-number-citation ref-id="ref_guide"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide" margin-left="24pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_intro">1.
Introduction
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_intro"><fo:page-number-citation ref-id="ref_guide_intro"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_intro" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_intro_audience">1.1.
Intended Audience
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_intro_audience"><fo:page-number-citation ref-id="ref_guide_intro_audience"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_conf">2.
Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_conf"><fo:page-number-citation ref-id="ref_guide_conf"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_conf" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_conf_intro">2.1.
Introduction
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_conf_intro"><fo:page-number-citation ref-id="ref_guide_conf_intro"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_conf_specify">2.2.
Runtime Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_conf_specify"><fo:page-number-citation ref-id="ref_guide_conf_specify"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_conf_devtools">2.3.
Command Line Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_conf_devtools"><fo:page-number-citation ref-id="ref_guide_conf_devtools"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_conf_devtools" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_conf_devtools_format">2.3.1.
Code Formatting
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_conf_devtools_format"><fo:page-number-citation ref-id="ref_guide_conf_devtools_format"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_conf_plugins">2.4.
Plugin Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:page-number-citation ref-id="ref_guide_conf_plugins"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_conf_openjpa">2.5.
OpenJPA Properties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_conf_openjpa"><fo:page-number-citation ref-id="ref_guide_conf_openjpa"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_conf_openjpa" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.AutoClear">2.5.1.
openjpa.AutoClear
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.AutoClear"><fo:page-number-citation ref-id="openjpa.AutoClear"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.AutoDetach">2.5.2.
openjpa.AutoDetach
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.AutoDetach"><fo:page-number-citation ref-id="openjpa.AutoDetach"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.BrokerFactory">2.5.3.
openjpa.BrokerFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.BrokerFactory"><fo:page-number-citation ref-id="openjpa.BrokerFactory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.BrokerImpl">2.5.4.
openjpa.BrokerImpl
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.BrokerImpl"><fo:page-number-citation ref-id="openjpa.BrokerImpl"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ClassResolver">2.5.5.
openjpa.ClassResolver
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ClassResolver"><fo:page-number-citation ref-id="openjpa.ClassResolver"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Compatibility">2.5.6.
openjpa.Compatibility
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Compatibility"><fo:page-number-citation ref-id="openjpa.Compatibility"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionDriverName">2.5.7.
openjpa.ConnectionDriverName
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionDriverName"><fo:page-number-citation ref-id="openjpa.ConnectionDriverName"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Connection2DriverName">2.5.8.
openjpa.Connection2DriverName
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Connection2DriverName"><fo:page-number-citation ref-id="openjpa.Connection2DriverName"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionFactory">2.5.9.
openjpa.ConnectionFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionFactory"><fo:page-number-citation ref-id="openjpa.ConnectionFactory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionFactory2">2.5.10.
openjpa.ConnectionFactory2
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionFactory2"><fo:page-number-citation ref-id="openjpa.ConnectionFactory2"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionFactoryName">2.5.11.
openjpa.ConnectionFactoryName
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionFactoryName"><fo:page-number-citation ref-id="openjpa.ConnectionFactoryName"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionFactory2Name">2.5.12.
openjpa.ConnectionFactory2Name
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionFactory2Name"><fo:page-number-citation ref-id="openjpa.ConnectionFactory2Name"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionFactoryMode">2.5.13.
openjpa.ConnectionFactoryMode
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionFactoryMode"><fo:page-number-citation ref-id="openjpa.ConnectionFactoryMode"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionFactoryProperties">2.5.14.
openjpa.ConnectionFactoryProperties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionFactoryProperties"><fo:page-number-citation ref-id="openjpa.ConnectionFactoryProperties"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionFactory2Properties">2.5.15.
openjpa.ConnectionFactory2Properties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionFactory2Properties"><fo:page-number-citation ref-id="openjpa.ConnectionFactory2Properties"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionPassword">2.5.16.
openjpa.ConnectionPassword
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionPassword"><fo:page-number-citation ref-id="openjpa.ConnectionPassword"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Connection2Password">2.5.17.
openjpa.Connection2Password
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Connection2Password"><fo:page-number-citation ref-id="openjpa.Connection2Password"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionProperties">2.5.18.
openjpa.ConnectionProperties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionProperties"><fo:page-number-citation ref-id="openjpa.ConnectionProperties"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Connection2Properties">2.5.19.
openjpa.Connection2Properties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Connection2Properties"><fo:page-number-citation ref-id="openjpa.Connection2Properties"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionURL">2.5.20.
openjpa.ConnectionURL
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionURL"><fo:page-number-citation ref-id="openjpa.ConnectionURL"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Connection2URL">2.5.21.
openjpa.Connection2URL
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Connection2URL"><fo:page-number-citation ref-id="openjpa.Connection2URL"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionUserName">2.5.22.
openjpa.ConnectionUserName
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionUserName"><fo:page-number-citation ref-id="openjpa.ConnectionUserName"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Connection2UserName">2.5.23.
openjpa.Connection2UserName
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Connection2UserName"><fo:page-number-citation ref-id="openjpa.Connection2UserName"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionRetainMode">2.5.24.
openjpa.ConnectionRetainMode
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionRetainMode"><fo:page-number-citation ref-id="openjpa.ConnectionRetainMode"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.DataCache">2.5.25.
openjpa.DataCache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.DataCache"><fo:page-number-citation ref-id="openjpa.DataCache"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.DataCacheManager">2.5.26.
openjpa.DataCacheManager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.DataCacheManager"><fo:page-number-citation ref-id="openjpa.DataCacheManager"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.DataCacheTimeout">2.5.27.
openjpa.DataCacheTimeout
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.DataCacheTimeout"><fo:page-number-citation ref-id="openjpa.DataCacheTimeout"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.DetachState">2.5.28.
openjpa.DetachState
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.DetachState"><fo:page-number-citation ref-id="openjpa.DetachState"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.DynamicDataStructs">2.5.29.
openjpa.DynamicDataStructs
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.DynamicDataStructs"><fo:page-number-citation ref-id="openjpa.DynamicDataStructs"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.FetchBatchSize">2.5.30.
openjpa.FetchBatchSize
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.FetchBatchSize"><fo:page-number-citation ref-id="openjpa.FetchBatchSize"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.FetchGroups">2.5.31.
openjpa.FetchGroups
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.FetchGroups"><fo:page-number-citation ref-id="openjpa.FetchGroups"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.FlushBeforeQueries">2.5.32.
openjpa.FlushBeforeQueries
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.FlushBeforeQueries"><fo:page-number-citation ref-id="openjpa.FlushBeforeQueries"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.IgnoreChanges">2.5.33.
openjpa.IgnoreChanges
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.IgnoreChanges"><fo:page-number-citation ref-id="openjpa.IgnoreChanges"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Id">2.5.34. openjpa.Id</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Id"><fo:page-number-citation ref-id="openjpa.Id"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.InverseManager">2.5.35.
openjpa.InverseManager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.InverseManager"><fo:page-number-citation ref-id="openjpa.InverseManager"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.LockManager">2.5.36.
openjpa.LockManager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.LockManager"><fo:page-number-citation ref-id="openjpa.LockManager"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.LockTimeout">2.5.37.
openjpa.LockTimeout
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.LockTimeout"><fo:page-number-citation ref-id="openjpa.LockTimeout"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Log">2.5.38.
openjpa.Log
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Log"><fo:page-number-citation ref-id="openjpa.Log"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ManagedRuntime">2.5.39.
openjpa.ManagedRuntime
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ManagedRuntime"><fo:page-number-citation ref-id="openjpa.ManagedRuntime"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Mapping">2.5.40.
openjpa.Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Mapping"><fo:page-number-citation ref-id="openjpa.Mapping"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.MaxFetchDepth">2.5.41.
openjpa.MaxFetchDepth
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.MaxFetchDepth"><fo:page-number-citation ref-id="openjpa.MaxFetchDepth"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.MetaDataFactory">2.5.42.
openjpa.MetaDataFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.MetaDataFactory"><fo:page-number-citation ref-id="openjpa.MetaDataFactory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Multithreaded">2.5.43.
openjpa.Multithreaded
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Multithreaded"><fo:page-number-citation ref-id="openjpa.Multithreaded"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Optimistic">2.5.44.
openjpa.Optimistic
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Optimistic"><fo:page-number-citation ref-id="openjpa.Optimistic"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.OrphanedKeyAction">2.5.45.
openjpa.OrphanedKeyAction
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.OrphanedKeyAction"><fo:page-number-citation ref-id="openjpa.OrphanedKeyAction"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.NontransactionalRead">2.5.46.
openjpa.NontransactionalRead
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.NontransactionalRead"><fo:page-number-citation ref-id="openjpa.NontransactionalRead"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.NontransactionalWrite">2.5.47.
openjpa.NontransactionalWrite
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.NontransactionalWrite"><fo:page-number-citation ref-id="openjpa.NontransactionalWrite"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ProxyManager">2.5.48.
openjpa.ProxyManager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ProxyManager"><fo:page-number-citation ref-id="openjpa.ProxyManager"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.QueryCache">2.5.49.
openjpa.QueryCache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.QueryCache"><fo:page-number-citation ref-id="openjpa.QueryCache"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.QueryCompilationCache">2.5.50.
openjpa.QueryCompilationCache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.QueryCompilationCache"><fo:page-number-citation ref-id="openjpa.QueryCompilationCache"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ReadLockLevel">2.5.51.
openjpa.ReadLockLevel
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ReadLockLevel"><fo:page-number-citation ref-id="openjpa.ReadLockLevel"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.RemoteCommitProvider">2.5.52.
openjpa.RemoteCommitProvider
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.RemoteCommitProvider"><fo:page-number-citation ref-id="openjpa.RemoteCommitProvider"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.RestoreState">2.5.53.
openjpa.RestoreState
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.RestoreState"><fo:page-number-citation ref-id="openjpa.RestoreState"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.RetainState">2.5.54.
openjpa.RetainState
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.RetainState"><fo:page-number-citation ref-id="openjpa.RetainState"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.RetryClassRegistration">2.5.55.
openjpa.RetryClassRegistration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.RetryClassRegistration"><fo:page-number-citation ref-id="openjpa.RetryClassRegistration"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.SavepointManager">2.5.56.
openjpa.SavepointManager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.SavepointManager"><fo:page-number-citation ref-id="openjpa.SavepointManager"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Sequence">2.5.57.
openjpa.Sequence
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Sequence"><fo:page-number-citation ref-id="openjpa.Sequence"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.TransactionMode">2.5.58.
openjpa.TransactionMode
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.TransactionMode"><fo:page-number-citation ref-id="openjpa.TransactionMode"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.WriteLockLevel">2.5.59.
openjpa.WriteLockLevel
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.WriteLockLevel"><fo:page-number-citation ref-id="openjpa.WriteLockLevel"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_conf_jdbc">2.6.
OpenJPA JDBC Properties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_conf_jdbc"><fo:page-number-citation ref-id="ref_guide_conf_jdbc"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_conf_jdbc" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.ConnectionDecorators">2.6.1.
openjpa.jdbc.ConnectionDecorators
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.ConnectionDecorators"><fo:page-number-citation ref-id="openjpa.jdbc.ConnectionDecorators"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.DBDictionary">2.6.2.
openjpa.jdbc.DBDictionary
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.DBDictionary"><fo:page-number-citation ref-id="openjpa.jdbc.DBDictionary"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.DriverDataSource">2.6.3.
openjpa.jdbc.DriverDataSource
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.DriverDataSource"><fo:page-number-citation ref-id="openjpa.jdbc.DriverDataSource"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.EagerFetchMode">2.6.4.
openjpa.jdbc.EagerFetchMode
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.EagerFetchMode"><fo:page-number-citation ref-id="openjpa.jdbc.EagerFetchMode"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.FetchDirection">2.6.5.
openjpa.jdbc.FetchDirection
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.FetchDirection"><fo:page-number-citation ref-id="openjpa.jdbc.FetchDirection"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.JDBCListeners">2.6.6.
openjpa.jdbc.JDBCListeners
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.JDBCListeners"><fo:page-number-citation ref-id="openjpa.jdbc.JDBCListeners"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.LRSSize">2.6.7.
openjpa.jdbc.LRSSize
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.LRSSize"><fo:page-number-citation ref-id="openjpa.jdbc.LRSSize"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.MappingDefaults">2.6.8.
openjpa.jdbc.MappingDefaults
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.MappingDefaults"><fo:page-number-citation ref-id="openjpa.jdbc.MappingDefaults"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.MappingFactory">2.6.9.
openjpa.jdbc.MappingFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.MappingFactory"><fo:page-number-citation ref-id="openjpa.jdbc.MappingFactory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.ResultSetType">2.6.10.
openjpa.jdbc.ResultSetType
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.ResultSetType"><fo:page-number-citation ref-id="openjpa.jdbc.ResultSetType"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.Schema">2.6.11.
openjpa.jdbc.Schema
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.Schema"><fo:page-number-citation ref-id="openjpa.jdbc.Schema"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.SchemaFactory">2.6.12.
openjpa.jdbc.SchemaFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.SchemaFactory"><fo:page-number-citation ref-id="openjpa.jdbc.SchemaFactory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.Schemas">2.6.13.
openjpa.jdbc.Schemas
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.Schemas"><fo:page-number-citation ref-id="openjpa.jdbc.Schemas"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.SQLFactory">2.6.14.
openjpa.jdbc.SQLFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.SQLFactory"><fo:page-number-citation ref-id="openjpa.jdbc.SQLFactory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.SubclassFetchMode">2.6.15.
openjpa.jdbc.SubclassFetchMode
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.SubclassFetchMode"><fo:page-number-citation ref-id="openjpa.jdbc.SubclassFetchMode"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.SynchronizeMappings">2.6.16.
openjpa.jdbc.SynchronizeMappings
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.SynchronizeMappings"><fo:page-number-citation ref-id="openjpa.jdbc.SynchronizeMappings"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.TransactionIsolation">2.6.17.
openjpa.jdbc.TransactionIsolation
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.TransactionIsolation"><fo:page-number-citation ref-id="openjpa.jdbc.TransactionIsolation"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.UpdateManager">2.6.18.
openjpa.jdbc.UpdateManager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.UpdateManager"><fo:page-number-citation ref-id="openjpa.jdbc.UpdateManager"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging">3.
Logging
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging"><fo:page-number-citation ref-id="ref_guide_logging"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_logging" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_channels">3.1.
Logging Channels
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_channels"><fo:page-number-citation ref-id="ref_guide_logging_channels"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_openjpa">3.2.
OpenJPA Logging
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_openjpa"><fo:page-number-citation ref-id="ref_guide_logging_openjpa"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_noop">3.3.
Disabling Logging
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_noop"><fo:page-number-citation ref-id="ref_guide_logging_noop"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_log4j">3.4.
Log4J
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_log4j"><fo:page-number-citation ref-id="ref_guide_logging_log4j"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_commons">3.5.
Apache Commons Logging
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_commons"><fo:page-number-citation ref-id="ref_guide_logging_commons"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_logging_commons" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_jdk14">3.5.1.
JDK 1.4 java.util.logging
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_jdk14"><fo:page-number-citation ref-id="ref_guide_logging_jdk14"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_custom">3.6.
Custom Log
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_custom"><fo:page-number-citation ref-id="ref_guide_logging_custom"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup">4.
JDBC
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup"><fo:page-number-citation ref-id="ref_guide_dbsetup"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_dbsetup" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_builtin">4.1.
Using the OpenJPA DataSource
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_builtin"><fo:page-number-citation ref-id="ref_guide_dbsetup_builtin"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_thirdparty">4.2.
Using a Third-Party DataSource
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_thirdparty"><fo:page-number-citation ref-id="ref_guide_dbsetup_thirdparty"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_dbsetup_thirdparty" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_thirdparty_enlist">4.2.1.
Managed and XA DataSources
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_thirdparty_enlist"><fo:page-number-citation ref-id="ref_guide_dbsetup_thirdparty_enlist"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_sqlconn">4.3.
Runtime Access to DataSource
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_sqlconn"><fo:page-number-citation ref-id="ref_guide_dbsetup_sqlconn"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_dbsupport">4.4.
Database Support
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_dbsupport"><fo:page-number-citation ref-id="ref_guide_dbsetup_dbsupport"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_dbsetup_dbsupport" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_dbdictprops">4.4.1.
DBDictionary Properties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_dbdictprops"><fo:page-number-citation ref-id="ref_guide_dbsetup_dbdictprops"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_dbsupport_mysql">4.4.2.
MySQLDictionary Properties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_dbsupport_mysql"><fo:page-number-citation ref-id="ref_guide_dbsetup_dbsupport_mysql"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_dbsupport_oracle">4.4.3.
OracleDictionary Properties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_dbsupport_oracle"><fo:page-number-citation ref-id="ref_guide_dbsetup_dbsupport_oracle"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_isolation">4.5.
Setting the Transaction Isolation
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_isolation"><fo:page-number-citation ref-id="ref_guide_dbsetup_isolation"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_sql92">4.6.
Setting the SQL Join Syntax
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_sql92"><fo:page-number-citation ref-id="ref_guide_dbsetup_sql92"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_multidb">4.7.
Accessing Multiple Databases
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_multidb"><fo:page-number-citation ref-id="ref_guide_dbsetup_multidb"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_retain">4.8.
Configuring the Use of JDBC Connections
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_retain"><fo:page-number-citation ref-id="ref_guide_dbsetup_retain"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_lrs">4.9.
Large Result Sets
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_lrs"><fo:page-number-citation ref-id="ref_guide_dbsetup_lrs"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_schema_def">4.10.
Default Schema
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_schema_def"><fo:page-number-citation ref-id="ref_guide_schema_def"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_schema_info">4.11.
Schema Reflection
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_schema_info"><fo:page-number-citation ref-id="ref_guide_schema_info"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_schema_info" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_schema_info_list">4.11.1.
Schemas List
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_schema_info_list"><fo:page-number-citation ref-id="ref_guide_schema_info_list"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_schema_info_factory">4.11.2.
Schema Factory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_schema_info_factory"><fo:page-number-citation ref-id="ref_guide_schema_info_factory"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_schema_schematool">4.12.
Schema Tool
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_schema_schematool"><fo:page-number-citation ref-id="ref_guide_schema_schematool"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_schema_xml">4.13.
XML Schema Format
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_schema_xml"><fo:page-number-citation ref-id="ref_guide_schema_xml"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc">5.
Persistent Classes
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc"><fo:page-number-citation ref-id="ref_guide_pc"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_pc" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_pcclasses">5.1.
Persistent Class List
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_pcclasses"><fo:page-number-citation ref-id="ref_guide_pc_pcclasses"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_enhance">5.2.
Enhancement
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_enhance"><fo:page-number-citation ref-id="ref_guide_pc_enhance"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_pc_enhance" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_enhance_build">5.2.1.
Enhancing at Build Time
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_enhance_build"><fo:page-number-citation ref-id="ref_guide_pc_enhance_build"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_enhance_runtime_container">5.2.2.
Enhancing JPA Entities on Deployment
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_enhance_runtime_container"><fo:page-number-citation ref-id="ref_guide_pc_enhance_runtime_container"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_enhance_runtime">5.2.3.
Enhancing at Runtime
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_enhance_runtime"><fo:page-number-citation ref-id="ref_guide_pc_enhance_runtime"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_enhance_unenhanced_types">5.2.4.
Omitting the OpenJPA enhancer
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_enhance_unenhanced_types"><fo:page-number-citation ref-id="ref_guide_pc_enhance_unenhanced_types"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_oid">5.3.
Object Identity
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_oid"><fo:page-number-citation ref-id="ref_guide_pc_oid"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_pc_oid" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_oid_datastore">5.3.1.
Datastore Identity
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_oid_datastore"><fo:page-number-citation ref-id="ref_guide_pc_oid_datastore"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_oid_entitypk">5.3.2.
Entities as Identity Fields
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_oid_entitypk"><fo:page-number-citation ref-id="ref_guide_pc_oid_entitypk"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_oid_application">5.3.3.
Application Identity Tool
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_oid_application"><fo:page-number-citation ref-id="ref_guide_pc_oid_application"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_oid_pkgen_autoinc">5.3.4.
Autoassign / Identity Strategy Caveats
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_oid_pkgen_autoinc"><fo:page-number-citation ref-id="ref_guide_pc_oid_pkgen_autoinc"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_inverses">5.4.
Managed Inverses
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_inverses"><fo:page-number-citation ref-id="ref_guide_inverses"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_scos">5.5.
Persistent Fields
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_scos"><fo:page-number-citation ref-id="ref_guide_pc_scos"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_pc_scos" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_scos_restore">5.5.1.
Restoring State
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_scos_restore"><fo:page-number-citation ref-id="ref_guide_pc_scos_restore"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_scos_order">5.5.2.
Typing and Ordering
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_scos_order"><fo:page-number-citation ref-id="ref_guide_pc_scos_order"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_calendar_timezone">5.5.3.
Calendar Fields and TimeZones
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_calendar_timezone"><fo:page-number-citation ref-id="ref_guide_pc_calendar_timezone"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_scos_proxy">5.5.4.
Proxies
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_scos_proxy"><fo:page-number-citation ref-id="ref_guide_pc_scos_proxy"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_pc_scos_proxy" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_scos_proxy_smart">5.5.4.1.
Smart Proxies
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_scos_proxy_smart"><fo:page-number-citation ref-id="ref_guide_pc_scos_proxy_smart"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_scos_proxy_lrs">5.5.4.2.
Large Result Set Proxies
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_scos_proxy_lrs"><fo:page-number-citation ref-id="ref_guide_pc_scos_proxy_lrs"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_scos_proxy_custom">5.5.4.3.
Custom Proxies
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_scos_proxy_custom"><fo:page-number-citation ref-id="ref_guide_pc_scos_proxy_custom"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_extern">5.5.5.
Externalization
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_extern"><fo:page-number-citation ref-id="ref_guide_pc_extern"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_pc_extern" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_extern_values">5.5.5.1.
External Values
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_extern_values"><fo:page-number-citation ref-id="ref_guide_pc_extern_values"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_fetch">5.6.
Fetch Groups
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_fetch"><fo:page-number-citation ref-id="ref_guide_fetch"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_fetch" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_fetch_custom">5.6.1.
Custom Fetch Groups
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_fetch_custom"><fo:page-number-citation ref-id="ref_guide_fetch_custom"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_fetch_conf">5.6.2.
Custom Fetch Group Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_fetch_conf"><fo:page-number-citation ref-id="ref_guide_fetch_conf"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_fetch_single_field">5.6.3.
Per-field Fetch Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_fetch_single_field"><fo:page-number-citation ref-id="ref_guide_fetch_single_field"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_fetch_impl">5.6.4.
Implementation Notes
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_fetch_impl"><fo:page-number-citation ref-id="ref_guide_fetch_impl"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_perfpack_eager">5.7.
Eager Fetching
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_perfpack_eager"><fo:page-number-citation ref-id="ref_guide_perfpack_eager"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_perfpack_eager" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_perfpack_eager_conf">5.7.1.
Configuring Eager Fetching
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_perfpack_eager_conf"><fo:page-number-citation ref-id="ref_guide_perfpack_eager_conf"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_perfpack_eager_consider">5.7.2.
Eager Fetching Considerations and Limitations
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_perfpack_eager_consider"><fo:page-number-citation ref-id="ref_guide_perfpack_eager_consider"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta">6.
Metadata
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta"><fo:page-number-citation ref-id="ref_guide_meta"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_meta" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_factory">6.1.
Metadata Factory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_factory"><fo:page-number-citation ref-id="ref_guide_meta_factory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_jpa">6.2.
Additional JPA Metadata
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_jpa"><fo:page-number-citation ref-id="ref_guide_meta_jpa"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_meta_jpa" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_jpa_datastoreid">6.2.1.
Datastore Identity
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_jpa_datastoreid"><fo:page-number-citation ref-id="ref_guide_meta_jpa_datastoreid"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_jpa_version">6.2.2.
Surrogate Version
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_jpa_version"><fo:page-number-citation ref-id="ref_guide_meta_jpa_version"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_jpa_persistent">6.2.3.
Persistent Field Values
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_jpa_persistent"><fo:page-number-citation ref-id="ref_guide_meta_jpa_persistent"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_jpa_persistent_coll">6.2.4. Persistent Collection Fields</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_jpa_persistent_coll"><fo:page-number-citation ref-id="ref_guide_meta_jpa_persistent_coll"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_jpa_persistent_map">6.2.5. Persistent Map Fields</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_jpa_persistent_map"><fo:page-number-citation ref-id="ref_guide_meta_jpa_persistent_map"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_ext">6.3.
Metadata Extensions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_ext"><fo:page-number-citation ref-id="ref_guide_meta_ext"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_meta_ext" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_class">6.3.1.
Class Extensions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_class"><fo:page-number-citation ref-id="ref_guide_meta_class"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_meta_class" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="fetch-groups">6.3.1.1.
Fetch Groups
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="fetch-groups"><fo:page-number-citation ref-id="fetch-groups"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="data-cache">6.3.1.2.
Data Cache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="data-cache"><fo:page-number-citation ref-id="data-cache"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="detached-state-field">6.3.1.3.
Detached State
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="detached-state-field"><fo:page-number-citation ref-id="detached-state-field"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_field">6.3.2.
Field Extensions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_field"><fo:page-number-citation ref-id="ref_guide_meta_field"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_meta_field" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dependent">6.3.2.1.
Dependent
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dependent"><fo:page-number-citation ref-id="dependent"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="load-fetch-group">6.3.2.2.
Load Fetch Group
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="load-fetch-group"><fo:page-number-citation ref-id="load-fetch-group"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="lrs">6.3.2.3.
LRS
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="lrs"><fo:page-number-citation ref-id="lrs"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="inverse-logical">6.3.2.4.
Inverse-Logical
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="inverse-logical"><fo:page-number-citation ref-id="inverse-logical"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="read-only">6.3.2.5.
Read-Only
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="read-only"><fo:page-number-citation ref-id="read-only"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="type">6.3.2.6.
Type
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="type"><fo:page-number-citation ref-id="type"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="externalizer">6.3.2.7.
Externalizer
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="externalizer"><fo:page-number-citation ref-id="externalizer"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="factory">6.3.2.8.
Factory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="factory"><fo:page-number-citation ref-id="factory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="external-values">6.3.2.9.
External Values
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="external-values"><fo:page-number-citation ref-id="external-values"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_example">6.3.3.
Example
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_example"><fo:page-number-citation ref-id="ref_guide_meta_example"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping">7.
Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping"><fo:page-number-citation ref-id="ref_guide_mapping"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_mapping" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_mappingtool">7.1.
Forward Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_mappingtool"><fo:page-number-citation ref-id="ref_guide_mapping_mappingtool"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_mapping_mappingtool" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_mappingtool_examples">7.1.1.
Using the Mapping Tool
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_mappingtool_examples"><fo:page-number-citation ref-id="ref_guide_mapping_mappingtool_examples"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_ddl_examples">7.1.2.
Generating DDL SQL
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_ddl_examples"><fo:page-number-citation ref-id="ref_guide_ddl_examples"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_synch">7.1.3.
Runtime Forward Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_synch"><fo:page-number-citation ref-id="ref_guide_mapping_synch"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_reverse">7.2.
Reverse Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_reverse"><fo:page-number-citation ref-id="ref_guide_pc_reverse"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_pc_reverse" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_reverse_custom">7.2.1.
Customizing Reverse Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_reverse_custom"><fo:page-number-citation ref-id="ref_guide_pc_reverse_custom"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_middle">7.3.
Meet-in-the-Middle Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_middle"><fo:page-number-citation ref-id="ref_guide_mapping_middle"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_defaults">7.4.
Mapping Defaults
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_defaults"><fo:page-number-citation ref-id="ref_guide_mapping_defaults"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_factory">7.5.
Mapping Factory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_factory"><fo:page-number-citation ref-id="ref_guide_mapping_factory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_notes_nonstdjoins">7.6.
Non-Standard Joins
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_notes_nonstdjoins"><fo:page-number-citation ref-id="ref_guide_mapping_notes_nonstdjoins"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa">7.7.
Additional JPA Mappings
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa"><fo:page-number-citation ref-id="ref_guide_mapping_jpa"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_mapping_jpa" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_datastoreid">7.7.1.
Datastore Identity Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_datastoreid"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_datastoreid"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_version">7.7.2.
Surrogate Version Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_version"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_version"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_columns">7.7.3.
Multi-Column Mappings
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_columns"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_columns"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_fieldjoin">7.7.4.
Join Column Attribute Targets
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_fieldjoin"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_fieldjoin"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_embed">7.7.5.
Embedded Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_embed"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_embed"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_coll">7.7.6.
Collections
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_coll"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_coll"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_mapping_jpa_coll" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_coll_table">7.7.6.1.
Container Table
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_coll_table"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_coll_table"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_coll_joincols">7.7.6.2.
Element Join Columns
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_coll_joincols"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_coll_joincols"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_coll_order">7.7.6.3.
Order Column
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_coll_order"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_coll_order"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_onemany">7.7.7.
One-Sided One-Many Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_onemany"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_onemany"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_map">7.7.8.
Maps
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_map"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_map"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_constraints">7.7.9.
Indexes and Constraints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_constraints"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_constraints"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_mapping_jpa_constraints" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_index">7.7.9.1.
Indexes
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_index"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_index"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_fk">7.7.9.2.
Foreign Keys
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_fk"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_fk"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_unique">7.7.9.3.
Unique Constraints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_unique"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_unique"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_xmlmapping">7.7.10.
XML Column Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_xmlmapping"><fo:page-number-citation ref-id="ref_guide_xmlmapping"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_limits">7.8.
Mapping Limitations
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_limits"><fo:page-number-citation ref-id="ref_guide_mapping_limits"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_mapping_limits" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_limits_tpc">7.8.1.
Table Per Class
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_limits_tpc"><fo:page-number-citation ref-id="ref_guide_mapping_limits_tpc"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_ext">7.9.
Mapping Extensions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_ext"><fo:page-number-citation ref-id="ref_guide_mapping_ext"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_mapping_ext" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_ext_cls">7.9.1.
Class Extensions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_ext_cls"><fo:page-number-citation ref-id="ref_guide_mapping_ext_cls"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_mapping_ext_cls" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="subclass-fetch-mode">7.9.1.1.
Subclass Fetch Mode
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="subclass-fetch-mode"><fo:page-number-citation ref-id="subclass-fetch-mode"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="class-strategy">7.9.1.2.
Strategy
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="class-strategy"><fo:page-number-citation ref-id="class-strategy"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="discriminator-strategy">7.9.1.3.
Discriminator Strategy
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="discriminator-strategy"><fo:page-number-citation ref-id="discriminator-strategy"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="version-strategy">7.9.1.4.
Version Strategy
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="version-strategy"><fo:page-number-citation ref-id="version-strategy"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_ext_field">7.9.2.
Field Extensions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_ext_field"><fo:page-number-citation ref-id="ref_guide_mapping_ext_field"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_mapping_ext_field" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="eager-fetch-mode">7.9.2.1.
Eager Fetch Mode
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="eager-fetch-mode"><fo:page-number-citation ref-id="eager-fetch-mode"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="nonpolymorphic">7.9.2.2.
Nonpolymorphic
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="nonpolymorphic"><fo:page-number-citation ref-id="nonpolymorphic"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="class-criteria">7.9.2.3.
Class Criteria
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="class-criteria"><fo:page-number-citation ref-id="class-criteria"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="strategy">7.9.2.4.
Strategy
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="strategy"><fo:page-number-citation ref-id="strategy"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_custom">7.10.
Custom Mappings
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_custom"><fo:page-number-citation ref-id="ref_guide_mapping_custom"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_mapping_custom" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_custom_class">7.10.1.
Custom Class Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_custom_class"><fo:page-number-citation ref-id="ref_guide_mapping_custom_class"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_custom_versdiscrim">7.10.2.
Custom Discriminator and Version Strategies
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_custom_versdiscrim"><fo:page-number-citation ref-id="ref_guide_mapping_custom_versdiscrim"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_custom_field">7.10.3.
Custom Field Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_custom_field"><fo:page-number-citation ref-id="ref_guide_mapping_custom_field"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_mapping_custom_field" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_custom_vhandler">7.10.3.1.
Value Handlers
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_custom_vhandler"><fo:page-number-citation ref-id="ref_guide_mapping_custom_vhandler"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_custom_fieldstrat">7.10.3.2.
Field Strategies
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_custom_fieldstrat"><fo:page-number-citation ref-id="ref_guide_mapping_custom_fieldstrat"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_custom_field_conf">7.10.3.3.
Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_custom_field_conf"><fo:page-number-citation ref-id="ref_guide_mapping_custom_field_conf"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_orphan">7.11.
Orphaned Keys
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_orphan"><fo:page-number-citation ref-id="ref_guide_orphan"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_deploy">8.
Deployment
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_deploy"><fo:page-number-citation ref-id="ref_guide_deploy"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_deploy" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_deploy_factory">8.1.
Factory Deployment
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_deploy_factory"><fo:page-number-citation ref-id="ref_guide_deploy_factory"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_deploy_factory" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_deploy_factory_standalone">8.1.1.
Standalone Deployment
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_deploy_factory_standalone"><fo:page-number-citation ref-id="ref_guide_deploy_factory_standalone"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_deploy_inject">8.1.2.
EntityManager Injection
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_deploy_inject"><fo:page-number-citation ref-id="ref_guide_deploy_inject"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_enterprise_trans">8.2.
Integrating with the Transaction Manager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_enterprise_trans"><fo:page-number-citation ref-id="ref_guide_enterprise_trans"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_enterprise_xa">8.3.
XA Transactions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_enterprise_xa"><fo:page-number-citation ref-id="ref_guide_enterprise_xa"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_enterprise_xa" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_enterprise_xa_req">8.3.1.
Using OpenJPA with XA Transactions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_enterprise_xa_req"><fo:page-number-citation ref-id="ref_guide_enterprise_xa_req"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime">9.
Runtime Extensions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime"><fo:page-number-citation ref-id="ref_guide_runtime"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_runtime" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_arch">9.1.
Architecture
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_arch"><fo:page-number-citation ref-id="ref_guide_runtime_arch"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_runtime_arch" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_broker_finalization">9.1.1.
Broker Finalization
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_broker_finalization"><fo:page-number-citation ref-id="ref_guide_runtime_broker_finalization"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_broker_extension">9.1.2.
Broker Customization and Finalization
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_broker_extension"><fo:page-number-citation ref-id="ref_guide_runtime_broker_extension"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_jpa">9.2.
JPA Extensions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_jpa"><fo:page-number-citation ref-id="ref_guide_runtime_jpa"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_runtime_jpa" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_emfactory">9.2.1.
OpenJPAEntityManagerFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_emfactory"><fo:page-number-citation ref-id="ref_guide_runtime_emfactory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_em">9.2.2.
OpenJPAEntityManager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_em"><fo:page-number-citation ref-id="ref_guide_runtime_em"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_jpaquery">9.2.3.
OpenJPAQuery
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_jpaquery"><fo:page-number-citation ref-id="ref_guide_runtime_jpaquery"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_jpaextent">9.2.4.
Extent
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_jpaextent"><fo:page-number-citation ref-id="ref_guide_runtime_jpaextent"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_jpacache">9.2.5.
StoreCache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_jpacache"><fo:page-number-citation ref-id="ref_guide_runtime_jpacache"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_jpaquerycache">9.2.6.
QueryResultCache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_jpaquerycache"><fo:page-number-citation ref-id="ref_guide_runtime_jpaquerycache"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_jpafetch">9.2.7.
FetchPlan
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_jpafetch"><fo:page-number-citation ref-id="ref_guide_runtime_jpafetch"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_openjpapersistence">9.2.8.
OpenJPAPersistence
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_openjpapersistence"><fo:page-number-citation ref-id="ref_guide_runtime_openjpapersistence"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_locking">9.3.
Object Locking
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_locking"><fo:page-number-citation ref-id="ref_guide_locking"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_locking" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_locking_default">9.3.1.
Configuring Default Locking
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_locking_default"><fo:page-number-citation ref-id="ref_guide_locking_default"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_locking_runtime">9.3.2.
Configuring Lock Levels at Runtime
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_locking_runtime"><fo:page-number-citation ref-id="ref_guide_locking_runtime"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_locking_apis">9.3.3.
Object Locking APIs
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_locking_apis"><fo:page-number-citation ref-id="ref_guide_locking_apis"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_locking_lockmgr">9.3.4.
Lock Manager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_locking_lockmgr"><fo:page-number-citation ref-id="ref_guide_locking_lockmgr"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_locking_rules">9.3.5.
Rules for Locking Behavior
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_locking_rules"><fo:page-number-citation ref-id="ref_guide_locking_rules"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_locking_issues">9.3.6.
Known Issues and Limitations
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_locking_issues"><fo:page-number-citation ref-id="ref_guide_locking_issues"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_savepoints">9.4.
Savepoints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_savepoints"><fo:page-number-citation ref-id="ref_guide_savepoints"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_savepoints" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="reg_guide_savepoints_using">9.4.1.
Using Savepoints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="reg_guide_savepoints_using"><fo:page-number-citation ref-id="reg_guide_savepoints_using"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_savepoints_conf">9.4.2.
Configuring Savepoints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_savepoints_conf"><fo:page-number-citation ref-id="ref_guide_savepoints_conf"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_enterprise_methodql">9.5.
MethodQL
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_enterprise_methodql"><fo:page-number-citation ref-id="ref_guide_enterprise_methodql"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_sequence">9.6.
Generators
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_sequence"><fo:page-number-citation ref-id="ref_guide_sequence"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_sequence" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_sequence_runtime">9.6.1.
Runtime Access
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_sequence_runtime"><fo:page-number-citation ref-id="ref_guide_sequence_runtime"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_pm_event">9.7.
Transaction Events
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_pm_event"><fo:page-number-citation ref-id="ref_guide_runtime_pm_event"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_enterprise_abstractstore">9.8.
Non-Relational Stores
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_enterprise_abstractstore"><fo:page-number-citation ref-id="ref_guide_enterprise_abstractstore"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_caching">10.
Caching
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_caching"><fo:page-number-citation ref-id="ref_guide_caching"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_caching" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache">10.1.
Data Cache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache"><fo:page-number-citation ref-id="ref_guide_cache"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_cache" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_conf">10.1.1.
Data Cache Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_conf"><fo:page-number-citation ref-id="ref_guide_cache_conf"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_use">10.1.2.
Data Cache Usage
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_use"><fo:page-number-citation ref-id="ref_guide_cache_use"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_query">10.1.3.
Query Cache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_query"><fo:page-number-citation ref-id="ref_guide_cache_query"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_extension">10.1.4.
Cache Extension
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_extension"><fo:page-number-citation ref-id="ref_guide_cache_extension"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_notes">10.1.5.
Important Notes
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_notes"><fo:page-number-citation ref-id="ref_guide_cache_notes"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="datastore_cache_issues">10.1.6.
Known Issues and Limitations
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="datastore_cache_issues"><fo:page-number-citation ref-id="datastore_cache_issues"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_querycomp">10.2.
Query Compilation Cache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_querycomp"><fo:page-number-citation ref-id="ref_guide_cache_querycomp"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_remote">11.
Remote and Offline Operation
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_remote"><fo:page-number-citation ref-id="ref_guide_remote"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_remote" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_detach">11.1.
Detach and Attach
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_detach"><fo:page-number-citation ref-id="ref_guide_detach"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_detach" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_detach_behavior">11.1.1.
Detach Behavior
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_detach_behavior"><fo:page-number-citation ref-id="ref_guide_detach_behavior"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_attach_behavior">11.1.2.
Attach Behavior
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_attach_behavior"><fo:page-number-citation ref-id="ref_guide_attach_behavior"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_detach_graph">11.1.3.
Defining the Detached Object Graph
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_detach_graph"><fo:page-number-citation ref-id="ref_guide_detach_graph"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_detach_graph" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_detach_field">11.1.3.1.
Detached State Field
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_detach_field"><fo:page-number-citation ref-id="ref_guide_detach_field"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_event">11.2.
Remote Event Notification Framework
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_event"><fo:page-number-citation ref-id="ref_guide_event"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_event" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_event_conf">11.2.1.
Remote Commit Provider Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_event_conf"><fo:page-number-citation ref-id="ref_guide_event_conf"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_event_conf" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_event_conf_jms">11.2.1.1.
JMS
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_event_conf_jms"><fo:page-number-citation ref-id="ref_guide_event_conf_jms"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_event_conf_tcp">11.2.1.2.
TCP
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_event_conf_tcp"><fo:page-number-citation ref-id="ref_guide_event_conf_tcp"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_event_conf_common">11.2.1.3.
Common Properties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_event_conf_common"><fo:page-number-citation ref-id="ref_guide_event_conf_common"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_event_customization">11.2.2.
Customization
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_event_customization"><fo:page-number-citation ref-id="ref_guide_event_customization"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration">12.
Third Party Integration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration"><fo:page-number-citation ref-id="ref_guide_integration"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_integration" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_ant">12.1.
Apache Ant
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_ant"><fo:page-number-citation ref-id="ref_guide_integration_ant"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.ref_guide_integration_ant" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_conf">12.1.1.
Common Ant Configuration Options
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_conf"><fo:page-number-citation ref-id="ref_guide_integration_conf"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_enhance">12.1.2.
Enhancer Ant Task
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_enhance"><fo:page-number-citation ref-id="ref_guide_integration_enhance"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_appidtool">12.1.3.
Application Identity Tool Ant Task
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_appidtool"><fo:page-number-citation ref-id="ref_guide_integration_appidtool"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_mappingtool">12.1.4.
Mapping Tool Ant Task
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_mappingtool"><fo:page-number-citation ref-id="ref_guide_integration_mappingtool"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_revmappingtool">12.1.5.
Reverse Mapping Tool Ant Task
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_revmappingtool"><fo:page-number-citation ref-id="ref_guide_integration_revmappingtool"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_schematool">12.1.6.
Schema Tool Ant Task
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_schematool"><fo:page-number-citation ref-id="ref_guide_integration_schematool"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_optimization">13.
Optimization Guidelines
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_optimization"><fo:page-number-citation ref-id="ref_guide_optimization"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_resources">1.
JPA Resources
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_resources"><fo:page-number-citation ref-id="jpa_resources"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="supported_databases">2.
Supported Databases
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="supported_databases"><fo:page-number-citation ref-id="supported_databases"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.supported_databases" margin-left="24pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_derby">2.1.
Apache Derby
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_derby"><fo:page-number-citation ref-id="dbsupport_derby"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_interbase">2.2.
Borland Interbase
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_interbase"><fo:page-number-citation ref-id="dbsupport_interbase"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.dbsupport_interbase" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_interbase_issues">2.2.1.
Known issues with Interbase
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_interbase_issues"><fo:page-number-citation ref-id="dbsupport_interbase_issues"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_jdatastore">2.3.
JDataStore
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_jdatastore"><fo:page-number-citation ref-id="dbsupport_jdatastore"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_db2">2.4.
IBM DB2
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_db2"><fo:page-number-citation ref-id="dbsupport_db2"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.dbsupport_db2" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_db2_issues">2.4.1.
Known issues with DB2
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_db2_issues"><fo:page-number-citation ref-id="dbsupport_db2_issues"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_empress">2.5.
Empress
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_empress"><fo:page-number-citation ref-id="dbsupport_empress"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.dbsupport_empress" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_empress_issues">2.5.1.
Known issues with Empress
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_empress_issues"><fo:page-number-citation ref-id="dbsupport_empress_issues"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_h2">2.6.
H2 Database Engine
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_h2"><fo:page-number-citation ref-id="dbsupport_h2"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.dbsupport_h2" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_h2_issues">2.6.1.
Known issues with H2 Database Engine
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_h2_issues"><fo:page-number-citation ref-id="dbsupport_h2_issues"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_hypersonic">2.7.
Hypersonic
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_hypersonic"><fo:page-number-citation ref-id="dbsupport_hypersonic"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.dbsupport_hypersonic" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_hypersonic_issues">2.7.1.
Known issues with Hypersonic
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_hypersonic_issues"><fo:page-number-citation ref-id="dbsupport_hypersonic_issues"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_firebird">2.8.
Firebird
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_firebird"><fo:page-number-citation ref-id="dbsupport_firebird"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.dbsupport_firebird" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_firebird_issues">2.8.1.
Known issues with Firebird
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_firebird_issues"><fo:page-number-citation ref-id="dbsupport_firebird_issues"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_informix">2.9.
Informix
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_informix"><fo:page-number-citation ref-id="dbsupport_informix"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.dbsupport_informix" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_informix_issues">2.9.1.
Known issues with Informix
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_informix_issues"><fo:page-number-citation ref-id="dbsupport_informix_issues"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_intersystems_cache">2.10.
InterSystems Cache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_intersystems_cache"><fo:page-number-citation ref-id="dbsupport_intersystems_cache"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.dbsupport_intersystems_cache" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_intersystems_cache_issues">2.10.1.
Known issues with InterSystems Cache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_intersystems_cache_issues"><fo:page-number-citation ref-id="dbsupport_intersystems_cache_issues"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_access">2.11.
Microsoft Access
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_access"><fo:page-number-citation ref-id="dbsupport_access"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.dbsupport_access" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_access_issues">2.11.1.
Known issues with Microsoft Access
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_access_issues"><fo:page-number-citation ref-id="dbsupport_access_issues"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_sqlserver">2.12.
Microsoft SQL Server
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_sqlserver"><fo:page-number-citation ref-id="dbsupport_sqlserver"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.dbsupport_sqlserver" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_sqlserver_issues">2.12.1.
Known issues with SQL Server
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_sqlserver_issues"><fo:page-number-citation ref-id="dbsupport_sqlserver_issues"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_foxpro">2.13.
Microsoft FoxPro
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_foxpro"><fo:page-number-citation ref-id="dbsupport_foxpro"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.dbsupport_foxpro" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_foxpro_issues">2.13.1.
Known issues with Microsoft FoxPro
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_foxpro_issues"><fo:page-number-citation ref-id="dbsupport_foxpro_issues"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_mysql">2.14.
MySQL
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_mysql"><fo:page-number-citation ref-id="dbsupport_mysql"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.dbsupport_mysql" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_mysql_issues">2.14.1.
Known issues with MySQL
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_mysql_issues"><fo:page-number-citation ref-id="dbsupport_mysql_issues"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_oracle">2.15.
Oracle
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_oracle"><fo:page-number-citation ref-id="dbsupport_oracle"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.dbsupport_oracle" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_oracle_query_hints">2.15.1.
Using Query Hints with Oracle
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_oracle_query_hints"><fo:page-number-citation ref-id="dbsupport_oracle_query_hints"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_oracle_issues">2.15.2.
Known issues with Oracle
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_oracle_issues"><fo:page-number-citation ref-id="dbsupport_oracle_issues"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_pointbase">2.16.
Pointbase
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_pointbase"><fo:page-number-citation ref-id="dbsupport_pointbase"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.dbsupport_pointbase" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_pointbase_issues">2.16.1.
Known issues with Pointbase
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_pointbase_issues"><fo:page-number-citation ref-id="dbsupport_pointbase_issues"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_postgresql">2.17.
PostgreSQL
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_postgresql"><fo:page-number-citation ref-id="dbsupport_postgresql"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.dbsupport_postgresql" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_postgresql_issues">2.17.1.
Known issues with PostgreSQL
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_postgresql_issues"><fo:page-number-citation ref-id="dbsupport_postgresql_issues"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_sybase">2.18.
Sybase Adaptive Server
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_sybase"><fo:page-number-citation ref-id="dbsupport_sybase"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.manual.dbsupport_sybase" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_sybase_issues">2.18.1.
Known issues with Sybase
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_sybase_issues"><fo:page-number-citation ref-id="dbsupport_sybase_issues"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="lot" language="en" format="i" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>Apache OpenJPA User's Guide</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>Apache OpenJPA User's Guide</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="lot...table...manual"><fo:block><fo:block><fo:block space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em" space-after="0.5em" margin-left="-4pc" start-indent="0pt" font-size="17.28pt" font-weight="bold" font-family="sans-serif,Symbol,ZapfDingbats">List of Tables</fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="d0e103">2.1.
Persistence Mechanisms
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="d0e103"><fo:page-number-citation ref-id="d0e103"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="d0e6355">10.1.
Interaction of ReadLockMode hint and LockManager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="d0e6355"><fo:page-number-citation ref-id="d0e6355"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="d0e19918">4.1.
OpenJPA Automatic Flush Behavior
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="d0e19918"><fo:page-number-citation ref-id="d0e19918"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="d0e21882">5.1.
Externalizer Options
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="d0e21882"><fo:page-number-citation ref-id="d0e21882"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="d0e21954">5.2.
Factory Options
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="d0e21954"><fo:page-number-citation ref-id="d0e21954"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="d0e28369">10.1.
Data access methods
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="d0e28369"><fo:page-number-citation ref-id="d0e28369"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="d0e28939">10.2.
Pre-defined aliases
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="d0e28939"><fo:page-number-citation ref-id="d0e28939"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="d0e29927">13.1.
Optimization Guidelines
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="d0e29927"><fo:page-number-citation ref-id="d0e29927"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="d0e30540">2.1.
Supported Databases and JDBC Drivers
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="d0e30540"><fo:page-number-citation ref-id="d0e30540"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="lot" language="en" format="i" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>Apache OpenJPA User's Guide</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>Apache OpenJPA User's Guide</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="lot...example...manual"><fo:block><fo:block><fo:block space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em" space-after="0.5em" margin-left="-4pc" start-indent="0pt" font-size="17.28pt" font-weight="bold" font-family="sans-serif,Symbol,ZapfDingbats">List of Examples</fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_arch_interact_outside">3.1.
Interaction of Interfaces Outside Container
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_arch_interact_outside"><fo:page-number-citation ref-id="jpa_overview_arch_interact_outside"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_arch_interact_inside">3.2.
Interaction of Interfaces Inside Container
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_arch_interact_inside"><fo:page-number-citation ref-id="jpa_overview_arch_interact_inside"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_pcclass">4.1.
Persistent Class
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_pcclass"><fo:page-number-citation ref-id="jpa_overview_pc_pcclass"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_identity_appidcode">4.2.
Identity Class
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_identity_appidcode"><fo:page-number-citation ref-id="jpa_overview_pc_identity_appidcode"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_classlisting">5.1.
Class Metadata
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_classlisting"><fo:page-number-citation ref-id="jpa_overview_meta_classlisting"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_complete_ex">5.2.
Complete Metadata
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_complete_ex"><fo:page-number-citation ref-id="jpa_overview_meta_complete_ex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_persistence_xmlex">6.1.
persistence.xml
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_persistence_xmlex"><fo:page-number-citation ref-id="jpa_overview_persistence_xmlex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_persistence_getemfactory">6.2.
Obtaining an EntityManagerFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_persistence_getemfactory"><fo:page-number-citation ref-id="jpa_overview_persistence_getemfactory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_emfactory_perscontext_transex">7.1.
Behavior of Transaction Persistence Context
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_emfactory_perscontext_transex"><fo:page-number-citation ref-id="jpa_overview_emfactory_perscontext_transex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_emfactory_perscontext_extendex">7.2.
Behavior of Extended Persistence Context
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_emfactory_perscontext_extendex"><fo:page-number-citation ref-id="jpa_overview_emfactory_perscontext_extendex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em_lifecycle_persist">8.1.
Persisting Objects
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em_lifecycle_persist"><fo:page-number-citation ref-id="jpa_overview_em_lifecycle_persist"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em_lifecycle_update">8.2.
Updating Objects
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em_lifecycle_update"><fo:page-number-citation ref-id="jpa_overview_em_lifecycle_update"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em_lifecycle_delete">8.3.
Removing Objects
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em_lifecycle_delete"><fo:page-number-citation ref-id="jpa_overview_em_lifecycle_delete"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em_detachex">8.4.
Detaching and Merging
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em_detachex"><fo:page-number-citation ref-id="jpa_overview_em_detachex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_trans_group">9.1.
Grouping Operations with Transactions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_trans_group"><fo:page-number-citation ref-id="jpa_overview_trans_group"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_query_hint1">10.1.
Query Hints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_query_hint1"><fo:page-number-citation ref-id="jpa_query_hint1"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_query_hint2">10.2.
Named Query using Hints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_query_hint2"><fo:page-number-citation ref-id="jpa_query_hint2"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_deleteex">10.3.
Delete by Query
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_deleteex"><fo:page-number-citation ref-id="jpa_overview_query_deleteex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_updateex">10.4.
Update by Query
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_updateex"><fo:page-number-citation ref-id="jpa_overview_query_updateex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_sqlquery_createex">11.1.
Creating a SQL Query
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_sqlquery_createex"><fo:page-number-citation ref-id="jpa_overview_sqlquery_createex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_sqlquery_objex">11.2.
Retrieving Persistent Objects
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_sqlquery_objex"><fo:page-number-citation ref-id="jpa_overview_sqlquery_objex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_sqlquery_obj_paramex">11.3.
SQL Query Parameters
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_sqlquery_obj_paramex"><fo:page-number-citation ref-id="jpa_overview_sqlquery_obj_paramex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_classex">12.1.
Mapping Classes
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_classex"><fo:page-number-citation ref-id="jpa_overview_mapping_classex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_unq_attrex">12.2.
Defining a Unique Constraint
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_unq_attrex"><fo:page-number-citation ref-id="jpa_overview_mapping_unq_attrex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_identityex">12.3.
Identity Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_identityex"><fo:page-number-citation ref-id="jpa_overview_mapping_identityex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_sequenceex">12.4.
Generator Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_sequenceex"><fo:page-number-citation ref-id="jpa_overview_mapping_sequenceex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_singleex">12.5.
Single Table Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_singleex"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_singleex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_joinedex">12.6.
Joined Subclass Tables
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_joinedex"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_joinedex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_tpcex">12.7.
Table Per Class Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_tpcex"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_tpcex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_togetherex">12.8.
Inheritance Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_togetherex"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_togetherex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_discrimex">12.9.
Discriminator Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_discrimex"><fo:page-number-citation ref-id="jpa_overview_mapping_discrimex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_basicex">12.10.
Basic Field Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_basicex"><fo:page-number-citation ref-id="jpa_overview_mapping_basicex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_secondaryex">12.11.
Secondary Table Field Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_secondaryex"><fo:page-number-citation ref-id="jpa_overview_mapping_secondaryex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_embedex">12.12.
Embedded Field Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_embedex"><fo:page-number-citation ref-id="jpa_overview_mapping_embedex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_joined_overex">12.13.
Mapping Mapped Superclass Field
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_joined_overex"><fo:page-number-citation ref-id="jpa_overview_mapping_joined_overex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_relex">12.14.
Direct Relation Field Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_relex"><fo:page-number-citation ref-id="jpa_overview_mapping_relex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_assoccollex">12.15.
Join Table Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_assoccollex"><fo:page-number-citation ref-id="jpa_overview_mapping_assoccollex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_mapex">12.16.
Join Table Map Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_mapex"><fo:page-number-citation ref-id="jpa_overview_mapping_mapex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_fullex">12.17.
Full Entity Mappings
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_fullex"><fo:page-number-citation ref-id="jpa_overview_mapping_fullex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_conf_devtools_format_ex">2.1.
Code Formatting with the Application Id Tool
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_conf_devtools_format_ex"><fo:page-number-citation ref-id="ref_guide_conf_devtools_format_ex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_openjpa_std_ex">3.1.
Standard OpenJPA Log Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_openjpa_std_ex"><fo:page-number-citation ref-id="ref_guide_logging_openjpa_std_ex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_openjpa_sql_ex">3.2.
Standard OpenJPA Log Configuration + All SQL Statements
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_openjpa_sql_ex"><fo:page-number-citation ref-id="ref_guide_logging_openjpa_sql_ex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_openjpa_file">3.3.
Logging to a File
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_openjpa_file"><fo:page-number-citation ref-id="ref_guide_logging_openjpa_file"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_log4j_ex">3.4.
Standard Log4J Logging
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_log4j_ex"><fo:page-number-citation ref-id="ref_guide_logging_log4j_ex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_jdk14_propfile">3.5.
JDK 1.4 Log Properties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_jdk14_propfile"><fo:page-number-citation ref-id="ref_guide_logging_jdk14_propfile"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_custom_ex">3.6.
Custom Logging Class
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_custom_ex"><fo:page-number-citation ref-id="ref_guide_logging_custom_ex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_builtin_ex">4.1.
Properties for the OpenJPA DataSource
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_builtin_ex"><fo:page-number-citation ref-id="ref_guide_dbsetup_builtin_ex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_thirdparty_ex">4.2.
Properties File for a Third-Party DataSource
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_thirdparty_ex"><fo:page-number-citation ref-id="ref_guide_dbsetup_thirdparty_ex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_enterprise_xa_conf_ex">4.3.
Managed DataSource Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_enterprise_xa_conf_ex"><fo:page-number-citation ref-id="ref_guide_enterprise_xa_conf_ex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_conn_jpa">4.4.
Using the EntityManager's Connection
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_conn_jpa"><fo:page-number-citation ref-id="ref_guide_dbsetup_conn_jpa"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_conn_from_factory_jpa">4.5.
Using the EntityManagerFactory's DataSource
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_conn_from_factory_jpa"><fo:page-number-citation ref-id="ref_guide_dbsetup_conn_from_factory_jpa"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_dbdict">4.6.
Specifying a DBDictionary
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_dbdict"><fo:page-number-citation ref-id="ref_guide_dbsetup_dbdict"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_isoex">4.7.
Specifying a Transaction Isolation
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_isoex"><fo:page-number-citation ref-id="ref_guide_dbsetup_isoex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_sql92_conf">4.8.
Specifying the Join Syntax Default
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_sql92_conf"><fo:page-number-citation ref-id="ref_guide_dbsetup_sql92_conf"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_sql92_fetch">4.9.
Specifying the Join Syntax at Runtime
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_sql92_fetch"><fo:page-number-citation ref-id="ref_guide_dbsetup_sql92_fetch"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_sql92_retain_conf">4.10.
Specifying Connection Usage Defaults
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_sql92_retain_conf"><fo:page-number-citation ref-id="ref_guide_dbsetup_sql92_retain_conf"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_sql92_retain_runtime">4.11.
Specifying Connection Usage at Runtime
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_sql92_retain_runtime"><fo:page-number-citation ref-id="ref_guide_dbsetup_sql92_retain_runtime"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_lrs_def">4.12.
Specifying Result Set Defaults
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_lrs_def"><fo:page-number-citation ref-id="ref_guide_dbsetup_lrs_def"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_lrs_runtime">4.13.
Specifying Result Set Behavior at Runtime
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_lrs_runtime"><fo:page-number-citation ref-id="ref_guide_dbsetup_lrs_runtime"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_schema_schematool_create">4.14.
Schema Creation
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_schema_schematool_create"><fo:page-number-citation ref-id="ref_guide_schema_schematool_create"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_schema_schematool_script">4.15.
SQL Scripting
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_schema_schematool_script"><fo:page-number-citation ref-id="ref_guide_schema_schematool_script"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_schema_schematool_table_cleanup">4.16.
Table Cleanup
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_schema_schematool_table_cleanup"><fo:page-number-citation ref-id="ref_guide_schema_schematool_table_cleanup"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_schema_schematool_drop">4.17.
Schema Drop
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_schema_schematool_drop"><fo:page-number-citation ref-id="ref_guide_schema_schematool_drop"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_schema_schematool_reflect">4.18.
Schema Reflection
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_schema_schematool_reflect"><fo:page-number-citation ref-id="ref_guide_schema_schematool_reflect"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_schema_xml_basic">4.19.
Basic Schema
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_schema_xml_basic"><fo:page-number-citation ref-id="ref_guide_schema_xml_basic"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_schema_xml_full">4.20.
Full Schema
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_schema_xml_full"><fo:page-number-citation ref-id="ref_guide_schema_xml_full"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_enhance_enhancer">5.1.
Using the OpenJPA Enhancer
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_enhance_enhancer"><fo:page-number-citation ref-id="ref_guide_pc_enhance_enhancer"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_enhance_runtime_ex">5.2.
Using the OpenJPA Agent for Runtime Enhancement
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_enhance_runtime_ex"><fo:page-number-citation ref-id="ref_guide_pc_enhance_runtime_ex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_enhance_runtime_opt_ex">5.3.
Passing Options to the OpenJPA Agent
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_enhance_runtime_opt_ex"><fo:page-number-citation ref-id="ref_guide_pc_enhance_runtime_opt_ex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_oid_datastoreentityex">5.4.
JPA Datastore Identity Metadata
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_oid_datastoreentityex"><fo:page-number-citation ref-id="ref_guide_pc_oid_datastoreentityex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_oid_entitypk_simplefind">5.5.
Finding an Entity with an Entity Identity Field
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_oid_entitypk_simplefind"><fo:page-number-citation ref-id="ref_guide_pc_oid_entitypk_simplefind"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_oid_entitypk_idcls">5.6.
Id Class for Entity Identity Fields
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_oid_entitypk_idcls"><fo:page-number-citation ref-id="ref_guide_pc_oid_entitypk_idcls"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_appid_appidtool">5.7.
Using the Application Identity Tool
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_appid_appidtool"><fo:page-number-citation ref-id="ref_guide_pc_appid_appidtool"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_inverses_logicalex">5.8.
Specifying Logical Inverses
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_inverses_logicalex"><fo:page-number-citation ref-id="ref_guide_inverses_logicalex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_inversesex">5.9.
Enabling Managed Inverses
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_inversesex"><fo:page-number-citation ref-id="ref_guide_inversesex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_inverses_logex">5.10.
Log Inconsistencies
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_inverses_logex"><fo:page-number-citation ref-id="ref_guide_inverses_logex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_scos_order_initialvals">5.11.
Using Initial Field Values
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_scos_order_initialvals"><fo:page-number-citation ref-id="ref_guide_pc_scos_order_initialvals"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_scos_proxy_lrs_itr">5.12.
Using a Large Result Set Iterator
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_scos_proxy_lrs_itr"><fo:page-number-citation ref-id="ref_guide_pc_scos_proxy_lrs_itr"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_scos_proxy_lrs_extension">5.13.
Marking a Large Result Set Field
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_scos_proxy_lrs_extension"><fo:page-number-citation ref-id="ref_guide_pc_scos_proxy_lrs_extension"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_scos_proxy_custom_ex">5.14.
Configuring the Proxy Manager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_scos_proxy_custom_ex"><fo:page-number-citation ref-id="ref_guide_pc_scos_proxy_custom_ex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_externex">5.15.
Using Externalization
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_externex"><fo:page-number-citation ref-id="ref_guide_pc_externex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_extern_queryex">5.16.
Querying Externalization Fields
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_extern_queryex"><fo:page-number-citation ref-id="ref_guide_pc_extern_queryex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="externvalues_ex">5.17.
Using External Values
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="externvalues_ex"><fo:page-number-citation ref-id="externvalues_ex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_fetch_customgroups">5.18.
Custom Fetch Group Metadata
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_fetch_customgroups"><fo:page-number-citation ref-id="ref_guide_fetch_customgroups"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_fetch_loadgroup">5.19.
Load Fetch Group Metadata
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_fetch_loadgroup"><fo:page-number-citation ref-id="ref_guide_fetch_loadgroup"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_fetch_conf_query">5.20.
Using the FetchPlan
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_fetch_conf_query"><fo:page-number-citation ref-id="ref_guide_fetch_conf_query"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_fetch-conf_per_field">5.21.
Adding an Eager Field
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_fetch-conf_per_field"><fo:page-number-citation ref-id="ref_guide_fetch-conf_per_field"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_perfpack_eager_def">5.22.
Setting the Default Eager Fetch Mode
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_perfpack_eager_def"><fo:page-number-citation ref-id="ref_guide_perfpack_eager_def"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_perfpack_eager_runtime">5.23.
Setting the Eager Fetch Mode at Runtime
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_perfpack_eager_runtime"><fo:page-number-citation ref-id="ref_guide_perfpack_eager_runtime"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_stdfactoryex">6.1.
Setting a Standard Metadata Factory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_stdfactoryex"><fo:page-number-citation ref-id="ref_guide_meta_stdfactoryex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_customfactoryex">6.2.
Setting a Custom Metadata Factory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_customfactoryex"><fo:page-number-citation ref-id="ref_guide_meta_customfactoryex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_metaex">6.3.
OpenJPA Metadata Extensions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_metaex"><fo:page-number-citation ref-id="ref_guide_metaex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_mappingtool_typical">7.1.
Using the Mapping Tool
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_mappingtool_typical"><fo:page-number-citation ref-id="ref_guide_mapping_mappingtool_typical"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_mappingtool_buildschema">7.2.
Creating the Relational Schema from Mappings
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_mappingtool_buildschema"><fo:page-number-citation ref-id="ref_guide_mapping_mappingtool_buildschema"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_mappingtool_cleanup_tables">7.3.
Refreshing entire schema and cleaning out tables
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_mappingtool_cleanup_tables"><fo:page-number-citation ref-id="ref_guide_mapping_mappingtool_cleanup_tables"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_mappingtool_dropschema">7.4.
Dropping Mappings and Association Schema
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_mappingtool_dropschema"><fo:page-number-citation ref-id="ref_guide_mapping_mappingtool_dropschema"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guid_mapping_ddl_full_ddl">7.5.
Create DDL for Current Mappings
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guid_mapping_ddl_full_ddl"><fo:page-number-citation ref-id="ref_guid_mapping_ddl_full_ddl"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guid_mapping_ddl_part_ddl">7.6.
Create DDL to Update Database for Current Mappings
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guid_mapping_ddl_part_ddl"><fo:page-number-citation ref-id="ref_guid_mapping_ddl_part_ddl"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_synchex">7.7.
Configuring Runtime Forward Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_synchex"><fo:page-number-citation ref-id="ref_guide_mapping_synchex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_reverse_schemagen">7.8.
Reflection with the Schema Tool
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_reverse_schemagen"><fo:page-number-citation ref-id="ref_guide_pc_reverse_schemagen"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_reverse_reversemappingtool">7.9.
Using the Reverse Mapping Tool
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_reverse_reversemappingtool"><fo:page-number-citation ref-id="ref_guide_pc_reverse_reversemappingtool"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_reverse_custom_ex">7.10.
Customizing Reverse Mapping with Properties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_reverse_custom_ex"><fo:page-number-citation ref-id="ref_guide_pc_reverse_custom_ex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_mappingtool_validate">7.11.
Validating Mappings
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_mappingtool_validate"><fo:page-number-citation ref-id="ref_guide_mapping_mappingtool_validate"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_defaults_conf">7.12.
Configuring Mapping Defaults
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_defaults_conf"><fo:page-number-citation ref-id="ref_guide_mapping_defaults_conf"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_factory_jpa">7.13.
Standard JPA Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_factory_jpa"><fo:page-number-citation ref-id="ref_guide_mapping_factory_jpa"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_datastoreidex">7.14.
Datastore Identity Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_datastoreidex"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_datastoreidex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_embedex">7.15.
Overriding Complex Mappings
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_embedex"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_embedex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_onemanyex">7.16.
One-Sided One-Many Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_onemanyex"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_onemanyex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_xmlmapping_myaddress">7.17.
myaddress.xsd
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_xmlmapping_myaddress"><fo:page-number-citation ref-id="ref_guide_xmlmapping_myaddress"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_xmlmapping_address">7.18.
Address.Java
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_xmlmapping_address"><fo:page-number-citation ref-id="ref_guide_xmlmapping_address"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_xmlmapping_usaaddress">7.19.
USAAddress.java
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_xmlmapping_usaaddress"><fo:page-number-citation ref-id="ref_guide_xmlmapping_usaaddress"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_xmlmapping_canaddress">7.20.
CANAddress.java
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_xmlmapping_canaddress"><fo:page-number-citation ref-id="ref_guide_xmlmapping_canaddress"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_xmlmapping_annorder">7.21.
Showing annotated Order entity with XML mapping strategy
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_xmlmapping_annorder"><fo:page-number-citation ref-id="ref_guide_xmlmapping_annorder"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_xmlmapping_createorder">7.22.
Showing creation of Order Entity having shipAddress mapped to XML column
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_xmlmapping_createorder"><fo:page-number-citation ref-id="ref_guide_xmlmapping_createorder"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_xmlmapping_ejbquery">7.23.
Sample EJB Queries for XML Column mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_xmlmapping_ejbquery"><fo:page-number-citation ref-id="ref_guide_xmlmapping_ejbquery"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_orphan_logex">7.24.
Custom Logging Orphaned Keys
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_orphan_logex"><fo:page-number-citation ref-id="ref_guide_orphan_logex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_enterprise_transex">8.1. Configuring Transaction Manager Integration</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_enterprise_transex"><fo:page-number-citation ref-id="ref_guide_enterprise_transex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_pm_evictex">9.1.
Evict from Data Cache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_pm_evictex"><fo:page-number-citation ref-id="ref_guide_runtime_pm_evictex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_jpaextentex">9.2.
Using a JPA Extent
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_jpaextentex"><fo:page-number-citation ref-id="ref_guide_runtime_jpaextentex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_locking_default_conf">9.3.
Setting Default Lock Levels
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_locking_default_conf"><fo:page-number-citation ref-id="ref_guide_locking_default_conf"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_locking_fetch">9.4.
Setting Runtime Lock Levels
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_locking_fetch"><fo:page-number-citation ref-id="ref_guide_locking_fetch"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_locking_explicit">9.5.
Locking APIs
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_locking_explicit"><fo:page-number-citation ref-id="ref_guide_locking_explicit"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_locking_disable">9.6.
Disabling Locking
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_locking_disable"><fo:page-number-citation ref-id="ref_guide_locking_disable"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_savepoints_example">9.7.
Using Savepoints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_savepoints_example"><fo:page-number-citation ref-id="ref_guide_savepoints_example"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_sequence_named">9.8.
Named Seq Sequence
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_sequence_named"><fo:page-number-citation ref-id="ref_guide_sequence_named"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_sequence_systemex">9.9.
System Sequence Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_sequence_systemex"><fo:page-number-citation ref-id="ref_guide_sequence_systemex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_conf_sjvm">10.1.
Single-JVM Data Cache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_conf_sjvm"><fo:page-number-citation ref-id="ref_guide_cache_conf_sjvm"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_conf_size">10.2.
Data Cache Size
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_conf_size"><fo:page-number-citation ref-id="ref_guide_cache_conf_size"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ex_timeout_cache">10.3.
Data Cache Timeout
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ex_timeout_cache"><fo:page-number-citation ref-id="ex_timeout_cache"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_access_jpa">10.4.
Accessing the StoreCache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_access_jpa"><fo:page-number-citation ref-id="ref_guide_cache_access_jpa"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_use_jpa">10.5.
StoreCache Usage
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_use_jpa"><fo:page-number-citation ref-id="ref_guide_cache_use_jpa"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_pmevict">10.6.
Automatic Data Cache Eviction
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_pmevict"><fo:page-number-citation ref-id="ref_guide_cache_pmevict"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_queryaccess">10.7.
Accessing the QueryResultCache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_queryaccess"><fo:page-number-citation ref-id="ref_guide_cache_queryaccess"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_cachesize">10.8.
Query Cache Size
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_cachesize"><fo:page-number-citation ref-id="ref_guide_cache_cachesize"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_disablequery">10.9.
Disabling the Query Cache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_disablequery"><fo:page-number-citation ref-id="ref_guide_cache_disablequery"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_query_classchange">10.10.
Evicting Queries
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_query_classchange"><fo:page-number-citation ref-id="ref_guide_cache_query_classchange"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_query_pin">10.11.
Pinning, and Unpinning Query Results
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_query_pin"><fo:page-number-citation ref-id="ref_guide_cache_query_pin"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_query_disable">10.12.
Disabling and Enabling Query Caching
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_query_disable"><fo:page-number-citation ref-id="ref_guide_cache_query_disable"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_limits_extent">10.13.
Query Replaces Extent
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_limits_extent"><fo:page-number-citation ref-id="ref_guide_cache_limits_extent"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_detach_graph_confex">11.1.
Configuring Detached State
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_detach_graph_confex"><fo:page-number-citation ref-id="ref_guide_detach_graph_confex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_event_conf_tcpex">11.2.
TCP Remote Commit Provider Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_event_conf_tcpex"><fo:page-number-citation ref-id="ref_guide_event_conf_tcpex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_conf_config">12.1.
Using the &lt;config&gt; Ant Tag
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_conf_config"><fo:page-number-citation ref-id="ref_guide_integration_conf_config"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_props">12.2.
Using the Properties Attribute of the &lt;config&gt; Tag
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_props"><fo:page-number-citation ref-id="ref_guide_integration_props"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_propsfile">12.3.
Using the PropertiesFile Attribute of the &lt;config&gt; Tag
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_propsfile"><fo:page-number-citation ref-id="ref_guide_integration_propsfile"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_conf_classpath">12.4.
Using the &lt;classpath&gt; Ant Tag
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_conf_classpath"><fo:page-number-citation ref-id="ref_guide_integration_conf_classpath"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_conf_codeformat">12.5.
Using the &lt;codeformat&gt; Ant Tag
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_conf_codeformat"><fo:page-number-citation ref-id="ref_guide_integration_conf_codeformat"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_enhance_task">12.6.
Invoking the Enhancer from Ant
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_enhance_task"><fo:page-number-citation ref-id="ref_guide_integration_enhance_task"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_appidtool_task">12.7.
Invoking the Application Identity Tool from Ant
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_appidtool_task"><fo:page-number-citation ref-id="ref_guide_integration_appidtool_task"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_mappingtool_task">12.8.
Invoking the Mapping Tool from Ant
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_mappingtool_task"><fo:page-number-citation ref-id="ref_guide_integration_mappingtool_task"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_revmappingtool_task">12.9.
Invoking the Reverse Mapping Tool from Ant
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_revmappingtool_task"><fo:page-number-citation ref-id="ref_guide_integration_revmappingtool_task"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_schematool_task">12.10.
Invoking the Schema Tool from Ant
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_schematool_task"><fo:page-number-citation ref-id="ref_guide_integration_schematool_task"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="example_props_derby">2.1.
Example properties for Derby
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="example_props_derby"><fo:page-number-citation ref-id="example_props_derby"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="example_props_interbase">2.2.
Example properties for Interbase
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="example_props_interbase"><fo:page-number-citation ref-id="example_props_interbase"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="example_props_jdatastore">2.3.
Example properties for JDataStore
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="example_props_jdatastore"><fo:page-number-citation ref-id="example_props_jdatastore"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="example_props_db2">2.4.
Example properties for IBM DB2
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="example_props_db2"><fo:page-number-citation ref-id="example_props_db2"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="example_props_empress">2.5.
Example properties for Empress
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="example_props_empress"><fo:page-number-citation ref-id="example_props_empress"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="example_props_h2">2.6.
Example properties for H2 Database Engine
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="example_props_h2"><fo:page-number-citation ref-id="example_props_h2"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="example_props_hypersonic">2.7.
Example properties for Hypersonic
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="example_props_hypersonic"><fo:page-number-citation ref-id="example_props_hypersonic"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="example_props_firebird">2.8.
Example properties for Firebird
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="example_props_firebird"><fo:page-number-citation ref-id="example_props_firebird"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="example_props_informix">2.9.
Example properties for Informix Dynamic Server
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="example_props_informix"><fo:page-number-citation ref-id="example_props_informix"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="example_props_intersystems_cache">2.10.
Example properties for InterSystems Cache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="example_props_intersystems_cache"><fo:page-number-citation ref-id="example_props_intersystems_cache"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="example_props_access">2.11.
Example properties for Microsoft Access
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="example_props_access"><fo:page-number-citation ref-id="example_props_access"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="example_props_sqlserver">2.12.
Example properties for Microsoft SQLServer
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="example_props_sqlserver"><fo:page-number-citation ref-id="example_props_sqlserver"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="example_props_foxpro">2.13.
Example properties for Microsoft FoxPro
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="example_props_foxpro"><fo:page-number-citation ref-id="example_props_foxpro"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="example_props_mysql">2.14.
Example properties for MySQL
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="example_props_mysql"><fo:page-number-citation ref-id="example_props_mysql"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="example_props_oracle">2.15.
Example properties for Oracle
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="example_props_oracle"><fo:page-number-citation ref-id="example_props_oracle"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dbsupport_oracle_query_hints_ex">2.16.
Using Oracle Hints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dbsupport_oracle_query_hints_ex"><fo:page-number-citation ref-id="dbsupport_oracle_query_hints_ex"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="example_props_pointbase">2.17.
Example properties for Pointbase
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="example_props_pointbase"><fo:page-number-citation ref-id="example_props_pointbase"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="example_props_postgresql">2.18.
Example properties for PostgreSQL
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="example_props_postgresql"><fo:page-number-citation ref-id="example_props_postgresql"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="example_props_sybase">2.19.
Example properties for Sybase
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="example_props_sybase"><fo:page-number-citation ref-id="example_props_sybase"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="titlepage" language="en" format="1" initial-page-number="1" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="introduction"><fo:block><fo:block><fo:block text-align="center" font-size="24.8832pt" space-before="18.6624pt" font-weight="bold" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always" hyphenate="false">Part 1. Introduction</fo:block></fo:block></fo:block></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="lot" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>Introduction</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>Introduction</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" id="toc...introduction"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa_intro">1.
OpenJPA
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa_intro"><fo:page-number-citation ref-id="openjpa_intro"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.introduction.openjpa_intro" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa_intro_about">1.1.
About This Document
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa_intro_about"><fo:page-number-citation ref-id="openjpa_intro_about"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
OpenJPA
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
OpenJPA
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="openjpa_intro"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 1. 
OpenJPA
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13"><!--
OpenJPA
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA is Apache's implementation of Sun's Java Persistence API (JPA)
specification for the transparent persistence of Java objects. This
document provides an overview of the JPA standard and technical
details on the use of OpenJPA.
</fo:block><fo:block id="openjpa_intro_about"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
About This Document
</fo:marker><fo:block font-size="20.735999999999997pt">1.1. 
About This Document
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This document is intended for OpenJPA users. It is divided into several parts:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e24"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The <fo:basic-link internal-destination="jpa_overview_intro"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">JPA Overview</fo:inline></fo:basic-link> describes the
fundamentals of the JPA specification.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e32"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The <fo:basic-link internal-destination="ref_guide_intro"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">OpenJPA Reference Guide</fo:inline></fo:basic-link> contains
detailed documentation on all aspects of OpenJPA. Browse through this guide
to familiarize yourself with the many advanced features and customization
opportunities OpenJPA provides. Later, you can use the guide when you need
details on a specific aspect of OpenJPA.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="titlepage" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="jpa_overview"><fo:block><fo:block><fo:block text-align="center" font-size="24.8832pt" space-before="18.6624pt" font-weight="bold" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always" hyphenate="false">Part 2. Java Persistence API</fo:block></fo:block></fo:block></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="lot" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>Java Persistence API</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>Java Persistence API</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" id="toc...jpa_overview"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_intro">1.
Introduction
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_intro"><fo:page-number-citation ref-id="jpa_overview_intro"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_intro" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_intro_audience">1.1.
Intended Audience
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_intro_audience"><fo:page-number-citation ref-id="jpa_overview_intro_audience"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_intro_transpers">1.2.
Lightweight Persistence
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_intro_transpers"><fo:page-number-citation ref-id="jpa_overview_intro_transpers"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_why">2.
Why JPA?
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_why"><fo:page-number-citation ref-id="jpa_overview_why"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_arch">3.
Java Persistence API Architecture
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_arch"><fo:page-number-citation ref-id="jpa_overview_arch"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_arch" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_arch_exceptions">3.1.
JPA Exceptions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_arch_exceptions"><fo:page-number-citation ref-id="jpa_overview_arch_exceptions"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc">4.
Entity
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc"><fo:page-number-citation ref-id="jpa_overview_pc"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_pc" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_restrict">4.1.
Restrictions on Persistent Classes
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_restrict"><fo:page-number-citation ref-id="jpa_overview_pc_restrict"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_pc_restrict" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_no_arg">4.1.1.
Default or No-Arg Constructor
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_no_arg"><fo:page-number-citation ref-id="jpa_overview_pc_no_arg"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_final">4.1.2.
Final
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_final"><fo:page-number-citation ref-id="jpa_overview_pc_final"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_id">4.1.3.
Identity Fields
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_id"><fo:page-number-citation ref-id="jpa_overview_pc_id"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_version">4.1.4.
Version Field
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_version"><fo:page-number-citation ref-id="jpa_overview_pc_version"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_restrict_inheritance">4.1.5.
Inheritance
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_restrict_inheritance"><fo:page-number-citation ref-id="jpa_overview_pc_restrict_inheritance"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_restrict_fields">4.1.6.
Persistent Fields
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_restrict_fields"><fo:page-number-citation ref-id="jpa_overview_pc_restrict_fields"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_restrict_conclusion">4.1.7.
Conclusions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_restrict_conclusion"><fo:page-number-citation ref-id="jpa_overview_pc_restrict_conclusion"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_identity">4.2.
Entity Identity
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_identity"><fo:page-number-citation ref-id="jpa_overview_pc_identity"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_pc_identity" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_identitycls">4.2.1.
Identity Class
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_identitycls"><fo:page-number-citation ref-id="jpa_overview_pc_identitycls"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_pc_identitycls" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_identity_hierarchy">4.2.1.1.
Identity Hierarchies
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_identity_hierarchy"><fo:page-number-citation ref-id="jpa_overview_pc_identity_hierarchy"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_callbacks">4.3.
Lifecycle Callbacks
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_callbacks"><fo:page-number-citation ref-id="jpa_overview_pc_callbacks"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_pc_callbacks" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_callbacks_methods">4.3.1.
Callback Methods
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_callbacks_methods"><fo:page-number-citation ref-id="jpa_overview_pc_callbacks_methods"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_callbacks_using">4.3.2.
Using Callback Methods
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_callbacks_using"><fo:page-number-citation ref-id="jpa_overview_callbacks_using"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_entity_listeners_using">4.3.3.
Using Entity Listeners
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_entity_listeners_using"><fo:page-number-citation ref-id="jpa_overview_entity_listeners_using"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_entity_listeners_exclude">4.3.4.
Entity Listeners Hierarchy
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_entity_listeners_exclude"><fo:page-number-citation ref-id="jpa_overview_entity_listeners_exclude"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_pc_conclusion">4.4.
Conclusions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_pc_conclusion"><fo:page-number-citation ref-id="jpa_overview_pc_conclusion"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta">5.
Metadata
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta"><fo:page-number-citation ref-id="jpa_overview_meta"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_meta" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_class">5.1.
Class Metadata
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_class"><fo:page-number-citation ref-id="jpa_overview_meta_class"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_meta_class" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_entity">5.1.1.
Entity
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_entity"><fo:page-number-citation ref-id="jpa_overview_meta_entity"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_idclass">5.1.2.
Id Class
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_idclass"><fo:page-number-citation ref-id="jpa_overview_meta_idclass"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_embeddablesuper">5.1.3.
Mapped Superclass
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_embeddablesuper"><fo:page-number-citation ref-id="jpa_overview_meta_embeddablesuper"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_embeddable">5.1.4.
Embeddable
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_embeddable"><fo:page-number-citation ref-id="jpa_overview_meta_embeddable"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_entity_listeners">5.1.5.
EntityListeners
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_entity_listeners"><fo:page-number-citation ref-id="jpa_overview_meta_entity_listeners"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_classex">5.1.6.
Example
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_classex"><fo:page-number-citation ref-id="jpa_overview_meta_classex"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_field">5.2.
Field and Property Metadata
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_field"><fo:page-number-citation ref-id="jpa_overview_meta_field"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_meta_field" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_transient">5.2.1.
Transient
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_transient"><fo:page-number-citation ref-id="jpa_overview_meta_transient"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_id">5.2.2.
Id
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_id"><fo:page-number-citation ref-id="jpa_overview_meta_id"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_gen">5.2.3.
Generated Value
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_gen"><fo:page-number-citation ref-id="jpa_overview_meta_gen"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_embedid">5.2.4.
Embedded Id
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_embedid"><fo:page-number-citation ref-id="jpa_overview_meta_embedid"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_version">5.2.5.
Version
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_version"><fo:page-number-citation ref-id="jpa_overview_meta_version"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_basic">5.2.6.
Basic
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_basic"><fo:page-number-citation ref-id="jpa_overview_meta_basic"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_meta_basic" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_fetch">5.2.6.1.
Fetch Type
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_fetch"><fo:page-number-citation ref-id="jpa_overview_meta_fetch"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_embedded">5.2.7.
Embedded
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_embedded"><fo:page-number-citation ref-id="jpa_overview_meta_embedded"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_manytoone">5.2.8.
Many To One
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_manytoone"><fo:page-number-citation ref-id="jpa_overview_meta_manytoone"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_meta_manytoone" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_cascade">5.2.8.1.
Cascade Type
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_cascade"><fo:page-number-citation ref-id="jpa_overview_meta_cascade"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_onetomany">5.2.9.
One To Many
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_onetomany"><fo:page-number-citation ref-id="jpa_overview_meta_onetomany"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_meta_onetomany" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_mappedby">5.2.9.1.
Bidirectional Relations
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_mappedby"><fo:page-number-citation ref-id="jpa_overview_meta_mappedby"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_onetoone">5.2.10.
One To One
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_onetoone"><fo:page-number-citation ref-id="jpa_overview_meta_onetoone"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_manytomany">5.2.11.
Many To Many
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_manytomany"><fo:page-number-citation ref-id="jpa_overview_meta_manytomany"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_orderby">5.2.12.
Order By
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_orderby"><fo:page-number-citation ref-id="jpa_overview_meta_orderby"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_mapkey">5.2.13.
Map Key
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_mapkey"><fo:page-number-citation ref-id="jpa_overview_meta_mapkey"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_fielddefaults">5.2.14.
Persistent Field Defaults
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_fielddefaults"><fo:page-number-citation ref-id="jpa_overview_meta_fielddefaults"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_xml">5.3.
XML Schema
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_xml"><fo:page-number-citation ref-id="jpa_overview_meta_xml"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_meta_complete">5.4.
Conclusion
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_meta_complete"><fo:page-number-citation ref-id="jpa_overview_meta_complete"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_persistence">6.
Persistence
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_persistence"><fo:page-number-citation ref-id="jpa_overview_persistence"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_persistence" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_persistence_xml">6.1.
persistence.xml
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_persistence_xml"><fo:page-number-citation ref-id="jpa_overview_persistence_xml"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_persistence_use">6.2.
Non-EE Use
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_persistence_use"><fo:page-number-citation ref-id="jpa_overview_persistence_use"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_emfactory">7.
EntityManagerFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_emfactory"><fo:page-number-citation ref-id="jpa_overview_emfactory"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_emfactory" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_emfactory_obtain">7.1.
Obtaining an EntityManagerFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_emfactory_obtain"><fo:page-number-citation ref-id="jpa_overview_emfactory_obtain"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_emfactory_em">7.2.
Obtaining EntityManagers
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_emfactory_em"><fo:page-number-citation ref-id="jpa_overview_emfactory_em"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_emfactory_perscontext">7.3.
Persistence Context
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_emfactory_perscontext"><fo:page-number-citation ref-id="jpa_overview_emfactory_perscontext"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_emfactory_perscontext" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_emfactory_perscontext_trans">7.3.1.
Transaction Persistence Context
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_emfactory_perscontext_trans"><fo:page-number-citation ref-id="jpa_overview_emfactory_perscontext_trans"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_emfactory_perscontext_extend">7.3.2.
Extended Persistence Context
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_emfactory_perscontext_extend"><fo:page-number-citation ref-id="jpa_overview_emfactory_perscontext_extend"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_emfactory_close">7.4.
Closing the EntityManagerFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_emfactory_close"><fo:page-number-citation ref-id="jpa_overview_emfactory_close"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em">8.
EntityManager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em"><fo:page-number-citation ref-id="jpa_overview_em"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_em" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em_trans">8.1.
Transaction Association
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em_trans"><fo:page-number-citation ref-id="jpa_overview_em_trans"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em_lifecycle">8.2.
Entity Lifecycle Management
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em_lifecycle"><fo:page-number-citation ref-id="jpa_overview_em_lifecycle"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em_lifeexamples">8.3.
Lifecycle Examples
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em_lifeexamples"><fo:page-number-citation ref-id="jpa_overview_em_lifeexamples"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em_identity">8.4.
Entity Identity Management
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em_identity"><fo:page-number-citation ref-id="jpa_overview_em_identity"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em_cache">8.5.
Cache Management
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em_cache"><fo:page-number-citation ref-id="jpa_overview_em_cache"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em_query">8.6.
Query Factory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em_query"><fo:page-number-citation ref-id="jpa_overview_em_query"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_em_closing">8.7.
Closing
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_em_closing"><fo:page-number-citation ref-id="jpa_overview_em_closing"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_trans">9.
Transaction
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_trans"><fo:page-number-citation ref-id="jpa_overview_trans"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_trans" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_trans_types">9.1.
Transaction Types
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_trans_types"><fo:page-number-citation ref-id="jpa_overview_trans_types"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_trans_local">9.2.
The EntityTransaction Interface
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_trans_local"><fo:page-number-citation ref-id="jpa_overview_trans_local"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query">10.
JPA Query
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query"><fo:page-number-citation ref-id="jpa_overview_query"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_query" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_query_api">10.1.
JPQL API
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_query_api"><fo:page-number-citation ref-id="jpa_query_api"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_query_api" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_basic">10.1.1.
Query Basics
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_basic"><fo:page-number-citation ref-id="jpa_overview_query_basic"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_relations">10.1.2.
Relation Traversal
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_relations"><fo:page-number-citation ref-id="jpa_overview_query_relations"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_join_fetch">10.1.3.
Fetch Joins
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_join_fetch"><fo:page-number-citation ref-id="jpa_overview_join_fetch"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_functions">10.1.4.
JPQL Functions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_functions"><fo:page-number-citation ref-id="jpa_overview_query_functions"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_inheritance">10.1.5.
Polymorphic Queries
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_inheritance"><fo:page-number-citation ref-id="jpa_overview_query_inheritance"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_params">10.1.6.
Query Parameters
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_params"><fo:page-number-citation ref-id="jpa_overview_query_params"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_hints">10.1.7.
Query Hints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_hints"><fo:page-number-citation ref-id="jpa_overview_query_hints"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_query_hints" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_hints_locking">10.1.7.1.
Locking Hints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_hints_locking"><fo:page-number-citation ref-id="jpa_hints_locking"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_hints_resultset">10.1.7.2.
Result Set Size Hint
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_hints_resultset"><fo:page-number-citation ref-id="jpa_hints_resultset"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_hints_isolation">10.1.7.3.
Isolation Level Hint
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_hints_isolation"><fo:page-number-citation ref-id="jpa_hints_isolation"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_hints_fetchplan">10.1.7.4.
Other Fetchplan Hints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_hints_fetchplan"><fo:page-number-citation ref-id="jpa_hints_fetchplan"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="d0e6431">10.1.7.5.
Oracle Query Hints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="d0e6431"><fo:page-number-citation ref-id="d0e6431"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_hints_named">10.1.7.6.
Named Query Hints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_hints_named"><fo:page-number-citation ref-id="jpa_hints_named"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_ordering">10.1.8.
Ordering
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_ordering"><fo:page-number-citation ref-id="jpa_overview_query_ordering"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_aggregates">10.1.9.
Aggregates
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_aggregates"><fo:page-number-citation ref-id="jpa_overview_query_aggregates"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_named">10.1.10.
Named Queries
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_named"><fo:page-number-citation ref-id="jpa_overview_query_named"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_delete">10.1.11.
Delete By Query
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_delete"><fo:page-number-citation ref-id="jpa_overview_query_delete"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_query_update">10.1.12.
Update By Query
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_query_update"><fo:page-number-citation ref-id="jpa_overview_query_update"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref">10.2.
JPQL Language Reference
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref"><fo:page-number-citation ref-id="jpa_langref"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_langref" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_stmnttypes">10.2.1.
JPQL Statement Types
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_stmnttypes"><fo:page-number-citation ref-id="jpa_langref_stmnttypes"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_langref_stmnttypes" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_select">10.2.1.1.
JPQL Select Statement
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_select"><fo:page-number-citation ref-id="jpa_langref_select"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_bulk">10.2.1.2.
JPQL Update and Delete Statements
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_bulk"><fo:page-number-citation ref-id="jpa_langref_bulk"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_schematypes">10.2.2.
JPQL Abstract Schema Types and Query Domains
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_schematypes"><fo:page-number-citation ref-id="jpa_langref_schematypes"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_langref_schematypes" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_schemanaming">10.2.2.1.
JPQL Entity Naming
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_schemanaming"><fo:page-number-citation ref-id="jpa_langref_schemanaming"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_schemaexample">10.2.2.2.
JPQL Schema Example
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_schemaexample"><fo:page-number-citation ref-id="jpa_langref_schemaexample"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_fromclause">10.2.3.
JPQL FROM Clause and Navigational Declarations
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_fromclause"><fo:page-number-citation ref-id="jpa_langref_fromclause"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_langref_fromclause" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_from_identifiers">10.2.3.1.
JPQL FROM Identifiers
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_from_identifiers"><fo:page-number-citation ref-id="jpa_langref_from_identifiers"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_from_vars">10.2.3.2.
JPQL Identification Variables
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_from_vars"><fo:page-number-citation ref-id="jpa_langref_from_vars"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_range">10.2.3.3.
JPQL Range Declarations
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_range"><fo:page-number-citation ref-id="jpa_langref_range"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_path">10.2.3.4.
JPQL Path Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_path"><fo:page-number-citation ref-id="jpa_langref_path"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_Joins">10.2.3.5.
JPQL Joins
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_Joins"><fo:page-number-citation ref-id="jpa_langref_Joins"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_langref_Joins" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_inner_joins">10.2.3.5.1.
JPQL Inner Joins (Relationship Joins)
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_inner_joins"><fo:page-number-citation ref-id="jpa_langref_inner_joins"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_outer_joins">10.2.3.5.2.
JPQL Outer Joins
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_outer_joins"><fo:page-number-citation ref-id="jpa_langref_outer_joins"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_fetch_joins">10.2.3.5.3.
JPQL Fetch Joins
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_fetch_joins"><fo:page-number-citation ref-id="jpa_langref_fetch_joins"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_collection_dec">10.2.3.6.
JPQL Collection Member Declarations
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_collection_dec"><fo:page-number-citation ref-id="jpa_langref_collection_dec"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_polymorph">10.2.3.7.
JPQL Polymorphism
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_polymorph"><fo:page-number-citation ref-id="jpa_langref_polymorph"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_where">10.2.4.
JPQL WHERE Clause
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_where"><fo:page-number-citation ref-id="jpa_langref_where"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_cond">10.2.5.
JPQL Conditional Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_cond"><fo:page-number-citation ref-id="jpa_langref_cond"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_langref_cond" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_lit">10.2.5.1.
JPQL Literals
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_lit"><fo:page-number-citation ref-id="jpa_langref_lit"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_idvar">10.2.5.2.
JPQL Identification Variables
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_idvar"><fo:page-number-citation ref-id="jpa_langref_idvar"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_path_exp">10.2.5.3.
JPQL Path Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_path_exp"><fo:page-number-citation ref-id="jpa_langref_path_exp"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_input_params">10.2.5.4.
JPQL Input Parameters
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_input_params"><fo:page-number-citation ref-id="jpa_langref_input_params"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_langref_input_params" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_pos_params">10.2.5.4.1.
JPQL Positional Parameters
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_pos_params"><fo:page-number-citation ref-id="jpa_langref_pos_params"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_named_params">10.2.5.4.2.
JPQL Named Parameters
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_named_params"><fo:page-number-citation ref-id="jpa_langref_named_params"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_cond_comp">10.2.5.5.
JPQL Conditional Expression Composition
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_cond_comp"><fo:page-number-citation ref-id="jpa_langref_cond_comp"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_operators">10.2.5.6.
JPQL Operators and Operator Precedence
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_operators"><fo:page-number-citation ref-id="jpa_langref_operators"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_between">10.2.5.7.
JPQL Between Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_between"><fo:page-number-citation ref-id="jpa_langref_between"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_in">10.2.5.8.
JPQL In Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_in"><fo:page-number-citation ref-id="jpa_langref_in"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_like">10.2.5.9.
JPQL Like Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_like"><fo:page-number-citation ref-id="jpa_langref_like"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_null">10.2.5.10.
JPQL Null Comparison Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_null"><fo:page-number-citation ref-id="jpa_langref_null"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_empty_comp">10.2.5.11.
JPQL Empty Collection Comparison Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_empty_comp"><fo:page-number-citation ref-id="jpa_langref_empty_comp"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_collection_member">10.2.5.12.
JPQL Collection Member Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_collection_member"><fo:page-number-citation ref-id="jpa_langref_collection_member"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_exists">10.2.5.13.
JPQL Exists Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_exists"><fo:page-number-citation ref-id="jpa_langref_exists"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_all_any">10.2.5.14.
JPQL All or Any Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_all_any"><fo:page-number-citation ref-id="jpa_langref_all_any"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_subqueries">10.2.5.15.
JPQL Subqueries
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_subqueries"><fo:page-number-citation ref-id="jpa_langref_subqueries"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_functional">10.2.5.16.
JPQL Functional Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_functional"><fo:page-number-citation ref-id="jpa_langref_functional"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_langref_functional" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_string_fun">10.2.5.16.1.
JPQL String Functions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_string_fun"><fo:page-number-citation ref-id="jpa_langref_string_fun"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_arithmetic">10.2.5.16.2.
JPQL Arithmetic Functions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_arithmetic"><fo:page-number-citation ref-id="jpa_langref_arithmetic"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_datetime">10.2.5.16.3.
JPQL Datetime Functions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_datetime"><fo:page-number-citation ref-id="jpa_langref_datetime"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_group">10.2.6.
JPQL GROUP BY, HAVING
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_group"><fo:page-number-citation ref-id="jpa_langref_group"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_select_clause">10.2.7.
JPQL SELECT Clause
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_select_clause"><fo:page-number-citation ref-id="jpa_langref_select_clause"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_langref_select_clause" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_resulttype">10.2.7.1.
JPQL Result Type of the SELECT Clause
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_resulttype"><fo:page-number-citation ref-id="jpa_langref_resulttype"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_constructor">10.2.7.2.
JPQL Constructor Expressions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_constructor"><fo:page-number-citation ref-id="jpa_langref_constructor"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_null_select">10.2.7.3.
JPQL Null Values in the Query Result
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_null_select"><fo:page-number-citation ref-id="jpa_langref_null_select"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_aggregates">10.2.7.4.
JPQL Aggregate Functions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_aggregates"><fo:page-number-citation ref-id="jpa_langref_aggregates"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_langref_aggregates" margin-left="96pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_agg_examples">10.2.7.4.1.
JPQL Aggregate Examples
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_agg_examples"><fo:page-number-citation ref-id="jpa_langref_agg_examples"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_orderby">10.2.8.
JPQL ORDER BY Clause
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_orderby"><fo:page-number-citation ref-id="jpa_langref_orderby"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_bulk_ops">10.2.9.
JPQL Bulk Update and Delete
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_bulk_ops"><fo:page-number-citation ref-id="jpa_langref_bulk_ops"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_null_values">10.2.10.
JPQL Null Values
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_null_values"><fo:page-number-citation ref-id="jpa_langref_null_values"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_equality">10.2.11.
JPQL Equality and Comparison Semantics
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_equality"><fo:page-number-citation ref-id="jpa_langref_equality"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_langref_bnf">10.2.12.
JPQL BNF
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_langref_bnf"><fo:page-number-citation ref-id="jpa_langref_bnf"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_sqlquery">11.
SQL Queries
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_sqlquery"><fo:page-number-citation ref-id="jpa_overview_sqlquery"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_sqlquery" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_sqlquery_create">11.1.
Creating SQL Queries
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_sqlquery_create"><fo:page-number-citation ref-id="jpa_overview_sqlquery_create"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_sqlquery_obj">11.2.
Retrieving Persistent Objects with SQL
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_sqlquery_obj"><fo:page-number-citation ref-id="jpa_overview_sqlquery_obj"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping">12.
Mapping Metadata
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping"><fo:page-number-citation ref-id="jpa_overview_mapping"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_mapping" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_table">12.1.
Table
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_table"><fo:page-number-citation ref-id="jpa_overview_mapping_table"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_unq">12.2.
Unique Constraints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_unq"><fo:page-number-citation ref-id="jpa_overview_mapping_unq"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_column">12.3.
Column
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_column"><fo:page-number-citation ref-id="jpa_overview_mapping_column"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_id">12.4.
Identity Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_id"><fo:page-number-citation ref-id="jpa_overview_mapping_id"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_sequence">12.5.
Generators
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_sequence"><fo:page-number-citation ref-id="jpa_overview_mapping_sequence"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_mapping_sequence" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_sequence_seqgen">12.5.1.
Sequence Generator
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_sequence_seqgen"><fo:page-number-citation ref-id="jpa_overview_mapping_sequence_seqgen"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_sequence_tablegen">12.5.2.
TableGenerator
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_sequence_tablegen"><fo:page-number-citation ref-id="jpa_overview_mapping_sequence_tablegen"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_sequence_genex">12.5.3.
Example
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_sequence_genex"><fo:page-number-citation ref-id="jpa_overview_mapping_sequence_genex"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher">12.6.
Inheritance
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher"><fo:page-number-citation ref-id="jpa_overview_mapping_inher"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_mapping_inher" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_single">12.6.1.
Single Table
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_single"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_single"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_mapping_inher_single" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_single_adv">12.6.1.1.
Advantages
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_single_adv"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_single_adv"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_single_disadv">12.6.1.2.
Disadvantages
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_single_disadv"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_single_disadv"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_joined">12.6.2.
Joined
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_joined"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_joined"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_mapping_inher_joined" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_joined_adv">12.6.2.1.
Advantages
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_joined_adv"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_joined_adv"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_joined_disadv">12.6.2.2.
Disadvantages
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_joined_disadv"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_joined_disadv"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_tpc">12.6.3.
Table Per Class
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_tpc"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_tpc"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_mapping_inher_tpc" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_tpc_adv">12.6.3.1.
Advantages
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_tpc_adv"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_tpc_adv"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_tpc_disadv">12.6.3.2.
Disadvantages
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_tpc_disadv"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_tpc_disadv"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_inher_together">12.6.4.
Putting it All Together
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_inher_together"><fo:page-number-citation ref-id="jpa_overview_mapping_inher_together"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_discrim">12.7.
Discriminator
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_discrim"><fo:page-number-citation ref-id="jpa_overview_mapping_discrim"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_field">12.8.
Field Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_field"><fo:page-number-citation ref-id="jpa_overview_mapping_field"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_mapping_field" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_basic">12.8.1.
Basic Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_basic"><fo:page-number-citation ref-id="jpa_overview_mapping_basic"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.jpa_overview.jpa_overview_mapping_basic" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_lob">12.8.1.1.
LOBs
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_lob"><fo:page-number-citation ref-id="jpa_overview_mapping_lob"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_enum">12.8.1.2.
Enumerated
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_enum"><fo:page-number-citation ref-id="jpa_overview_mapping_enum"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_temporal">12.8.1.3.
Temporal Types
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_temporal"><fo:page-number-citation ref-id="jpa_overview_mapping_temporal"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_basic_example">12.8.1.4.
The Updated Mappings
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_basic_example"><fo:page-number-citation ref-id="jpa_overview_mapping_basic_example"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_secondary">12.8.2.
Secondary Tables
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_secondary"><fo:page-number-citation ref-id="jpa_overview_mapping_secondary"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_embed">12.8.3.
Embedded Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_embed"><fo:page-number-citation ref-id="jpa_overview_mapping_embed"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_rel">12.8.4.
Direct Relations
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_rel"><fo:page-number-citation ref-id="jpa_overview_mapping_rel"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_assoccoll">12.8.5.
Join Table
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_assoccoll"><fo:page-number-citation ref-id="jpa_overview_mapping_assoccoll"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_bidi">12.8.6.
Bidirectional Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_bidi"><fo:page-number-citation ref-id="jpa_overview_mapping_bidi"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_map">12.8.7.
Map Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_map"><fo:page-number-citation ref-id="jpa_overview_mapping_map"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_mapping_full">12.9.
The Complete Mappings
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_mapping_full"><fo:page-number-citation ref-id="jpa_overview_mapping_full"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="jpa_overview_conclusion">13.
Conclusion
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="jpa_overview_conclusion"><fo:page-number-citation ref-id="jpa_overview_conclusion"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Introduction
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Introduction
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="jpa_overview_intro"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 1. 
Introduction
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e47"><!--
EJB3 Persistence
--></fo:wrapper>
<fo:wrapper id="d0e53"><!--
JPA
--></fo:wrapper>
The Java Persistence API (JPA) is a specification from
Sun Microsystems for the persistence of Java objects to any relational
datastore. JPA requires J2SE 1.5 (also referred to as "Java 5") or
higher, as it makes heavy use of new Java language features such as annotations
and generics. This document provides an overview of JPA. Unless
otherwise noted, the information presented applies to all JPA implementations.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e57"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
For coverage of OpenJPA's many extensions to the JPA specification,
see the <fo:basic-link internal-destination="ref_guide_intro"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Reference Guide</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:block><fo:block id="jpa_overview_intro_audience"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Intended Audience
</fo:marker><fo:block font-size="20.735999999999997pt">1.1. 
Intended Audience
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This document is intended for developers who want to learn about JPA
in order to use it in their applications. It assumes that you have a strong
knowledge of object-oriented concepts and Java, including Java 5 annotations and
generics. It also assumes some experience with relational databases and the
Structured Query Language (SQL).
</fo:block></fo:block><fo:block id="jpa_overview_intro_transpers"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Lightweight Persistence
</fo:marker><fo:block font-size="20.735999999999997pt">1.2. 
Lightweight Persistence
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e71"><!--
lightweight persistence
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e76"><!--
persistent data
--></fo:wrapper>
<fo:inline font-style="italic">Persistent data</fo:inline> is information that can outlive the program
that creates it. The majority of complex programs use persistent data: GUI
applications need to store user preferences across program invocations, web
applications track user movements and orders over long periods of time, etc.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">Lightweight persistence</fo:inline> is the storage and retrieval of
persistent data with little or no work from you, the developer. For example,
Java serialization
<fo:wrapper id="d0e88"><!--
serialization
--></fo:wrapper>
is a form of lightweight persistence because it can be used to persist Java
objects directly to a file with very little effort. Serialization's capabilities
as a lightweight persistence mechanism pale in comparison to those provided by
JPA, however. The next chapter compares JPA to serialization and other available
persistence mechanisms.
</fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Why JPA?
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Why JPA?
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="jpa_overview_why"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 2. 
Why JPA?
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e96"><!--
JPA
,
why
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Java developers who need to store and retrieve persistent data already have
several options available to them: serialization, JDBC, JDO, proprietary
object-relational mapping tools, object databases, and EJB 2 entity beans. Why
introduce yet another persistence framework? The answer to this question is that
with the exception of JDO, each of the aforementioned persistence solutions has
severe limitations. JPA attempts to overcome these limitations, as illustrated
by the table below.
</fo:block><fo:block xmlns:rx="http://www.renderx.com/XSL/Extensions" space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="d0e103"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Table 2.1. 
Persistence Mechanisms
</fo:block><fo:table border-before-width.conditionality="retain" border-collapse="collapse" border-left-style="solid" border-right-style="solid" border-top-style="solid" border-bottom-style="solid" border-left-width="0.5pt" border-right-width="0.5pt" border-top-width="0.5pt" border-bottom-width="0.5pt" border-left-color="black" border-right-color="black" border-top-color="black" border-bottom-color="black" table-layout="fixed" width="100%"><fo:table-column column-number="1"/><fo:table-column column-number="2"/><fo:table-column column-number="3"/><fo:table-column column-number="4"/><fo:table-column column-number="5"/><fo:table-column column-number="6"/><fo:table-column column-number="7"/><fo:table-column column-number="8"/><fo:table-header start-indent="0pt" end-indent="0pt"><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">
Supports:
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">
Serialization
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">
JDBC
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">
ORM
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">
ODB
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">
EJB 2
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">
JDO
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block font-weight="bold">
JPA
</fo:block></fo:table-cell></fo:table-row></fo:table-header><fo:table-body start-indent="0pt" end-indent="0pt"><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Java Objects
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
No
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Advanced OO Concepts
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
No
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
No
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Transactional Integrity
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
No
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Concurrency
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
No
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Large Data Sets
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
No
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Existing Schema
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
No
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
No
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Relational and Non-Relational Stores
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
No
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
No
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
No
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
No
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
No
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Queries
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
No
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Strict Standards / Portability
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
No
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
No
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
No
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Simplicity
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
No
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Yes
</fo:inline>
</fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e460"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e461"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e464"><!--
serialization
--></fo:wrapper>
<fo:wrapper id="d0e468"><!--
JPA
,
vs serialization
--></fo:wrapper>
<fo:inline font-style="italic">Serialization</fo:inline> is Java's built-in mechanism for transforming
an object graph into a series of bytes, which can then be sent over the network
or stored in a file. Serialization is very easy to use, but it is also very
limited. It must store and retrieve the entire object graph at once, making it
unsuitable for dealing with large amounts of data. It cannot undo changes that
are made to objects if an error occurs while updating information, making it
unsuitable for applications that require strict data integrity. Multiple threads
or programs cannot read and write the same serialized data concurrently without
conflicting with each other. It provides no query capabilities. All these
factors make serialization useless for all but the most trivial persistence
needs.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e477"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e480"><!--
Java Database Connectivity
--></fo:wrapper>
<fo:wrapper id="d0e486"><!--
JDBC
--></fo:wrapper>
<fo:wrapper id="d0e490"><!--
JPA
,
vs JDBC
--></fo:wrapper>
Many developers use the <fo:inline font-style="italic">Java Database Connectivity</fo:inline> (JDBC)
APIs to manipulate persistent data in relational databases. JDBC overcomes most
of the shortcomings of serialization: it can handle large amounts of data, has
mechanisms to ensure data integrity, supports concurrent access to information,
and has a sophisticated query language in SQL. Unfortunately, JDBC does not
duplicate serialization's ease of use. The relational paradigm used by JDBC was
not designed for storing objects, and therefore forces you to either abandon
object-oriented programming for the portions of your code that deal with
persistent data, or to find a way of mapping object-oriented concepts like
inheritance to relational databases yourself.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e499"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e502"><!--
object-relational mapping
--></fo:wrapper>
<fo:wrapper id="d0e508"><!--
ORM
--></fo:wrapper>
<fo:wrapper id="d0e512"><!--
JPA
,
vs ORM products
--></fo:wrapper>
There are many proprietary software products that can perform the mapping
between objects and relational database tables for you. These <fo:inline font-style="italic">
object-relational mapping</fo:inline> (ORM) frameworks allow you to focus on the
object model and not concern yourself with the mismatch between the
object-oriented and relational paradigms. Unfortunately, each of these product
has its own set of APIs. Your code becomes tied to the proprietary interfaces of
a single vendor. If the vendor raises prices, fails to fix show-stopping bugs,
or falls behind in features, you cannot switch to another product without
rewriting all of your persistence code. This is referred to as vendor lock-in.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e521"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e524"><!--
object database
--></fo:wrapper>
<fo:wrapper id="d0e530"><!--
ODB
--></fo:wrapper>
<fo:wrapper id="d0e534"><!--
JPA
,
vs ODBs
--></fo:wrapper>
<fo:wrapper id="d0e540"><!--
ODBMG
--></fo:wrapper>
Rather than map objects to relational databases, some software companies have
developed a form of database designed specifically to store objects. These
<fo:inline font-style="italic">object databases</fo:inline> (ODBs) are often much easier to use than
object-relational mapping software. The Object Database Management Group (ODMG)
was formed to create a standard API for accessing object databases; few object
database vendors, however, comply with the ODMG's recommendations. Thus, vendor
lock-in plagues object databases as well. Many companies are also hesitant to
switch from tried-and-true relational systems to the relatively unknown object
database technology. Fewer data-analysis tools are available for object database
systems, and there are vast quantities of data already stored in older
relational databases. For all of these reasons and more, object databases have
not caught on as well as their creators hoped.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e547"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e550"><!--
Enterprise Java Beans
--></fo:wrapper>
<fo:wrapper id="d0e556"><!--
EJB
--></fo:wrapper>
<fo:wrapper id="d0e560"><!--
JPA
,
vs EJB 2
--></fo:wrapper>
The Enterprise Edition of the Java platform introduced entity Enterprise Java
Beans (EJBs). EJB 2.x entities are components that represent persistent
information in a datastore. Like object-relational mapping solutions, EJB 2.x
entities provide an object-oriented view of persistent data. Unlike
object-relational software, however, EJB 2.x entities are not limited to
relational databases; the persistent information they represent may come from an
Enterprise Information System (EIS) or other storage device. Also, EJB 2.x
entities use a strict standard, making them portable across vendors.
Unfortunately, the EJB 2.x standard is somewhat limited in the object-oriented
concepts it can represent. Advanced features like inheritance, polymorphism, and
complex relations are absent. Additionally, EBJ 2.x entities are difficult to
code, and they require heavyweight and often expensive application servers to
run.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e566"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e569"><!--
JDO
--></fo:wrapper>
<fo:wrapper id="d0e573"><!--
JPA
,
vs JDO
--></fo:wrapper>
The JDO specification uses an API that is strikingly similar to JPA. JDO,
however, supports non-relational databases, a feature that some argue dilutes
the specification.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e581"><!--
JPA
--></fo:wrapper>
JPA combines the best features from each of the persistence mechanisms listed
above. Creating entities under JPA is as simple as creating serializable
classes. JPA supports the large data sets, data consistency, concurrent use, and
query capabilities of JDBC. Like object-relational software and object
databases, JPA allows the use of advanced object-oriented concepts such as
inheritance. JPA avoids vendor lock-in by relying on a strict specification like
JDO and EJB 2.x entities. JPA focuses on relational databases. And like JDO, JPA
is extremely easy to use.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e585"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA typically stores data in relational databases, but can be customized for
use with non-relational datastores as well.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA is not ideal for every application. For many applications, though, it
provides an exciting alternative to other persistence mechanisms.
</fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Java Persistence API Architecture
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Java Persistence API Architecture
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="jpa_overview_arch"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 3. 
Java Persistence API Architecture
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e594"><!--
JPA
,
architecture
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The diagram below illustrates the relationships between the primary components
of the JPA architecture.
</fo:block><fo:block id="d0e601"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/jpa-arch.png" width="267px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e608"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A number of the depicted interfaces are only required outside of an
EJB3-compliant application server. In an application server, <fo:inline font-family="monospace">
EntityManager</fo:inline> instances are typically injected, rendering the
<fo:inline font-family="monospace">EntityManagerFactory</fo:inline> unnecessary. Also, transactions
within an application server are handled using standard application server
transaction controls. Thus, the <fo:inline font-family="monospace">EntityTransaction</fo:inline> also
goes unused.
</fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e620"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e621"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e624"><!--
Persistence
--></fo:wrapper>
<fo:inline font-weight="bold"><fo:basic-link internal-destination="jpa_overview_persistence"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
Persistence</fo:inline></fo:inline></fo:basic-link></fo:inline>: The <fo:inline font-family="monospace">
javax.persistence.Persistence</fo:inline> class contains static helper methods
to obtain <fo:inline font-family="monospace">EntityManagerFactory</fo:inline> instances in a
vendor-neutral fashion.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e639"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e642"><!--
EntityManagerFactory
--></fo:wrapper>
<fo:inline font-weight="bold"><fo:basic-link internal-destination="jpa_overview_emfactory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
EntityManagerFactory</fo:inline></fo:inline></fo:basic-link></fo:inline>: The <fo:inline font-family="monospace">
javax.persistence.EntityManagerFactory</fo:inline> class is a factory for
<fo:inline font-family="monospace"> EntityManager</fo:inline> s.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e657"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e660"><!--
EntityManager
--></fo:wrapper>
<fo:inline font-weight="bold"><fo:basic-link internal-destination="jpa_overview_em"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">EntityManager
</fo:inline></fo:inline></fo:basic-link></fo:inline>: The <fo:inline font-family="monospace">javax.persistence.EntityManager
</fo:inline> is the primary JPA interface used by applications. Each
<fo:inline font-family="monospace">EntityManager</fo:inline> manages a set of persistent objects, and
has APIs to insert new objects and delete existing ones. When used outside the
container, there is a one-to-one relationship between an <fo:inline font-family="monospace">
EntityManager</fo:inline> and an <fo:inline font-family="monospace"> EntityTransaction</fo:inline>.
<fo:inline font-family="monospace"> EntityManager</fo:inline>s also act as factories for <fo:inline font-family="monospace">
Query</fo:inline> instances.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e687"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e690"><!--
entity
--></fo:wrapper>
<fo:inline font-weight="bold"><fo:basic-link internal-destination="jpa_overview_pc"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">Entity
</fo:inline></fo:inline></fo:basic-link></fo:inline>: Entites are persistent objects that represent
datastore records.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e699"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e702"><!--
EntityTransaction
--></fo:wrapper>
<fo:inline font-weight="bold"><fo:basic-link internal-destination="jpa_overview_trans"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
EntityTransaction</fo:inline></fo:inline></fo:basic-link></fo:inline>: Each <fo:inline font-family="monospace">EntityManager
</fo:inline> has a one-to-one relation with a single <fo:inline font-family="monospace">
javax.persistence.EntityTransaction</fo:inline>. <fo:inline font-family="monospace">
EntityTransaction</fo:inline>s allow operations on persistent data to be
grouped into units of work that either completely succeed or completely fail,
leaving the datastore in its original state. These all-or-nothing operations
are important for maintaining data integrity.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e720"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e723"><!--
Query
--></fo:wrapper>
<fo:wrapper id="d0e727"><!--
Java Persistence Query Language
--></fo:wrapper>
<fo:wrapper id="d0e733"><!--
JPQL
--></fo:wrapper>
<fo:wrapper id="d0e737"><!--
JPA
,
query language
--></fo:wrapper>
<fo:wrapper id="d0e745"><!--
Structured Query Language
--></fo:wrapper>
<fo:wrapper id="d0e751"><!--
SQL
--></fo:wrapper>
<fo:inline font-weight="bold"><fo:basic-link internal-destination="jpa_overview_query"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">Query
</fo:inline></fo:inline></fo:basic-link></fo:inline>: The <fo:inline font-family="monospace">javax.persistence.Query
</fo:inline> interface is implemented by each JPA vendor to find persistent
objects that meet certain criteria. JPA standardizes support for queries using
both the Java Persistence Query Language (JPQL) and the Structured Query
Language (SQL). You obtain <fo:inline font-family="monospace">Query</fo:inline> instances from an
<fo:inline font-family="monospace">EntityManager</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The example below illustrates how the JPA interfaces interact to execute a JPQL
query and update persistent objects. The example assumes execution outside a
container.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_arch_interact_outside"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 3.1. 
Interaction of Interfaces Outside Container
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e774">
// get an EntityManagerFactory using the Persistence class; typically
// the factory is cached for easy repeated use
EntityManagerFactory factory = Persistence.createEntityManagerFactory(null);
// get an EntityManager from the factory
EntityManager em = factory.createEntityManager(PersistenceContextType.EXTENDED);
// updates take place within transactions
EntityTransaction tx = em.getTransaction();
tx.begin();
// query for all employees who work in our research division
// and put in over 40 hours a week average
Query query = em.createQuery("select e from Employee e where "
+ "e.division.name = 'Research' AND e.avgHours &gt; 40");
List results = query.getResultList ();
// give all those hard-working employees a raise
for (Object res : results) {
Employee emp = (Employee) res;
emp.setSalary(emp.getSalary() * 1.1);
}
// commit the updates and free resources
tx.commit();
em.close();
factory.close();
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Within a container, the <fo:inline font-family="monospace">EntityManager</fo:inline> will be injected
and transactions will be handled declaratively. Thus, the in-container version
of the example consists entirely of business logic:
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_arch_interact_inside"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 3.2. 
Interaction of Interfaces Inside Container
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e784">
// query for all employees who work in our research division
// and put in over 40 hours a week average - note that the EntityManager em
// is injected using a @Resource annotation
Query query = em.createQuery("select e from Employee e where "
+ "e.division.name = 'Research' and e.avgHours &gt; 40");
List results = query.getResultList();
// give all those hard-working employees a raise
for (Object res : results) {
emp = (Employee) res;
emp.setSalary(emp.getSalary() * 1.1);
}
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The remainder of this document explores the JPA interfaces in detail. We present
them in roughly the order that you will use them as you develop your
application.
</fo:block><fo:block id="jpa_overview_arch_exceptions"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
JPA Exceptions
</fo:marker><fo:block font-size="20.735999999999997pt">3.1. 
JPA Exceptions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e791"><!--
JPA
,
exceptions
--></fo:wrapper><fo:wrapper id="d0e798"><!--
exceptions
,
JPA
--></fo:wrapper><fo:block id="d0e803"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/jpa-exceptions.png" width="285px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The diagram above depicts the JPA exception architecture. All
exceptions are unchecked. JPA uses standard exceptions where
appropriate, most notably <fo:inline font-family="monospace">IllegalArgumentException</fo:inline>s and
<fo:inline font-family="monospace">IllegalStateException</fo:inline>s. The specification also provides
a few JPA-specific exceptions in the <fo:inline font-family="monospace">javax.persistence</fo:inline>
package. These exceptions should be self-explanatory. See the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api">Javadoc</fo:basic-link> for
additional details on JPA exceptions.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e824"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
All exceptions thrown by OpenJPA implement
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/util/ExceptionInfo.html"><fo:inline font-family="monospace">
org.apache.openjpa.util.ExceptionInfo</fo:inline></fo:basic-link> to provide you with
additional error information.
</fo:block></fo:block></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Entity
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Entity
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="jpa_overview_pc"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 4. 
Entity
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e835"><!--
persistent classes
--></fo:wrapper><fo:wrapper id="d0e838"><!--
Entity
--></fo:wrapper><fo:wrapper id="d0e843"><!--
class
,
persistent
--></fo:wrapper><fo:wrapper id="d0e850"><!--
persistence capable
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA recognizes two types of persistent classes: <fo:inline font-style="italic">entity</fo:inline>
classes and <fo:inline font-style="italic">embeddable</fo:inline> classes. Each persistent instance of
an entity class - each <fo:inline font-style="italic">entity</fo:inline> - represents a unique
datastore record. You can use the <fo:inline font-family="monospace">EntityManager</fo:inline> to find
an entity by its persistent identity (covered later in this chapter), or use a
<fo:inline font-family="monospace">Query</fo:inline> to find entities matching certain criteria.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
An instance of an embeddable class, on the other hand, is only stored as part of
a separate entity. Embeddable instances have no persistent identity, and are
never returned directly from the <fo:inline font-family="monospace">EntityManager</fo:inline> or from a
<fo:inline font-family="monospace">Query</fo:inline>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Despite these differences, there are few distinctions between entity classes and
embeddable classes. In fact, writing either type of persistent class is a lot
like writing any other class. There are no special parent classes to
extend from, field types to use, or methods to write. This is one important way
in which JPA makes persistence transparent to you, the developer.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e882"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA supports both fields and JavaBean properties as persistent state. For
simplicity, however, we will refer to all persistent state as persistent fields,
unless we want to note a unique aspect of persistent properties.
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_pc_pcclass"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.1. 
Persistent Class
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e888">
package org.mag;
/**
* Example persistent class. Notice that it looks exactly like any other
* class. JPA makes writing persistent classes completely transparent.
*/
public class Magazine {
private String isbn;
private String title;
private Set articles = new HashSet();
private Article coverArticle;
private int copiesSold;
private double price;
private Company publisher;
private int version;
protected Magazine() {
}
public Magazine(String title, String isbn) {
this.title = title;
this.isbn = isbn;
}
public void publish(Company publisher, double price) {
this.publisher = publisher;
publisher.addMagazine(this);
this.price = price;
}
public void sell() {
copiesSold++;
publisher.addRevenue(price);
}
public void addArticle(Article article) {
articles.add(article);
}
// rest of methods omitted
}
</fo:block></fo:block></fo:block><fo:block id="jpa_overview_pc_restrict"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Restrictions on Persistent Classes
</fo:marker><fo:block font-size="20.735999999999997pt">4.1. 
Restrictions on Persistent Classes
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e893"><!--
persistent classes
,
restrictions on
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
There are very few restrictions placed on persistent classes. Still, it never
hurts to familiarize yourself with exactly what JPA does and does not support.
</fo:block><fo:block id="jpa_overview_pc_no_arg"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Default or No-Arg Constructor
</fo:marker><fo:block font-size="17.28pt">4.1.1. 
Default or No-Arg Constructor
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e903"><!--
persistent classes
,
no-arg constructor requirement
--></fo:wrapper><fo:wrapper id="d0e908"><!--
constructor
,
no-arg constructor requirement
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The JPA specification requires that all persistent classes have a no-arg
constructor. This constructor may be public or protected. Because the compiler
automatically creates a default no-arg constructor when no other constructor is
defined, only classes that define constructors must also include a no-arg
constructor.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e915"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA's <fo:inline font-style="italic">enhancer</fo:inline> will automatically add a protected
no-arg constructor to your class when required. Therefore, this restriction does
not apply when using the enhancer. See <fo:basic-link internal-destination="ref_guide_pc_enhance"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2, “
Enhancement
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_enhance"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_enhance"/>]</fo:inline></fo:basic-link>
of the Reference Guide for details.
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_pc_final"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Final
</fo:marker><fo:block font-size="17.28pt">4.1.2. 
Final
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Entity classes may not be final. No method of an entity class can be final.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e928"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA supports final classes and final methods.
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_pc_id"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Identity Fields
</fo:marker><fo:block font-size="17.28pt">4.1.3. 
Identity Fields
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e934"><!--
identity fields
--></fo:wrapper><fo:wrapper id="d0e939"><!--
persistent classes
,
JPA id requirement
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
All entity classes must declare one or more fields which together form the
persistent identity of an instance. These are called <fo:inline font-style="italic">identity
</fo:inline> or <fo:inline font-style="italic">primary key</fo:inline> fields. In our <fo:inline font-family="monospace">
Magazine</fo:inline> class, <fo:inline font-family="monospace">isbn</fo:inline> and <fo:inline font-family="monospace">title</fo:inline>
are identity fields, because no two magazine records in the datastore can have
the same <fo:inline font-family="monospace">isbn</fo:inline> and <fo:inline font-family="monospace">title</fo:inline> values.
<fo:basic-link internal-destination="jpa_overview_meta_id"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.2, “
Id
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_id"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_id"/>]</fo:inline></fo:basic-link> will show you how to denote your
identity fields in JPA metadata. <fo:basic-link internal-destination="jpa_overview_pc_identity"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.2, “
Entity Identity
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_pc_identity"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_pc_identity"/>]</fo:inline></fo:basic-link>
below examines persistent identity.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e971"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA fully supports identity fields, but does not require them. See
<fo:basic-link internal-destination="ref_guide_pc_oid"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.3, “
Object Identity
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_oid"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_oid"/>]</fo:inline></fo:basic-link> of the Reference Guide for details.
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_pc_version"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Version Field
</fo:marker><fo:block font-size="17.28pt">4.1.4. 
Version Field
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e979"><!--
version fields
--></fo:wrapper><fo:wrapper id="d0e984"><!--
persistent classes
,
JPA version requirement
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">version</fo:inline> field in our <fo:inline font-family="monospace">Magazine</fo:inline>
class may seem out of place. JPA uses a version field in your entities to detect
concurrent modifications to the same datastore record. When the JPA runtime
detects an attempt to concurrently modify the same record, it throws an
exception to the transaction attempting to commit last. This prevents
overwriting the previous commit with stale data.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A version field is not required, but without one concurrent threads or
processes might succeed in making conflicting changes to the same record at the
same time. This is unacceptable to most applications.
<fo:basic-link internal-destination="jpa_overview_meta_version"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.5, “
Version
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_version"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_version"/>]</fo:inline></fo:basic-link> shows you how to designate a
version field in JPA metadata.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The version field must be an integral type (<fo:inline font-family="monospace"> int</fo:inline>,
<fo:inline font-family="monospace">Long</fo:inline>, etc) or a <fo:inline font-family="monospace">
java.sql.Timestamp</fo:inline>. You should consider version fields immutable.
Changing the field value has undefined results.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e1012"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA fully supports version fields, but does not require them for concurrency
detection. OpenJPA can maintain surrogate version values or use state
comparisons to detect concurrent modifications. See
<fo:basic-link internal-destination="ref_guide_mapping_jpa"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.7, “
Additional JPA Mappings
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_jpa"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_jpa"/>]</fo:inline></fo:basic-link> in the Reference Guide.
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_pc_restrict_inheritance"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Inheritance
</fo:marker><fo:block font-size="17.28pt">4.1.5. 
Inheritance
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e1020"><!--
persistent classes
,
inheritance of
--></fo:wrapper><fo:wrapper id="d0e1027"><!--
inheritance
,
of persistent classes
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA fully supports inheritance in persistent classes. It allows persistent
classes to inherit from non-persistent classes, persistent classes to inherit
from other persistent classes, and non-persistent classes to inherit from
persistent classes. It is even possible to form inheritance hierarchies in which
persistence skips generations. There are, however, a few important limitations:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e1034"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1035"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Persistent classes cannot inherit from certain natively-implemented system
classes such as <fo:inline font-family="monospace">java.net.Socket</fo:inline> and <fo:inline font-family="monospace">
java.lang.Thread</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1044"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If a persistent class inherits from a non-persistent class, the fields of the
non-persistent superclass cannot be persisted.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1047"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
All classes in an inheritance tree must use the same identity type. We cover
entity identity in <fo:basic-link internal-destination="jpa_overview_pc_identity"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.2, “
Entity Identity
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_pc_identity"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_pc_identity"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="jpa_overview_pc_restrict_fields"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Persistent Fields
</fo:marker><fo:block font-size="17.28pt">4.1.6. 
Persistent Fields
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e1055"><!--
persistent classes
,
field restrictions
--></fo:wrapper><fo:wrapper id="d0e1062"><!--
field
,
persistent
--></fo:wrapper><fo:wrapper id="d0e1069"><!--
persistent fields
,
restrictions on
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA manages the state of all persistent fields. Before you access persistent
state, the JPA runtime makes sure that it has been loaded from the datastore.
When you set a field, the runtime records that it has changed so that the new
value will be persisted. This allows you to treat the field in exactly the same
way you treat any other field - another aspect of JPA's transparency.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA does not support static or final fields. It does, however, include built-in
support for most common field types. These types can be roughly divided into
three categories: immutable types, mutable types, and relations.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e1080"><!--
persistent fields
,
immutable types
--></fo:wrapper>
<fo:wrapper id="d0e1086"><!--
immutable
,
persistent field types
--></fo:wrapper>
<fo:inline font-style="italic">Immutable</fo:inline> types, once created, cannot be changed. The only
way to alter a persistent field of an immutable type is to assign a new value to
the field. JPA supports the following immutable types:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e1095"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1096"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
All primitives (<fo:inline font-family="monospace">int, float, byte</fo:inline>, etc)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1102"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
All primitive wrappers (<fo:inline font-family="monospace">java.lang.Integer, java.lang.Float,
java.lang.Byte</fo:inline>, etc)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1108"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">java.lang.String</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1114"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">java.math.BigInteger</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1120"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">java.math.BigDecimal</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA also supports <fo:inline font-family="monospace">byte[]</fo:inline>, <fo:inline font-family="monospace">Byte[]</fo:inline>,
<fo:inline font-family="monospace">char[]</fo:inline>, and <fo:inline font-family="monospace">Character[]</fo:inline> as
immutable types. That is, you can persist fields of these types,
but you should not manipulate individual array indexes without resetting the
array into the persistent field.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e1142"><!--
persistent fields
,
mutable types
--></fo:wrapper>
<fo:wrapper id="d0e1150"><!--
mutable
,
persistent field types
--></fo:wrapper>
<fo:wrapper id="d0e1160"><!--
persistent fields
,
user-defined types
--></fo:wrapper>
<fo:wrapper id="d0e1166"><!--
user-defined
,
persistent field types
--></fo:wrapper>
Persistent fields of <fo:inline font-style="italic">mutable</fo:inline> types can be altered without
assigning the field a new value. Mutable types can be modified directly through
their own methods. The JPA specification requires that implementations support
the following mutable field types:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e1177"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1178"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">java.util.Date</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1184"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">java.util.Calendar</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1190"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">java.sql.Date</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1196"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">java.sql.Timestamp</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1202"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">java.sql.Time</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1208"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Enums
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1211"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Entity types (relations between entities)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1214"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Embeddable types
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1217"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">java.util.Collection</fo:inline>s of entities
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1223"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">java.util.Set</fo:inline>s of entities
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1229"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">java.util.List</fo:inline>s of entities
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1235"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">java.util.Map</fo:inline>s in which each entry maps the value of one
of a related entity's fields to that entity.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Collection and map types may be parameterized.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e1245"><!--
persistent fields
,
of unknown types
--></fo:wrapper>
<fo:wrapper id="d0e1251"><!--
Object
,
as persistent field type
--></fo:wrapper>
Most JPA implementations also have support for persisting serializable values as
binary data in the datastore. <fo:basic-link internal-destination="jpa_overview_meta"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 5, <fo:inline font-style="italic">
Metadata
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta"/>]</fo:inline></fo:basic-link> has more
information on persisting serializable types.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e1261"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA also supports arrays, <fo:inline font-family="monospace">java.lang.Number</fo:inline>,
<fo:inline font-family="monospace">java.util.Locale</fo:inline>, all JDK 1.2 <fo:inline font-family="monospace">Set</fo:inline>,
<fo:inline font-family="monospace">List</fo:inline>, and <fo:inline font-family="monospace">Map</fo:inline> types,
and many other mutable and immutable field types. OpenJPA also allows you to
plug in support for custom types.
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_pc_restrict_conclusion"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Conclusions
</fo:marker><fo:block font-size="17.28pt">4.1.7. 
Conclusions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This section detailed all of the restrictions JPA places on persistent classes.
While it may seem like we presented a lot of information, you will seldom find
yourself hindered by these restrictions in practice. Additionally, there are
often ways of using JPA's other features to circumvent any limitations you run
into.
</fo:block></fo:block></fo:block><fo:block id="jpa_overview_pc_identity"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Entity Identity
</fo:marker><fo:block font-size="20.735999999999997pt">4.2. 
Entity Identity
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e1287"><!--
JPA
,
identity
--></fo:wrapper><fo:wrapper id="d0e1294"><!--
entity identity
--></fo:wrapper><fo:wrapper id="d0e1299"><!--
identity
,
JPA
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e1306"><!--
identity
,
numeric
--></fo:wrapper>
<fo:wrapper id="d0e1312"><!--
identity
,
qualitative
--></fo:wrapper>
<fo:wrapper id="d0e1318"><!--
numeric identity
--></fo:wrapper>
<fo:wrapper id="d0e1324"><!--
qualitative identity
--></fo:wrapper>
Java recognizes two forms of object identity: numeric identity and qualitative
identity. If two references are <fo:inline font-style="italic">numerically</fo:inline> identical, then
they refer to the same JVM instance in memory. You can test for this using the
<fo:inline font-family="monospace">==</fo:inline> operator. <fo:inline font-style="italic">Qualitative</fo:inline> identity, on
the other hand, relies on some user-defined criteria to determine whether two
objects are "equal". You test for qualitative identity using the <fo:inline font-family="monospace">
equals</fo:inline> method. By default, this method simply relies on numeric
identity.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA introduces another form of object identity, called <fo:inline font-style="italic">entity
identity</fo:inline> or <fo:inline font-style="italic">persistent identity</fo:inline>. Entity
identity tests whether two persistent objects represent the same state in the
datastore.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e1352"><!--
persistent fields
,
id
--></fo:wrapper>
<fo:wrapper id="d0e1358"><!--
id
,
fields
--></fo:wrapper>
The entity identity of each persistent instance is encapsulated in its
<fo:inline font-style="italic">identity field(s)</fo:inline>. If two entities of the same type have
the same identity field values, then the two entities represent the same state
in the datastore. Each entity's identity field values must be unique among all
other entites of the same type.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Identity fields must be primitives, primitive wrappers, <fo:inline font-family="monospace">
String</fo:inline>s, <fo:inline font-family="monospace">Date</fo:inline>s, <fo:inline font-family="monospace">
Timestamp</fo:inline>s, or embeddable types.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e1380"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA supports entities as identity fields, as the Reference Guide discusses
in <fo:basic-link internal-destination="ref_guide_pc_oid_entitypk"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.3.2, “
Entities as Identity Fields
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_oid_entitypk"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_oid_entitypk"/>]</fo:inline></fo:basic-link>. For legacy schemas with binary
primary key columns, OpenJPA also supports using identity fields of type
<fo:inline font-family="monospace">byte[]</fo:inline>. When you use a <fo:inline font-family="monospace">byte[]</fo:inline>
identity field, you must create an identity class. Identity classes are
covered below.
</fo:block></fo:block></fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e1391"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Warning</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Changing the fields of an embeddable instance while it is assigned to an
identity field has undefined results. Always treat embeddable identity instances
as immutable objects in your applications.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e1396"><!--
identity
,
uniqueness requirement
--></fo:wrapper>
<fo:wrapper id="d0e1402"><!--
uniquness requirement
--></fo:wrapper>
If you are dealing with a single persistence context (see
<fo:basic-link internal-destination="jpa_overview_emfactory_perscontext"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.3, “
Persistence Context
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_emfactory_perscontext"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_emfactory_perscontext"/>]</fo:inline></fo:basic-link>), then you do not
have to compare identity fields to test whether two entity references represent
the same state in the datastore. There is a much easier way: the <fo:inline font-family="monospace">==
</fo:inline> operator. JPA requires that each persistence context maintain only
one JVM object to represent each unique datastore record. Thus, entity identity
is equivalent to numeric identity within a persistence context. This is referred
to as the <fo:inline font-style="italic">uniqueness requirement</fo:inline>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The uniqueness requirement is extremely important - without it, it would be
impossible to maintain data integrity. Think of what could happen if two
different objects in the same transaction were allowed to represent the same
persistent data. If you made different modifications to each of these objects,
which set of changes should be written to the datastore? How would your
application logic handle seeing two different "versions" of the same data?
Thanks to the uniqueness requirement, these questions do not have to be
answered.
</fo:block><fo:block id="jpa_overview_pc_identitycls"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Identity Class
</fo:marker><fo:block font-size="17.28pt">4.2.1. 
Identity Class
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e1423"><!--
identity class
--></fo:wrapper>
<fo:wrapper id="d0e1429"><!--
identity
,
class requirements
--></fo:wrapper>
If your entity has only one identity field, you can use the value of that field
as the entity's identity object in all <fo:basic-link internal-destination="jpa_overview_em"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">
<fo:inline font-family="monospace">EntityManager</fo:inline></fo:inline></fo:basic-link> APIs. Otherwise, you must supply an
identity class to use for identity objects. Your identity class must meet the
following criteria:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e1440"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1441"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The class must be public.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1444"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The class must be serializable.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1447"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The class must have a public no-args constructor.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1450"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The names of the non-static fields or properties of the class must be the same
as the names of the identity fields or properties of the corresponding entity
class, and the types must be identical.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1453"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The <fo:inline font-family="monospace">equals</fo:inline> and <fo:inline font-family="monospace">hashCode</fo:inline>
methods of the class must use the values of all fields or properties
corresponding to identity fields or properties in the entity class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1462"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If the class is an inner class, it must be <fo:inline font-family="monospace">static</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1468"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
All entity classes related by inheritance must use the same identity class, or
else each entity class must have its own identity class whose inheritance
hierarchy mirrors the inheritance hierarchy of the owning entity classes (see
<fo:basic-link internal-destination="jpa_overview_pc_identity_hierarchy"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.2.1.1, “
Identity Hierarchies
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_pc_identity_hierarchy"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_pc_identity_hierarchy"/>]</fo:inline></fo:basic-link>).
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e1473"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Though you may still create identity classes by hand, OpenJPA provides the
<fo:inline font-family="monospace">appidtool</fo:inline> to automatically generate proper identity
classes based on your identity fields. See
<fo:basic-link internal-destination="ref_guide_pc_oid_application"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.3.3, “
Application Identity Tool
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_oid_application"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_oid_application"/>]</fo:inline></fo:basic-link> of the Reference Guide.
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_pc_identity_appidcode"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.2. 
Identity Class
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This example illustrates a proper identity class for an entity with multiple
identity fields.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e1486">
/**
* Persistent class using application identity.
*/
public class Magazine {
private String isbn; // identity field
private String title; // identity field
// rest of fields and methods omitted
/**
* Application identity class for Magazine.
*/
public static class MagazineId {
// each identity field in the Magazine class must have a
// corresponding field in the identity class
public String isbn;
public String title;
/**
* Equality must be implemented in terms of identity field
* equality, and must use instanceof rather than comparing
* classes directly (some JPA implementations may subclass the
* identity class).
*/
public boolean equals(Object other) {
if (other == this)
return true;
if (!(other instanceof MagazineId))
return false;
MagazineId mi = (MagazineId) other;
return (isbn == mi.isbn
|| (isbn != null &amp;&amp; isbn.equals(mi.isbn)))
&amp;&amp; (title == mi.title
|| (title != null &amp;&amp; title.equals(mi.title)));
}
/**
* Hashcode must also depend on identity values.
*/
public int hashCode() {
return ((isbn == null) ? 0 : isbn.hashCode())
^ ((title == null) ? 0 : title.hashCode());
}
public String toString() {
return isbn + ":" + title;
}
}
}
</fo:block></fo:block></fo:block><fo:block id="jpa_overview_pc_identity_hierarchy"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">4.2.1.1. 
Identity Hierarchies
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e1491"><!--
identity
,
hierarchy
--></fo:wrapper><fo:block id="d0e1496"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/appid-hierarchy.png" width="213px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
An alternative to having a single identity class for an entire inheritance
hierarchy is to have one identity class per level in the inheritance hierarchy.
The requirements for using a hierarchy of identity classes are as follows:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e1502"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1503"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The inheritance hierarchy of identity classes must exactly mirror the hierarchy
of the persistent classes that they identify. In the example pictured above,
abstract class <fo:inline font-family="monospace">Person</fo:inline> is extended by abstract class
<fo:inline font-family="monospace">Employee</fo:inline>, which is extended by non-abstract class
<fo:inline font-family="monospace"> FullTimeEmployee</fo:inline>, which is extended by non-abstract
class <fo:inline font-family="monospace">Manager</fo:inline>. The corresponding identity classes, then,
are an abstract <fo:inline font-family="monospace">PersonId</fo:inline> class, extended by an abstract
<fo:inline font-family="monospace">EmployeeId</fo:inline> class, extended by a non-abstract <fo:inline font-family="monospace">
FullTimeEmployeeId</fo:inline> class, extended by a non-abstract <fo:inline font-family="monospace">
ManagerId</fo:inline> class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1530"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Subclasses in the identity hierarchy may define additional identity fields until
the hierarchy becomes non-abstract. In the aforementioned example, <fo:inline font-family="monospace">
Person</fo:inline> defines an identity field <fo:inline font-family="monospace">ssn</fo:inline>, <fo:inline font-family="monospace">
Employee</fo:inline> defines additional identity field <fo:inline font-family="monospace">userName
</fo:inline>, and <fo:inline font-family="monospace">FullTimeEmployee</fo:inline> adds a final identity
field, <fo:inline font-family="monospace">empId</fo:inline>. However, <fo:inline font-family="monospace">Manager</fo:inline> may not
define any additional identity fields, since it is a subclass of a non-abstract
class. The hierarchy of identity classes, of course, must match the identity
field definitions of the persistent class hierarchy.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1554"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
It is not necessary for each abstract class to declare identity fields. In the
previous example, the abstract <fo:inline font-family="monospace">Person</fo:inline> and <fo:inline font-family="monospace">
Employee</fo:inline> classes could declare no identity fields, and the first
concrete subclass <fo:inline font-family="monospace">FullTimeEmployee</fo:inline> could define one or
more identity fields.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1566"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
All subclasses of a concrete identity class must be <fo:inline font-family="monospace">equals
</fo:inline> and <fo:inline font-family="monospace">hashCode</fo:inline>-compatible with the
concrete superclass. This means that in our example, a <fo:inline font-family="monospace">ManagerId
</fo:inline> instance and a <fo:inline font-family="monospace">FullTimeEmployeeId</fo:inline> instance
with the same identity field values should have the same hash code, and should
compare equal to each other using the <fo:inline font-family="monospace">equals</fo:inline> method of
either one. In practice, this requirement reduces to the following coding
practices:
</fo:block><fo:list-block provisional-label-separation="0.2em" provisional-distance-between-starts="1.2em" id="d0e1584"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1585"><fo:list-item-label end-indent="label-end()"><fo:block>1.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Use <fo:inline font-family="monospace">instanceof</fo:inline> instead of comparing <fo:inline font-family="monospace">Class
</fo:inline> objects in the <fo:inline font-family="monospace">equals</fo:inline> methods of your
identity classes.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1597"><fo:list-item-label end-indent="label-end()"><fo:block>2.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
An identity class that extends another non-abstract identity class should not
override <fo:inline font-family="monospace">equals</fo:inline> or <fo:inline font-family="monospace">hashCode</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_pc_callbacks"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Lifecycle Callbacks
</fo:marker><fo:block font-size="20.735999999999997pt">4.3. 
Lifecycle Callbacks
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e1609"><!--
lifecycle callbacks
--></fo:wrapper><fo:wrapper id="d0e1612"><!--
persistent classes
,
lifecycle callbacks
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
It is often necessary to perform various actions at different stages of a
persistent object's lifecycle. JPA includes a variety of callbacks methods for
monitoring changes in the lifecycle of your persistent objects. These callbacks
can be defined on the persistent classes themselves and on non-persistent
listener classes.
</fo:block><fo:block id="jpa_overview_pc_callbacks_methods"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Callback Methods
</fo:marker><fo:block font-size="17.28pt">4.3.1. 
Callback Methods
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e1624"><!--
lifecycle callbacks
,
callback methods
--></fo:wrapper><fo:wrapper id="d0e1629"><!--
entity
,
callback methods
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Every persistence event has a corresponding callback method marker. These
markers are shared between persistent classes and their listeners. You can use
these markers to designate a method for callback either by annotating that
method or by listing the method in the XML mapping file for a given class. The
lifecycle events and their corresponding method markers are:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e1636"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1637"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e1640"><!--
PrePersist
--></fo:wrapper>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api/javax/persistence/PrePersist.html">
<fo:inline font-family="monospace">PrePersist</fo:inline></fo:basic-link>: Methods marked with this annotation
will be invoked before an object is persisted. This could be used for assigning
primary key values to persistent objects. This is equivalent to the XML element
tag <fo:inline font-family="monospace">pre-persist</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1654"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e1657"><!--
PostPersist
--></fo:wrapper>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api/javax/persistence/PostPersist.html">
<fo:inline font-family="monospace">PostPersist</fo:inline></fo:basic-link>: Methods marked with this annotation
will be invoked after an object has transitioned to the persistent state. You
might want to use such methods to update a screen after a new row is added. This
is equivalent to the XML element tag <fo:inline font-family="monospace">post-persist</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1671"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e1674"><!--
PostLoad
--></fo:wrapper>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api/javax/persistence/PostLoad.html">
<fo:inline font-family="monospace">PostLoad</fo:inline></fo:basic-link>: Methods marked with this annotation
will be invoked after all eagerly fetched fields of your class have been loaded
from the datastore. No other persistent fields can be accessed in this method.
This is equivalent to the XML element tag <fo:inline font-family="monospace">post-load</fo:inline>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-family="monospace">PostLoad</fo:inline> is often used to initialize non-persistent
fields whose values depend on the values of persistent fields, such as a complex
datastructure.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1693"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e1696"><!--
PreUpdate
--></fo:wrapper>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api/javax/persistence/PreUpdate.html">
<fo:inline font-family="monospace">PreUpdate</fo:inline></fo:basic-link>: Methods marked with this annotation
will be invoked just the persistent values in your objects are flushed to the
datastore. This is equivalent to the XML element tag <fo:inline font-family="monospace">
pre-update</fo:inline>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-family="monospace">PreUpdate</fo:inline> is the complement to <fo:inline font-family="monospace">PostLoad
</fo:inline>. While methods marked with <fo:inline font-family="monospace">PostLoad</fo:inline> are most
often used to initialize non-persistent values from persistent data, methods
annotated with <fo:inline font-family="monospace">PreUpdate</fo:inline> is normally used to set
persistent fields with information cached in non-persistent data.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1724"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e1727"><!--
PostUpdate
--></fo:wrapper>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api/javax/persistence/PostUpdate.html">
<fo:inline font-family="monospace">PostUpdate</fo:inline></fo:basic-link>: Methods marked with this annotation
will be invoked after changes to a given instance have been stored to the
datastore. This is useful for clearing stale data cached at the application
layer. This is equivalent to the XML element tag <fo:inline font-family="monospace">post-update</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1741"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e1744"><!--
PreRemove
--></fo:wrapper>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api/javax/persistence/PreRemove.html">
<fo:inline font-family="monospace">PreRemove</fo:inline></fo:basic-link>: Methods marked with this annotation
will be invoked before an object transactions to the deleted state. Access to
persistent fields is valid within this method. You might use this method to
cascade the deletion to related objects based on complex criteria, or to perform
other cleanup. This is equivalent to the XML element tag <fo:inline font-family="monospace">
pre-remove</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1758"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e1761"><!--
PostRemove
--></fo:wrapper>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api/javax/persistence/PostRemove.html">
<fo:inline font-family="monospace">PostRemove</fo:inline></fo:basic-link>: Methods marked with this annotation
will be invoked after an object has been marked as to be deleted. This is
equivalent to the XML element tag <fo:inline font-family="monospace">post-remove</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="jpa_overview_callbacks_using"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Using Callback Methods
</fo:marker><fo:block font-size="17.28pt">4.3.2. 
Using Callback Methods
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When declaring callback methods on a persistent class, any method may be used
which takes no arguments and is not shared with any property access fields.
Multiple events can be assigned to a single method as well.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Below is an example of how to declare callback methods on persistent classes:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e1782">
/**
* Example persistent class declaring our entity listener.
*/
@Entity
public class Magazine {
@Transient
private byte[][] data;
@ManyToMany
private List&lt;Photo&gt; photos;
@PostLoad
public void convertPhotos() {
data = new byte[photos.size()][];
for (int i = 0; i &lt; photos.size(); i++)
data[i] = photos.get(i).toByteArray();
}
@PreDelete
public void logMagazineDeletion() {
getLog().debug("deleting magazine containing" + photos.size()
+ " photos.");
}
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In an XML mapping file, we can define the same methods without annotations:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e1786">
&lt;entity class="Magazine"&gt;
&lt;pre-remove&gt;logMagazineDeletion&lt;/pre-remove&gt;
&lt;post-load&gt;convertPhotos&lt;/post-load&gt;
&lt;/entity&gt;
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e1788"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
We fully explore persistence metadata annotations and XML in
<fo:basic-link internal-destination="jpa_overview_meta"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 5, <fo:inline font-style="italic">
Metadata
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_entity_listeners_using"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Using Entity Listeners
</fo:marker><fo:block font-size="17.28pt">4.3.3. 
Using Entity Listeners
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Mixing lifecycle event code into your persistent classes is not always ideal. It
is often more elegant to handle cross-cutting lifecycle events in a
non-persistent listener class. JPA allows for this, requiring only that listener
classes have a public no-arg constructor. Like persistent classes, your listener
classes can consume any number of callbacks. The callback methods must take in a
single <fo:inline font-family="monospace">java.lang.Object</fo:inline> argument which represents the
persistent object that triggered the event.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Entities can enumerate listeners using the <fo:inline font-family="monospace">EntityListeners
</fo:inline> annotation. This annotation takes an array of listener classes as
its value.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Below is an example of how to declare an entity and its corresponding listener
classes.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e1808">
/**
* Example persistent class declaring our entity listener.
*/
@Entity
@EntityListeners({ MagazineLogger.class, ... })
public class Magazine {
// ... //
}
/**
* Example entity listener.
*/
public class MagazineLogger {
@PostPersist
public void logAddition(Object pc) {
getLog ().debug ("Added new magazine:" + ((Magazine) pc).getTitle ());
}
@PreRemove
public void logDeletion(Object pc) {
getLog().debug("Removing from circulation:" +
((Magazine) pc).getTitle());
}
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In XML, we define both the listeners and their callback methods as so:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e1812">
&lt;entity class="Magazine"&gt;
&lt;entity-listeners&gt;
&lt;entity-listener class="MagazineLogger"&gt;
&lt;post-persist&gt;logAddition&lt;/post-persist&gt;
&lt;pre-remove&gt;logDeletion&lt;/pre-remove&gt;
&lt;/entity-listener&gt;
&lt;/entity-listeners&gt;
&lt;/entity&gt;
</fo:block></fo:block><fo:block id="jpa_overview_entity_listeners_exclude"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Entity Listeners Hierarchy
</fo:marker><fo:block font-size="17.28pt">4.3.4. 
Entity Listeners Hierarchy
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e1817"><!--
lifecycle listeners
,
hierarchy
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Entity listener methods are invoked in a specific order when a given event is
fired. So-called <fo:inline font-style="italic">default</fo:inline> listeners are invoked first: these
are listeners which have been defined in a package annotation or in the root
element of XML mapping files. Next, entity listeners are invoked in the order of
the inheritance hierarchy, with superclass listeners being invoked before
subclass listeners. Finally, if an entity has multiple listeners for the same
event, the listeners are invoked in declaration order.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can exclude default listeners and listeners defined in superclasses from the
invocation chain through the use of two class-level annotations:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e1829"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1830"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">ExcludeDefaultListeners</fo:inline>: This annotation indicates that
no default listeners will be invoked for this class, or any of its subclasses.
The XML equivalent is the empty <fo:inline font-family="monospace">exclude-default-listeners</fo:inline>
element.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1839"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">ExcludeSuperclassListeners</fo:inline>: This annotation will cause
OpenJPA to skip invoking any listeners declared in superclasses. The XML
equivalent is empty the <fo:inline font-family="monospace">exclude-superclass-listeners</fo:inline> element.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="jpa_overview_pc_conclusion"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Conclusions
</fo:marker><fo:block font-size="20.735999999999997pt">4.4. 
Conclusions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This chapter covered everything you need to know to write persistent class
definitions in JPA. JPA cannot use your persistent classes, however, until you
complete one additional step: you must define the persistence metadata. The next
chapter explores metadata in detail.
</fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Metadata
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Metadata
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="jpa_overview_meta"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 5. 
Metadata
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e1857"><!--
metadata
--></fo:wrapper><fo:wrapper id="d0e1860"><!--
JPA
,
metadata
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA requires that you accompany each persistent class with persistence metadata.
This metadata serves three primary purposes:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.2em" id="d0e1869"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1870"><fo:list-item-label end-indent="label-end()"><fo:block>1.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
To identify persistent classes.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1873"><fo:list-item-label end-indent="label-end()"><fo:block>2.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
To override default JPA behavior.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1876"><fo:list-item-label end-indent="label-end()"><fo:block>3.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
To provide the JPA implementation with information that it cannot glean from
simply reflecting on the persistent class.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e1881"><!--
annotations
--></fo:wrapper>
Persistence metadata is specified using either the Java 5 annotations defined in
the <fo:inline font-family="monospace">javax.persistence</fo:inline> package, XML mapping files, or a
mixture of both. In the latter case, XML declarations override conflicting
annotations. If you choose to use XML metadata, the XML files must be available
at development and runtime, and must be discoverable via either of two
strategies:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.2em" id="d0e1888"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1889"><fo:list-item-label end-indent="label-end()"><fo:block>1.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
In a resource named <fo:inline font-family="monospace">orm.xml</fo:inline> placed in a <fo:inline font-family="monospace">
META-INF</fo:inline> directory within a directory in your classpath or within a
jar archive containing your persistent classes.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1898"><fo:list-item-label end-indent="label-end()"><fo:block>2.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Declared in your <fo:basic-link internal-destination="jpa_overview_persistence_xml"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
persistence.xml</fo:inline></fo:inline></fo:basic-link> configuration file. In this case, each XML
metadata file must be listed in a <fo:inline font-family="monospace">mapping-file</fo:inline> element whose
content is either a path to the given file or a resource location available to
the class' class loader.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
We describe the standard metadata annotations and XML equivalents throughout
this chapter. The full schema for XML mapping files is available in
<fo:basic-link internal-destination="jpa_overview_meta_xml"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.3, “
XML Schema
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_xml"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_xml"/>]</fo:inline></fo:basic-link>. JPA also standardizes relational
mapping metadata and named query metadata, which we discuss in
<fo:basic-link internal-destination="jpa_overview_mapping"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 12, <fo:inline font-style="italic">
Mapping Metadata
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping"/>]</fo:inline></fo:basic-link> and
<fo:basic-link internal-destination="jpa_overview_query_named"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.1.10, “
Named Queries
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_query_named"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_query_named"/>]</fo:inline></fo:basic-link> respectively.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e1916"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA defines many useful annotations beyond the standard set. See
<fo:basic-link internal-destination="ref_guide_meta_jpa"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 6.2, “
Additional JPA Metadata
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_meta_jpa"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_meta_jpa"/>]</fo:inline></fo:basic-link> and
<fo:basic-link internal-destination="ref_guide_meta_ext"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 6.3, “
Metadata Extensions
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_meta_ext"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_meta_ext"/>]</fo:inline></fo:basic-link>
in the Reference Guide for details. There are currently no XML equivalents for
these extension annotations.
</fo:block></fo:block></fo:block><fo:block id="d0e1923"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/jpa-meta-model.png" width="369px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Through the course of this chapter, we will create the persistent object model
above.
</fo:block><fo:block id="jpa_overview_meta_class"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Class Metadata
</fo:marker><fo:block font-size="20.735999999999997pt">5.1. 
Class Metadata
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following metadata annotations and XML elements apply to persistent class
declarations.
</fo:block><fo:block id="jpa_overview_meta_entity"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Entity
</fo:marker><fo:block font-size="17.28pt">5.1.1. 
Entity
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e1937"><!--
Entity
,
annotation
--></fo:wrapper><fo:wrapper id="d0e1942"><!--
metadata
,
Entity
--></fo:wrapper><fo:wrapper id="d0e1947"><!--
annotations
,
Entity
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">Entity</fo:inline> annotation denotes an entity class. All entity
classes must have this annotation. The <fo:inline font-family="monospace">Entity</fo:inline> annotation
takes one optional property:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e1960"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1961"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String name</fo:inline>: Name used to refer to the entity in queries.
Must not be a reserved literal in JPQL. Defaults to the unqualified name of the
entity class.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">entity</fo:inline>. It has the following
attributes:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e1972"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1973"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">class</fo:inline>: The entity class. This attribute is required.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1979"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>: Named used to refer to the class in queries. See the
name property above.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e1985"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">access</fo:inline>: The access type to use for the class. Must either be
<fo:inline font-family="monospace">FIELD</fo:inline> or <fo:inline font-family="monospace">PROPERTY</fo:inline>. For details on access
types, see <fo:basic-link internal-destination="jpa_overview_meta_field"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2, “
Field and Property Metadata
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_field"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_field"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e1999"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA uses a process called <fo:inline font-style="italic">enhancement</fo:inline> to modify the
bytecode of entities for transparent lazy loading and immediate dirty tracking.
See <fo:basic-link internal-destination="ref_guide_pc_enhance"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2, “
Enhancement
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_enhance"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_enhance"/>]</fo:inline></fo:basic-link> in the Reference Guide for
details on enhancement.
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_meta_idclass"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Id Class
</fo:marker><fo:block font-size="17.28pt">5.1.2. 
Id Class
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e2010"><!--
IdClass
--></fo:wrapper><fo:wrapper id="d0e2013"><!--
metadata
,
IdClass
--></fo:wrapper><fo:wrapper id="d0e2018"><!--
annotations
,
IdClass
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
As we discussed in <fo:basic-link internal-destination="jpa_overview_pc_identitycls"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.2.1, “
Identity Class
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_pc_identitycls"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_pc_identitycls"/>]</fo:inline></fo:basic-link>,
entities with multiple identity fields must use an <fo:inline font-style="italic"> identity class
</fo:inline> to encapsulate their persistent identity. The <fo:inline font-family="monospace">IdClass
</fo:inline> annotation specifies this class. It accepts a single <fo:inline font-family="monospace">
java.lang.Class</fo:inline> value.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">id-class</fo:inline>, which has a single
attribute:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e2041"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2042"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">class</fo:inline>: Set this required attribute to the name of the
identity class.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="jpa_overview_meta_embeddablesuper"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Mapped Superclass
</fo:marker><fo:block font-size="17.28pt">5.1.3. 
Mapped Superclass
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e2051"><!--
MappedSuperclass
--></fo:wrapper><fo:wrapper id="d0e2054"><!--
metadata
,
MappedSuperclass
--></fo:wrapper><fo:wrapper id="d0e2059"><!--
annotations
,
MappedSuperclass
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A <fo:inline font-style="italic">mapped superclass</fo:inline> is a non-entity class that can define
persistent state and mapping information for entity subclasses. Mapped
superclasses are usually abstract. Unlike true entities, you cannot query a
mapped superclass, pass a mapped superclass instance to any <fo:inline font-family="monospace">
EntityManager</fo:inline> or <fo:inline font-family="monospace">Query</fo:inline> methods, or declare a
persistent relation with a mapped superclass target. You denote a mapped
superclass with the <fo:inline font-family="monospace">MappedSuperclass</fo:inline> marker annotation.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">mapped-superclass</fo:inline>. It expects
the following attributes:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e2083"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2084"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">class</fo:inline>: The entity class. This attribute is required.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2090"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">access</fo:inline>: The access type to use for the class. Must either be
<fo:inline font-family="monospace">FIELD</fo:inline> or <fo:inline font-family="monospace">PROPERTY</fo:inline>. For details on access
types, see <fo:basic-link internal-destination="jpa_overview_meta_field"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2, “
Field and Property Metadata
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_field"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_field"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e2104"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA allows you to query on mapped superclasses. A query on a mapped
superclass will return all matching subclass instances. OpenJPA also allows you
to declare relations to mapped superclass types; however, you cannot query
across these relations.
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_meta_embeddable"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Embeddable
</fo:marker><fo:block font-size="17.28pt">5.1.4. 
Embeddable
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e2110"><!--
Embeddable
--></fo:wrapper><fo:wrapper id="d0e2113"><!--
metadata
,
Embeddable
--></fo:wrapper><fo:wrapper id="d0e2118"><!--
annotations
,
Embeddable
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">Embeddable</fo:inline> annotation designates an embeddable
persistent class. Embeddable instances are stored as part of the record of their
owning instance. All embeddable classes must have this annotation.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A persistent class can either be an entity or an embeddable class, but not both.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">embeddable</fo:inline>. It understands the
following attributes:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e2135"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2136"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">class</fo:inline>: The entity class. This attribute is required.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2142"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">access</fo:inline>: The access type to use for the class. Must either be
<fo:inline font-family="monospace">FIELD</fo:inline> or <fo:inline font-family="monospace">PROPERTY</fo:inline>. For details on access
types, see <fo:basic-link internal-destination="jpa_overview_meta_field"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2, “
Field and Property Metadata
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_field"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_field"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e2156"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA allows a persistent class to be both an entity and an embeddable class.
Instances of the class will act as entites when persisted explicitly or assigned
to non-embedded fields of entities. Instances will act as embedded values when
assigned to embedded fields of entities.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To signal that a class is both an entity and an embeddable class in OpenJPA,
simply add both the <fo:inline font-family="monospace">@Entity</fo:inline> and the <fo:inline font-family="monospace">@Embeddable
</fo:inline> annotations to the class.
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_meta_entity_listeners"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
EntityListeners
</fo:marker><fo:block font-size="17.28pt">5.1.5. 
EntityListeners
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e2170"><!--
EntityListeners
--></fo:wrapper><fo:wrapper id="d0e2173"><!--
entity-listeners
--></fo:wrapper><fo:wrapper id="d0e2176"><!--
metadata
,
EntityListeners
--></fo:wrapper><fo:wrapper id="d0e2181"><!--
annotations
,
EntityListeners
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
An entity may list its lifecycle event listeners in the <fo:inline font-family="monospace">
EntityListeners</fo:inline> annotation. This value of this annotation is an
array of the listener <fo:inline font-family="monospace">Class</fo:inline> es for the entity. The
equivalent XML element is <fo:inline font-family="monospace">entity-listeners</fo:inline>. For more details
on entity listeners, see <fo:basic-link internal-destination="jpa_overview_pc_callbacks"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.3, “
Lifecycle Callbacks
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_pc_callbacks"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_pc_callbacks"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block><fo:block id="jpa_overview_meta_classex"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Example
</fo:marker><fo:block font-size="17.28pt">5.1.6. 
Example
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Here are the class declarations for our persistent object model, annotated with
the appropriate persistence metadata. Note that <fo:inline font-family="monospace">Magazine</fo:inline>
declares an identity class, and that <fo:inline font-family="monospace">Document</fo:inline> and
<fo:inline font-family="monospace">Address</fo:inline> are a mapped superclass and an embeddable class,
respectively. <fo:inline font-family="monospace">LifetimeSubscription</fo:inline> and <fo:inline font-family="monospace">
TrialSubscription</fo:inline> override the default entity name to supply a
shorter alias for use in queries.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_meta_classlisting"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.1. 
Class Metadata
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e2222">
package org.mag;
@Entity
@IdClass(Magazine.MagazineId.class)
public class Magazine {
...
public static class MagazineId {
...
}
}
@Entity
public class Article {
...
}
package org.mag.pub;
@Entity
public class Company {
...
}
@Entity
public class Author {
...
}
@Embeddable
public class Address {
...
}
package org.mag.subscribe;
@MappedSuperclass
public abstract class Document {
...
}
@Entity
public class Contract
extends Document {
...
}
@Entity
public class Subscription {
...
@Entity
public static class LineItem
extends Contract {
...
}
}
@Entity(name="Lifetime")
public class LifetimeSubscription
extends Subscription {
...
}
@Entity(name="Trial")
public class TrialSubscription
extends Subscription {
...
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent declarations in XML:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e2226">
&lt;entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
version="1.0"&gt;
&lt;mapped-superclass class="org.mag.subscribe.Document"&gt;
...
&lt;/mapped-superclass&gt;
&lt;entity class="org.mag.Magazine"&gt;
&lt;id-class class="org.mag.Magazine$MagazineId"/&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.Article"&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.pub.Company"&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.pub.Author"&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.Contract"&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.LineItem"&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.LifetimeSubscription" name="Lifetime"&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.TrialSubscription" name="Trial"&gt;
...
&lt;/entity&gt;
&lt;embeddable class="org.mag.pub.Address"&gt;
...
&lt;/embeddable&gt;
&lt;/entity-mappings&gt;
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_meta_field"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Field and Property Metadata
</fo:marker><fo:block font-size="20.735999999999997pt">5.2. 
Field and Property Metadata
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The persistence implementation must be able to retrieve and set the persistent
state of your entities, mapped superclasses, and embeddable types. JPA offers
two modes of persistent state access: <fo:inline font-style="italic">field access</fo:inline>, and
<fo:inline font-style="italic">property access</fo:inline>. Under field access, the implementation
injects state directly into your persistent fields, and retrieves changed state
from your fields as well. To declare field access on an entity with XML
metadata, set the <fo:inline font-family="monospace">access</fo:inline> attribute of your <fo:inline font-family="monospace">entity
</fo:inline> XML element to <fo:inline font-family="monospace">FIELD</fo:inline>. To use field access for an
entity using annotation metadata, simply place your metadata and mapping
annotations on your field declarations:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e2248">
@ManyToOne
private Company publisher;
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e2252"><!--
metadata
,
property access
--></fo:wrapper>
<fo:wrapper id="d0e2258"><!--
persistent classes
,
property access
--></fo:wrapper>
<fo:wrapper id="d0e2264"><!--
persistent properties
--></fo:wrapper>
Property access, on the other hand, retrieves and loads state through JavaBean
"getter" and "setter" methods. For a property <fo:inline font-family="monospace">p</fo:inline> of type
<fo:inline font-family="monospace">T</fo:inline>, you must define the following getter method:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e2276">
T getP();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
For boolean properties, this is also acceptable:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e2280">
boolean isP();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You must also define the following setter method:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e2284">
void setP(T value);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To use property access, set your <fo:inline font-family="monospace">entity</fo:inline> element's <fo:inline font-family="monospace">
access</fo:inline> attribute to <fo:inline font-family="monospace">PROPERTY</fo:inline>, or place your
metadata and mapping annotations on the getter method:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e2297">
@ManyToOne
private Company getPublisher() { ... }
private void setPublisher(Company publisher) { ... }
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e2299"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Warning</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When using property access, only the getter and setter method for a property
should ever access the underlying persistent field directly. Other methods,
including internal business methods in the persistent class, should go through
the getter and setter methods when manipulating persistent state.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Also, take care when adding business logic to your getter and setter methods.
Consider that they are invoked by the persistence implementation to load and
retrieve all persistent state; other side effects might not be desirable.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Each class must use either field access or property access for all state; you
cannot use both access types within the same class. Additionally, a subclass
must use the same access type as its superclass.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The remainder of this document uses the term "persistent field" to refer to
either a persistent field or a persistent property.
</fo:block><fo:block id="jpa_overview_meta_transient"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Transient
</fo:marker><fo:block font-size="17.28pt">5.2.1. 
Transient
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e2311"><!--
Transient
--></fo:wrapper><fo:wrapper id="d0e2314"><!--
metadata
,
Transient
--></fo:wrapper><fo:wrapper id="d0e2319"><!--
annotations
,
Transient
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">Transient</fo:inline> annotation specifies that a field is
non-persistent. Use it to exclude fields from management that would otherwise be
persistent. <fo:inline font-family="monospace">Transient</fo:inline> is a marker annotation only; it
has no properties.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">transient</fo:inline>. It has a single
attribute:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e2337"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2338"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>: The transient field or property name. This attribute
is required.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="jpa_overview_meta_id"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Id
</fo:marker><fo:block font-size="17.28pt">5.2.2. 
Id
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e2347"><!--
Id
--></fo:wrapper><fo:wrapper id="d0e2350"><!--
metadata
,
Id
--></fo:wrapper><fo:wrapper id="d0e2355"><!--
annotations
,
Id
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Annotate your simple identity fields with <fo:inline font-family="monospace">Id</fo:inline>. This
annotation has no properties. We explore entity identity and identity fields in
<fo:basic-link internal-destination="jpa_overview_pc_id"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.1.3, “
Identity Fields
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_pc_id"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_pc_id"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">id</fo:inline>. It has one required
attribute:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e2372"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2373"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>: The name of the identity field or property.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="jpa_overview_meta_gen"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Generated Value
</fo:marker><fo:block font-size="17.28pt">5.2.3. 
Generated Value
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e2382"><!--
GeneratedValue
--></fo:wrapper><fo:wrapper id="d0e2385"><!--
metadata
,
GeneratedValue
--></fo:wrapper><fo:wrapper id="d0e2390"><!--
annotations
,
GeneratedValue
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The previous section showed you how to declare your identity fields with the
<fo:inline font-family="monospace">Id</fo:inline> annotation. It is often convenient to allow the
persistence implementation to assign a unique value to your identity fields
automatically. JPA includes the the <fo:inline font-family="monospace">GeneratedValue</fo:inline>
annotation for this purpose. It has the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e2403"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2404"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">GenerationType strategy</fo:inline>: Enum value specifying how to
auto-generate the field value. The <fo:inline font-family="monospace">GenerationType</fo:inline> enum
has the following values:
</fo:block><fo:list-block provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e2413"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2414"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">GeneratorType.AUTO</fo:inline>: The default. Assign the field a
generated value, leaving the details to the JPA vendor.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2420"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">GenerationType.IDENTITY</fo:inline>: The database will assign an
identity value on insert.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2426"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">GenerationType.SEQUENCE</fo:inline>: Use a datastore sequence to
generate a field value.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2432"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">GenerationType.TABLE</fo:inline>: Use a sequence table to generate a
field value.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2438"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String generator</fo:inline>: The name of a generator defined in mapping
metadata. We show you how to define named generators in
<fo:basic-link internal-destination="jpa_overview_mapping_sequence"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.5, “
Generators
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_sequence"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_sequence"/>]</fo:inline></fo:basic-link>. If the <fo:inline font-family="monospace">
GenerationType</fo:inline> is set but this property is unset, the JPA
implementation uses appropriate defaults for the selected generation type.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">generated-value</fo:inline>, which
includes the following attributes:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e2454"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2455"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">strategy</fo:inline>: One of <fo:inline font-family="monospace"> TABLE</fo:inline>, <fo:inline font-family="monospace">
SEQUENCE</fo:inline>, <fo:inline font-family="monospace"> IDENTITY</fo:inline>, or <fo:inline font-family="monospace">AUTO</fo:inline>,
defaulting to <fo:inline font-family="monospace">AUTO</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2476"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">generator</fo:inline>: Equivalent to the generator property listed
above.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e2482"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA allows you to use the <fo:inline font-family="monospace">GeneratedValue</fo:inline> annotation
on any field, not just identity fields. Before using the <fo:inline font-family="monospace">IDENTITY
</fo:inline> generation strategy, however, read
<fo:basic-link internal-destination="ref_guide_pc_oid_pkgen_autoinc"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.3.4, “
Autoassign / Identity Strategy Caveats
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_oid_pkgen_autoinc"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_oid_pkgen_autoinc"/>]</fo:inline></fo:basic-link> in the Reference Guide.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA also offers two additional generator strategies for non-numeric fields,
which you can access by setting <fo:inline font-family="monospace">strategy</fo:inline> to <fo:inline font-family="monospace">AUTO
</fo:inline> (the default), and setting the <fo:inline font-family="monospace">generator</fo:inline> string
to:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e2504"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2505"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e2508"><!--
mapping metadata
,
uuid-string
--></fo:wrapper>
<fo:wrapper id="d0e2514"><!--
uuid-string
--></fo:wrapper>
<fo:inline font-family="monospace">uuid-string</fo:inline>: OpenJPA will generate a 128-bit UUID unique
within the network, represented as a 16-character string. For more information
on UUIDs, see the IETF UUID draft specification at:
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://www1.ics.uci.edu/~ejw/authoring/uuid-guid/">
http://www1.ics.uci.edu/~ejw/authoring/uuid-guid/</fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2524"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e2527"><!--
mapping metadata
,
uuid-hex
--></fo:wrapper>
<fo:wrapper id="d0e2533"><!--
uuid-hex
--></fo:wrapper>
<fo:inline font-family="monospace">uuid-hex</fo:inline>: Same as <fo:inline font-family="monospace"> uuid-string</fo:inline>, but
represents the UUID as a 32-character hexadecimal string.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
These string constants are defined in
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/Generator.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.Generator</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_meta_embedid"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Embedded Id
</fo:marker><fo:block font-size="17.28pt">5.2.4. 
Embedded Id
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e2553"><!--
EmbeddedId
--></fo:wrapper><fo:wrapper id="d0e2556"><!--
metadata
,
EmbeddedId
--></fo:wrapper><fo:wrapper id="d0e2561"><!--
annotations
,
EmbeddedId
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If your entity has multiple identity values, you may declare multiple <fo:inline font-family="monospace">
@Id</fo:inline> fields, or you may declare a single <fo:inline font-family="monospace">@EmbeddedId</fo:inline>
field. The type of a field annotated with <fo:inline font-family="monospace">EmbeddedId</fo:inline> must
be an embeddable entity class. The fields of this embeddable class are
considered the identity values of the owning entity. We explore entity identity
and identity fields in <fo:basic-link internal-destination="jpa_overview_pc_id"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.1.3, “
Identity Fields
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_pc_id"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_pc_id"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">EmbeddedId</fo:inline> annotation has no properties.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">embedded-id</fo:inline>. It has one
required attribute:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e2589"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2590"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>: The name of the identity field or property.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="jpa_overview_meta_version"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Version
</fo:marker><fo:block font-size="17.28pt">5.2.5. 
Version
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e2599"><!--
Version
--></fo:wrapper><fo:wrapper id="d0e2602"><!--
metadata
,
Version
--></fo:wrapper><fo:wrapper id="d0e2607"><!--
annotations
,
Version
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Use the <fo:inline font-family="monospace">Version</fo:inline> annotation to designate a version field.
<fo:basic-link internal-destination="jpa_overview_pc_version"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.1.4, “
Version Field
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_pc_version"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_pc_version"/>]</fo:inline></fo:basic-link> explained the importance of
version fields to JPA. This is a marker annotation; it has no properties.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">version</fo:inline>, which has a single
attribute:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e2624"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2625"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>: The name of the version field or property. This
attribute is required.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="jpa_overview_meta_basic"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Basic
</fo:marker><fo:block font-size="17.28pt">5.2.6. 
Basic
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e2634"><!--
Basic
--></fo:wrapper><fo:wrapper id="d0e2637"><!--
metadata
,
Basic
--></fo:wrapper><fo:wrapper id="d0e2642"><!--
annotations
,
Basic
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-family="monospace">Basic</fo:inline> signifies a standard value persisted as-is to the
datastore. You can use the <fo:inline font-family="monospace">Basic</fo:inline> annotation on persistent
fields of the following types: primitives, primitive wrappers, <fo:inline font-family="monospace">
java.lang.String</fo:inline>, <fo:inline font-family="monospace">byte[]</fo:inline>, <fo:inline font-family="monospace">
Byte[]</fo:inline>, <fo:inline font-family="monospace">char[]</fo:inline>, <fo:inline font-family="monospace">
Character[]</fo:inline>, <fo:inline font-family="monospace">java.math.BigDecimal</fo:inline>,
<fo:inline font-family="monospace">java.math.BigInteger</fo:inline>, <fo:inline font-family="monospace">
java.util.Date</fo:inline>, <fo:inline font-family="monospace">java.util.Calendar</fo:inline>,
<fo:inline font-family="monospace">java.sql.Date</fo:inline>, <fo:inline font-family="monospace">java.sql.Timestamp</fo:inline>,
<fo:inline font-family="monospace">Enum</fo:inline>s, and <fo:inline font-family="monospace">Serializable</fo:inline> types.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-family="monospace">Basic</fo:inline> declares these properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e2699"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2700"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">FetchType fetch</fo:inline>: Whether to load the field eagerly
(<fo:inline font-family="monospace">FetchType.EAGER</fo:inline>) or lazily (<fo:inline font-family="monospace">
FetchType.LAZY</fo:inline>). Defaults to <fo:inline font-family="monospace">FetchType.EAGER</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2715"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean optional</fo:inline>: Whether the datastore allows null values.
Defaults to true.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">basic</fo:inline>. It has the following
attributes:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e2726"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2727"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>: The name of the field or property. This attribute is
required.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2733"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">fetch</fo:inline>: One of <fo:inline font-family="monospace">EAGER</fo:inline> or <fo:inline font-family="monospace">LAZY
</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2745"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">optional</fo:inline>: Boolean indicating whether the field value may be
null.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block id="jpa_overview_meta_fetch"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">5.2.6.1. 
Fetch Type
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e2754"><!--
eager fetching
,
FetchType
--></fo:wrapper><fo:wrapper id="d0e2759"><!--
FetchType
--></fo:wrapper><fo:wrapper id="d0e2764"><!--
metadata
,
FetchType
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Many metadata annotations in JPA have a <fo:inline font-family="monospace">fetch</fo:inline> property. This
property can take on one of two values: <fo:inline font-family="monospace">FetchType.EAGER</fo:inline> or
<fo:inline font-family="monospace">FetchType.LAZY</fo:inline>. <fo:inline font-family="monospace">FetchType.EAGER</fo:inline> means that
the field is loaded by the JPA implementation before it returns the persistent
object to you. Whenever you retrieve an entity from a query or from the
<fo:inline font-family="monospace">EntityManager</fo:inline>, you are guaranteed that all of its eager
fields are populated with datastore data.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-family="monospace">FetchType.LAZY</fo:inline> is a hint to the JPA runtime that you want to
defer loading of the field until you access it. This is called <fo:inline font-style="italic">lazy
loading</fo:inline>. Lazy loading is completely transparent; when you attempt to
read the field for the first time, the JPA runtime will load the value from the
datastore and populate the field automatically. Lazy loading is only a hint and
not a directive because some JPA implementations cannot lazy-load certain field
types.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
With a mix of eager and lazily-loaded fields, you can ensure that commonly-used
fields load efficiently, and that other state loads transparently when accessed.
As you will see in <fo:basic-link internal-destination="jpa_overview_emfactory_perscontext"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.3, “
Persistence Context
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_emfactory_perscontext"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_emfactory_perscontext"/>]</fo:inline></fo:basic-link>,
you can also use eager fetching to ensure that entites have all needed data
loaded before they become <fo:inline font-style="italic">detached</fo:inline> at the end of a
persistence context.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e2801"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA can lazy-load any field type. OpenJPA also allows you to dynamically
change which fields are eagerly or lazily loaded at runtime. See
<fo:basic-link internal-destination="ref_guide_fetch"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.6, “
Fetch Groups
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_fetch"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_fetch"/>]</fo:inline></fo:basic-link> in the Reference Guide for details.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The Reference Guide details OpenJPA's eager fetching behavior in
<fo:basic-link internal-destination="ref_guide_perfpack_eager"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.7, “
Eager Fetching
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_perfpack_eager"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_perfpack_eager"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_meta_embedded"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Embedded
</fo:marker><fo:block font-size="17.28pt">5.2.7. 
Embedded
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e2813"><!--
Embedded
--></fo:wrapper><fo:wrapper id="d0e2816"><!--
metadata
,
Embedded
--></fo:wrapper><fo:wrapper id="d0e2821"><!--
annotations
,
Embedded
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Use the <fo:inline font-family="monospace">Embedded</fo:inline> marker annotation on embeddable field
types. Embedded fields are mapped as part of the datastore record of the
declaring entity. In our sample model, <fo:inline font-family="monospace">Author</fo:inline> and
<fo:inline font-family="monospace">Company</fo:inline> each embed their <fo:inline font-family="monospace">Address</fo:inline>,
rather than forming a relation to an <fo:inline font-family="monospace">Address</fo:inline> as a
separate entity.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">embedded</fo:inline>, which expects a
single attribute:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e2848"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2849"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>: The name of the field or property. This attribute is
required.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="jpa_overview_meta_manytoone"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Many To One
</fo:marker><fo:block font-size="17.28pt">5.2.8. 
Many To One
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e2858"><!--
ManyToOne
--></fo:wrapper><fo:wrapper id="d0e2861"><!--
metadata
,
ManyToOne
--></fo:wrapper><fo:wrapper id="d0e2866"><!--
annotations
,
ManyToOne
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When an entity <fo:inline font-family="monospace">A</fo:inline> references a single entity <fo:inline font-family="monospace">
B</fo:inline>, and other <fo:inline font-family="monospace">A</fo:inline>s might also reference the same
<fo:inline font-family="monospace">B</fo:inline>, we say there is a <fo:inline font-style="italic">many to one</fo:inline>
relation from <fo:inline font-family="monospace">A</fo:inline> to <fo:inline font-family="monospace">B</fo:inline>. In our sample
model, for example, each magazine has a reference to its publisher. Multiple
magazines might have the same publisher. We say, then, that the <fo:inline font-family="monospace">
Magazine.publisher</fo:inline> field is a many to one relation from magazines to
publishers.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA indicates many to one relations between entities with the <fo:inline font-family="monospace">
ManyToOne</fo:inline> annotation. This annotation has the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e2902"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2903"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Class targetEntity</fo:inline>: The class of the related entity type.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2909"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">CascadeType[] cascade</fo:inline>: Array of enum values defining cascade
behavior for this field. We explore cascades below. Defaults to an empty array.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2915"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">FetchType fetch</fo:inline>: Whether to load the field eagerly
(<fo:inline font-family="monospace">FetchType.EAGER</fo:inline>) or lazily
(<fo:inline font-family="monospace">FetchType.LAZY</fo:inline>). Defaults to <fo:inline font-family="monospace">
FetchType.EAGER</fo:inline>. See <fo:basic-link internal-destination="jpa_overview_meta_fetch"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.6.1, “
Fetch Type
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_fetch"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_fetch"/>]</fo:inline></fo:basic-link> above
for details on fetch types.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2932"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean optional</fo:inline>: Whether the related object must exist. If
<fo:inline font-family="monospace">false</fo:inline>, this field cannot be null. Defaults to <fo:inline font-family="monospace">
true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">many-to-one</fo:inline>. It accepts the
following attributes:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e2949"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2950"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>: The name of the field or property. This attribute is
required.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2956"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">target-entity</fo:inline>: The class of the related type.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2962"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">fetch</fo:inline>: One of <fo:inline font-family="monospace">EAGER</fo:inline> or <fo:inline font-family="monospace">
LAZY</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e2974"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">optional</fo:inline>: Boolean indicating whether the field value may be
null.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block id="jpa_overview_meta_cascade"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">5.2.8.1. 
Cascade Type
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e2983"><!--
CascadeType
--></fo:wrapper><fo:wrapper id="d0e2986"><!--
metadata
,
CascadeType
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
We introduce the JPA <fo:inline font-family="monospace">EntityManager</fo:inline> in
<fo:basic-link internal-destination="jpa_overview_em"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 8, <fo:inline font-style="italic">
EntityManager
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_em"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_em"/>]</fo:inline></fo:basic-link>. The <fo:inline font-family="monospace">EntityManager
</fo:inline> has APIs to persist new entities, remove (delete) existing
entities, refresh entity state from the datastore, and merge <fo:inline font-style="italic">detached
</fo:inline> entity state back into the persistence context. We explore all of
these APIs in detail later in the overview.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When the <fo:inline font-family="monospace">EntityManager</fo:inline> is performing the above
operations, you can instruct it to automatically cascade the operation to the
entities held in a persistent field with the <fo:inline font-family="monospace">cascade</fo:inline> property
of your metadata annotation. This process is recursive. The <fo:inline font-family="monospace">cascade
</fo:inline> property accepts an array of <fo:inline font-family="monospace">CascadeType</fo:inline> enum
values.
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e3018"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3019"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">CascadeType.PERSIST</fo:inline>: When persisting an entity, also persist
the entities held in this field. We suggest liberal application of this cascade
rule, because if the <fo:inline font-family="monospace">EntityManager</fo:inline> finds a field that
references a new entity during flush, and the field does not use <fo:inline font-family="monospace">
CascadeType.PERSIST</fo:inline>, it is an error.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3031"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">CascadeType.REMOVE</fo:inline>: When deleting an entity, also delete the
entities held in this field.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3037"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">CascadeType.REFRESH</fo:inline>: When refreshing an entity, also refresh
the entities held in this field.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3043"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">CascadeType.MERGE</fo:inline>: When merging entity state, also merge the
entities held in this field.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e3049"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA offers enhancements to JPA's CascadeType.REMOVE functionality,
including additional annotations to control how and when dependent fields will
be removed. See <fo:basic-link internal-destination="dependent"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 6.3.2.1, “
Dependent
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="dependent"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="dependent"/>]</fo:inline></fo:basic-link> for more details.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-family="monospace">CascadeType</fo:inline> defines one additional value, <fo:inline font-family="monospace">
CascadeType.ALL</fo:inline>, that acts as a shortcut for all of the values above.
The following annotations are equivalent:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e3062">
@ManyToOne(cascade={CascadeType.PERSIST,CascadeType.REMOVE,
CascadeType.REFRESH,CascadeType.MERGE})
private Company publisher;
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e3064">
@ManyToOne(cascade=CascadeType.ALL)
private Company publisher;
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In XML, these enumeration constants are available as child elements of the
<fo:inline font-family="monospace">cascade</fo:inline> element. The <fo:inline font-family="monospace">cascade</fo:inline> element is
itself a child of <fo:inline font-family="monospace">many-to-one</fo:inline>. The following examples are
equivalent:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e3077">
&lt;many-to-one name="publisher"&gt;
&lt;cascade&gt;
&lt;cascade-persist/&gt;
&lt;cascade-merge/&gt;
&lt;cascade-remove/&gt;
&lt;cascade-refresh/&gt;
&lt;/cascade&gt;
&lt;/many-to-one&gt;
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e3079">
&lt;many-to-one name="publisher"&gt;
&lt;cascade&gt;
&lt;cascade-all/&gt;
&lt;/cascade&gt;
&lt;/many-to-one&gt;
</fo:block></fo:block></fo:block><fo:block id="jpa_overview_meta_onetomany"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
One To Many
</fo:marker><fo:block font-size="17.28pt">5.2.9. 
One To Many
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e3084"><!--
OneToMany
--></fo:wrapper><fo:wrapper id="d0e3087"><!--
metadata
,
OneToMany
--></fo:wrapper><fo:wrapper id="d0e3092"><!--
annotations
,
OneToMany
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When an entity <fo:inline font-family="monospace">A</fo:inline> references multiple <fo:inline font-family="monospace">B</fo:inline>
entities, and no two <fo:inline font-family="monospace">A</fo:inline>s reference the same <fo:inline font-family="monospace">
B</fo:inline>, we say there is a <fo:inline font-style="italic">one to many</fo:inline> relation from
<fo:inline font-family="monospace">A</fo:inline> to <fo:inline font-family="monospace">B</fo:inline>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
One to many relations are the exact inverse of the many to one relations we
detailed in the preceding section. In that section, we said that the <fo:inline font-family="monospace">
Magazine.publisher</fo:inline> field is a many to one relation from magazines to
publishers. Now, we see that the <fo:inline font-family="monospace">Company.mags</fo:inline> field is the
inverse - a one to many relation from publishers to magazines. Each company may
publish multiple magazines, but each magazine can have only one publisher.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA indicates one to many relations between entities with the <fo:inline font-family="monospace">
OneToMany</fo:inline> annotation. This annotation has the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e3133"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3134"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Class targetEntity</fo:inline>: The class of the related entity type.
This information is usually taken from the parameterized collection or map
element type. You must supply it explicitly, however, if your field isn't a
parameterized type.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3140"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String mappedBy</fo:inline>: Names the many to one field in the related
entity that maps this bidirectional relation. We explain bidirectional relations
below. Leaving this property unset signals that this is a standard
unidirectional relation.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3146"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">CascadeType[] cascade</fo:inline>: Array of enum values defining cascade
behavior for the collection elements. We explore cascades above in
<fo:basic-link internal-destination="jpa_overview_meta_cascade"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.8.1, “
Cascade Type
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_cascade"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_cascade"/>]</fo:inline></fo:basic-link>. Defaults to an empty array.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3154"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">FetchType fetch</fo:inline>: Whether to load the field eagerly
(<fo:inline font-family="monospace">FetchType.EAGER</fo:inline>) or lazily
(<fo:inline font-family="monospace">FetchType.LAZY</fo:inline>). Defaults to <fo:inline font-family="monospace">
FetchType.LAZY</fo:inline>. See <fo:basic-link internal-destination="jpa_overview_meta_fetch"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.6.1, “
Fetch Type
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_fetch"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_fetch"/>]</fo:inline></fo:basic-link> above
for details on fetch types.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">one-to-many</fo:inline>, which includes
the following attributes:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e3176"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3177"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>: The name of the field or property. This attribute is
required.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3183"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">target-entity</fo:inline>: The class of the related type.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3189"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">fetch</fo:inline>: One of <fo:inline font-family="monospace">EAGER</fo:inline> or <fo:inline font-family="monospace">
LAZY</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3201"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">mapped-by</fo:inline>: The name of the field or property that owns the
relation. See <fo:basic-link internal-destination="jpa_overview_meta_field"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2, “
Field and Property Metadata
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_field"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_field"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You may also nest the <fo:inline font-family="monospace">cascade</fo:inline> element within a <fo:inline font-family="monospace">
one-to-many</fo:inline> element.
</fo:block><fo:block id="jpa_overview_meta_mappedby"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">5.2.9.1. 
Bidirectional Relations
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e3220"><!--
bidirectional relations
--></fo:wrapper><fo:wrapper id="d0e3223"><!--
mappedBy
--></fo:wrapper><fo:wrapper id="d0e3228"><!--
mapping metadata
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When two fields are logical inverses of each other, they form a <fo:inline font-style="italic">
bidirectional relation</fo:inline>. Our model contains two bidirectional
relations: <fo:inline font-family="monospace">Magazine.publisher</fo:inline> and <fo:inline font-family="monospace">Company.mags
</fo:inline> form one bidirectional relation, and <fo:inline font-family="monospace">Article.authors
</fo:inline> and <fo:inline font-family="monospace">Author.articles</fo:inline> form the other. In both cases,
there is a clear link between the two fields that form the relationship. A
magazine refers to its publisher while the publisher refers to all its published
magazines. An article refers to its authors while each author refers to her
written articles.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When the two fields of a bidirectional relation share the same datastore
mapping, JPA formalizes the connection with the <fo:inline font-family="monospace">mappedBy</fo:inline>
property. Marking <fo:inline font-family="monospace">Company.mags</fo:inline> as <fo:inline font-family="monospace">mappedBy</fo:inline>
<fo:inline font-family="monospace">Magazine.publisher</fo:inline> means two things:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.2em" id="d0e3264"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3265"><fo:list-item-label end-indent="label-end()"><fo:block>1.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Company.mags</fo:inline> uses the datastore mapping for <fo:inline font-family="monospace">
Magazine.publisher</fo:inline>, but inverses it. In fact, it is illegal to
specify any additional mapping information when you use the <fo:inline font-family="monospace">mappedBy
</fo:inline> property. All mapping information is read from the referenced field.
We explore mapping in depth in <fo:basic-link internal-destination="jpa_overview_mapping"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 12, <fo:inline font-style="italic">
Mapping Metadata
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3279"><fo:list-item-label end-indent="label-end()"><fo:block>2.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Magazine.publisher</fo:inline> is the "owner" of the relation. The field
that specifies the mapping data is always the owner. This means that changes to
the <fo:inline font-family="monospace">Magazine.publisher</fo:inline> field are reflected in the datastore,
while changes to the <fo:inline font-family="monospace">Company.mags</fo:inline> field alone are not.
Changes to <fo:inline font-family="monospace">Company.mags</fo:inline> may still affect the JPA
implementation's cache, however. Thus, it is very important that you keep your
object model consistent by properly maintaining both sides of your bidirectional
relations at all times.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You should always take advantage of the <fo:inline font-family="monospace">mappedBy</fo:inline> property
rather than mapping each field of a bidirectional relation independently.
Failing to do so may result in the JPA implementation trying to update the
database with conflicting data. Be careful to only mark one side of the relation
as <fo:inline font-family="monospace">mappedBy</fo:inline>, however. One side has to actually do the
mapping!
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e3302"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can configure OpenJPA to automatically synchronize both sides of a
bidirectional relation, or to perform various actions when it detects
inconsistent relations. See <fo:basic-link internal-destination="ref_guide_inverses"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.4, “
Managed Inverses
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_inverses"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_inverses"/>]</fo:inline></fo:basic-link> in the
Reference Guide for details.
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_meta_onetoone"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
One To One
</fo:marker><fo:block font-size="17.28pt">5.2.10. 
One To One
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e3310"><!--
OneToOne
--></fo:wrapper><fo:wrapper id="d0e3313"><!--
metadata
,
OneToOne
--></fo:wrapper><fo:wrapper id="d0e3318"><!--
annotations
,
OneToOne
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When an entity <fo:inline font-family="monospace">A</fo:inline> references a single entity <fo:inline font-family="monospace">
B</fo:inline>, and no other <fo:inline font-family="monospace">A</fo:inline>s can reference the same <fo:inline font-family="monospace">
B</fo:inline>, we say there is a <fo:inline font-style="italic">one to one</fo:inline> relation between
<fo:inline font-family="monospace">A</fo:inline> and <fo:inline font-family="monospace">B</fo:inline>. In our sample model, <fo:inline font-family="monospace">
Magazine</fo:inline> has a one to one relation to <fo:inline font-family="monospace">Article</fo:inline>
through the <fo:inline font-family="monospace">Magazine.coverArticle</fo:inline> field. No two magazines can
have the same cover article.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA indicates one to one relations between entities with the <fo:inline font-family="monospace">
OneToOne</fo:inline> annotation. This annotation has the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e3360"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3361"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Class targetEntity</fo:inline>: The class of the related entity type.
This information is usually taken from the field type.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3367"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String mappedBy</fo:inline>: Names the field in the related entity that
maps this bidirectional relation. We explain bidirectional relations in
<fo:basic-link internal-destination="jpa_overview_meta_mappedby"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.9.1, “
Bidirectional Relations
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_mappedby"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_mappedby"/>]</fo:inline></fo:basic-link> above. Leaving this property
unset signals that this is a standard unidirectional relation.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3375"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">CascadeType[] cascade</fo:inline>: Array of enum values defining cascade
behavior for this field. We explore cascades in
<fo:basic-link internal-destination="jpa_overview_meta_cascade"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.8.1, “
Cascade Type
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_cascade"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_cascade"/>]</fo:inline></fo:basic-link> above. Defaults to an empty
array.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3383"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">FetchType fetch</fo:inline>: Whether to load the field eagerly
(<fo:inline font-family="monospace">FetchType.EAGER</fo:inline>) or lazily
(<fo:inline font-family="monospace">FetchType.LAZY</fo:inline>). Defaults to <fo:inline font-family="monospace">
FetchType.EAGER</fo:inline>. See <fo:basic-link internal-destination="jpa_overview_meta_fetch"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.6.1, “
Fetch Type
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_fetch"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_fetch"/>]</fo:inline></fo:basic-link> above
for details on fetch types.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3400"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean optional</fo:inline>: Whether the related object must exist. If
<fo:inline font-family="monospace">false</fo:inline>, this field cannot be null. Defaults to <fo:inline font-family="monospace">
true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">one-to-one</fo:inline> which understands
the following attributes:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e3417"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3418"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>: The name of the field or property. This attribute is
required.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3424"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">target-entity</fo:inline>: The class of the related type.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3430"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">fetch</fo:inline>: One of <fo:inline font-family="monospace">EAGER</fo:inline> or <fo:inline font-family="monospace">
LAZY</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3442"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">mapped-by</fo:inline>: The field that owns the relation. See
<fo:basic-link internal-destination="jpa_overview_meta_field"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2, “
Field and Property Metadata
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_field"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_field"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You may also nest the <fo:inline font-family="monospace">cascade</fo:inline> element within a <fo:inline font-family="monospace">
one-to-one</fo:inline> element.
</fo:block></fo:block><fo:block id="jpa_overview_meta_manytomany"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Many To Many
</fo:marker><fo:block font-size="17.28pt">5.2.11. 
Many To Many
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e3461"><!--
ManyToMany
--></fo:wrapper><fo:wrapper id="d0e3464"><!--
metadata
,
ManyToMany
--></fo:wrapper><fo:wrapper id="d0e3469"><!--
annotations
,
ManyToMany
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When an entity <fo:inline font-family="monospace">A</fo:inline> references multiple <fo:inline font-family="monospace">B</fo:inline>
entities, and other <fo:inline font-family="monospace">A</fo:inline>s might reference some of the same
<fo:inline font-family="monospace">B</fo:inline>s, we say there is a <fo:inline font-style="italic">many to many</fo:inline>
relation between <fo:inline font-family="monospace">A</fo:inline> and <fo:inline font-family="monospace">B</fo:inline>. In our sample
model, for example, each article has a reference to all the authors that
contributed to the article. Other articles might have some of the same authors.
We say, then, that <fo:inline font-family="monospace">Article</fo:inline> and <fo:inline font-family="monospace">Author
</fo:inline> have a many to many relation through the <fo:inline font-family="monospace">Article.authors
</fo:inline> field.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA indicates many to many relations between entities with the <fo:inline font-family="monospace">
ManyToMany</fo:inline> annotation. This annotation has the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e3511"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3512"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Class targetEntity</fo:inline>: The class of the related entity type.
This information is usually taken from the parameterized collection or map
element type. You must supply it explicitly, however, if your field isn't a
parameterized type.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3518"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String mappedBy</fo:inline>: Names the many to many field in the related
entity that maps this bidirectional relation. We explain bidirectional relations
in <fo:basic-link internal-destination="jpa_overview_meta_mappedby"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.9.1, “
Bidirectional Relations
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_mappedby"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_mappedby"/>]</fo:inline></fo:basic-link> above. Leaving this
property unset signals that this is a standard unidirectional relation.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3526"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">CascadeType[] cascade</fo:inline>: Array of enum values defining cascade
behavior for the collection elements. We explore cascades above in
<fo:basic-link internal-destination="jpa_overview_meta_cascade"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.8.1, “
Cascade Type
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_cascade"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_cascade"/>]</fo:inline></fo:basic-link>. Defaults to an empty array.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3534"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">FetchType fetch</fo:inline>: Whether to load the field eagerly
(<fo:inline font-family="monospace">FetchType.EAGER</fo:inline>) or lazily
(<fo:inline font-family="monospace">FetchType.LAZY</fo:inline>). Defaults to <fo:inline font-family="monospace">
FetchType.LAZY</fo:inline>. See <fo:basic-link internal-destination="jpa_overview_meta_fetch"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.6.1, “
Fetch Type
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_fetch"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_fetch"/>]</fo:inline></fo:basic-link> above
for details on fetch types.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">many-to-many</fo:inline>. It accepts the
following attributes:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e3556"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3557"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>: The name of the field or property. This attribute is
required.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3563"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">target-entity</fo:inline>: The class of the related type.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3569"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">fetch</fo:inline>: One of <fo:inline font-family="monospace">EAGER</fo:inline> or <fo:inline font-family="monospace">
LAZY</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3581"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">mapped-by</fo:inline>: The field that owns the relation. See
<fo:basic-link internal-destination="jpa_overview_meta_field"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2, “
Field and Property Metadata
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_field"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_field"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You may also nest the <fo:inline font-family="monospace">cascade</fo:inline> element within a <fo:inline font-family="monospace">
many-to-many</fo:inline> element.
</fo:block></fo:block><fo:block id="jpa_overview_meta_orderby"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Order By
</fo:marker><fo:block font-size="17.28pt">5.2.12. 
Order By
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e3600"><!--
OrderBy
--></fo:wrapper><fo:wrapper id="d0e3603"><!--
metadata
,
OrderBy
--></fo:wrapper><fo:wrapper id="d0e3608"><!--
annotations
,
OrderBy
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Datastores such as relational databases do not preserve the order of records.
Your persistent <fo:inline font-family="monospace">List</fo:inline> fields might be ordered one way the
first time you retrieve an object from the datastore, and a completely different
way the next. To ensure consistent ordering of collection fields, you must use
the <fo:inline font-family="monospace">OrderBy</fo:inline> annotation. The <fo:inline font-family="monospace">OrderBy
</fo:inline> annotation's value is a string defining the order of the collection
elements. An empty value means to sort on the identity value(s) of the elements
in ascending order. Any other value must be of the form:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e3624">
&lt;field name&gt;[ ASC|DESC][, ...]
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Each <fo:inline font-family="monospace">&lt;field name&gt;</fo:inline> is the name of a persistent field in
the collection's element type. You can optionally follow each field by the
keyword <fo:inline font-family="monospace">ASC</fo:inline> for ascending order, or <fo:inline font-family="monospace">DESC</fo:inline>
for descending order. If the direction is omitted, it defaults to ascending.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">order-by</fo:inline> which can be listed as
a sub-element of the <fo:inline font-family="monospace">one-to-many</fo:inline> or <fo:inline font-family="monospace">many-to-many
</fo:inline> elements. The text within this element is parsed as the order by
string.
</fo:block></fo:block><fo:block id="jpa_overview_meta_mapkey"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Map Key
</fo:marker><fo:block font-size="17.28pt">5.2.13. 
Map Key
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e3651"><!--
MapKey
--></fo:wrapper><fo:wrapper id="d0e3654"><!--
metadata
,
MapKey
--></fo:wrapper><fo:wrapper id="d0e3659"><!--
annotations
,
MapKey
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA supports persistent <fo:inline font-family="monospace">Map</fo:inline> fields through either a
<fo:basic-link internal-destination="jpa_overview_meta_onetomany"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace"> OneToMany</fo:inline>
</fo:inline></fo:basic-link> or <fo:basic-link internal-destination="jpa_overview_meta_manytomany"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">ManyToMany
</fo:inline></fo:inline></fo:basic-link> association. The related entities form the map values. JPA
derives the map keys by extracting a field from each entity value. The
<fo:inline font-family="monospace">MapKey</fo:inline> annotation designates the field that is used as
the key. It has the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e3681"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3682"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String name</fo:inline>: The name of a field in the related entity class
to use as the map key. If no name is given, defaults to the identity field of
the related entity class.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">map-key</fo:inline> which can be listed as
a sub-element of the <fo:inline font-family="monospace">one-to-many</fo:inline> or <fo:inline font-family="monospace">many-to-many
</fo:inline> elements. The <fo:inline font-family="monospace">map-key</fo:inline> element has the following
attributes:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e3702"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3703"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>: The name of the field in the related entity class to
use as the map key.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="jpa_overview_meta_fielddefaults"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Persistent Field Defaults
</fo:marker><fo:block font-size="17.28pt">5.2.14. 
Persistent Field Defaults
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In the absence of any of the annotations above, JPA defines the following
default behavior for declared fields:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.2em" id="d0e3714"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3715"><fo:list-item-label end-indent="label-end()"><fo:block>1.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Fields declared <fo:inline font-family="monospace">static, transient</fo:inline>, or <fo:inline font-family="monospace">final
</fo:inline> default to non-persistent.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3724"><fo:list-item-label end-indent="label-end()"><fo:block>2.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Fields of any primitive type, primitive wrapper type, <fo:inline font-family="monospace">
java.lang.String</fo:inline>, <fo:inline font-family="monospace">byte[]</fo:inline>, <fo:inline font-family="monospace">
Byte[]</fo:inline>, <fo:inline font-family="monospace">char[]</fo:inline>, <fo:inline font-family="monospace">
Character[]</fo:inline>, <fo:inline font-family="monospace">java.math.BigDecimal</fo:inline>,
<fo:inline font-family="monospace">java.math.BigInteger</fo:inline>, <fo:inline font-family="monospace">
java.util.Date</fo:inline>, <fo:inline font-family="monospace"> java.util.Calendar</fo:inline>,
<fo:inline font-family="monospace">java.sql.Date</fo:inline>, <fo:inline font-family="monospace">java.sql.Timestamp</fo:inline>,
or any <fo:inline font-family="monospace">Serializable</fo:inline> type default to persistent, as if
annotated with <fo:basic-link internal-destination="jpa_overview_meta_basic"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
@Basic</fo:inline></fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3767"><fo:list-item-label end-indent="label-end()"><fo:block>3.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Fields of an embeddable type default to persistent, as if annotated with
<fo:basic-link internal-destination="jpa_overview_meta_embedded"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">@Embedded</fo:inline></fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3774"><fo:list-item-label end-indent="label-end()"><fo:block>4.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
All other fields default to non-persistent.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Note that according to these defaults, all relations between entities must be
annotated explicitly. Without an annotation, a relation field will default to
serialized storage if the related entity type is serializable, or will default
to being non-persistent if not.
</fo:block></fo:block></fo:block><fo:block id="jpa_overview_meta_xml"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
XML Schema
</fo:marker><fo:block font-size="20.735999999999997pt">5.3. 
XML Schema
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e3782"><!--
metadata
,
XSD
--></fo:wrapper><fo:wrapper id="d0e3787"><!--
JPA
,
metadata
,
XML
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
We present the complete XML schema below. Many of the elements relate to
object/relational mapping rather than metadata; these elements are discussed in
<fo:basic-link internal-destination="jpa_overview_mapping"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 12, <fo:inline font-style="italic">
Mapping Metadata
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e3800">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xsd:schema targetNamespace="http://java.sun.com/xml/ns/persistence/orm"
xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="1.0"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@(#)orm_1_0.xsd 1.0 Feb 14 2006
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
This is the XML Schema for the persistence object-relational
mapping file.
The file may be named "META-INF/orm.xml" in the persistence
archive or it may be named some other name which would be
used to locate the file as resource on the classpath.
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:complexType name="emptyType"/&gt;
&lt;xsd:simpleType name="versionType"&gt;
&lt;xsd:restriction base="xsd:token"&gt;
&lt;xsd:pattern value="[0-9]+(\.[0-9]+)*"/&gt;
&lt;/xsd:restriction&gt;
&lt;/xsd:simpleType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:element name="entity-mappings"&gt;
&lt;xsd:complexType&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
The entity-mappings element is the root element of an mapping
file. It contains the following four types of elements:
1. The persistence-unit-metadata element contains metadata
for the entire persistence unit. It is undefined if this element
occurs in multiple mapping files within the same persistence unit.
2. The package, schema, catalog and access elements apply to all of
the entity, mapped-superclass and embeddable elements defined in
the same file in which they occur.
3. The sequence-generator, table-generator, named-query,
named-native-query and sql-result-set-mapping elements are global
to the persistence unit. It is undefined to have more than one
sequence-generator or table-generator of the same name in the same
or different mapping files in a persistence unit. It is also
undefined to have more than one named-query or named-native-query
of the same name in the same or different mapping files in a
persistence unit.
4. The entity, mapped-superclass and embeddable elements each define
the mapping information for a managed persistent class. The mapping
information contained in these elements may be complete or it may
be partial.
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="description" type="xsd:string"
minOccurs="0"/&gt;
&lt;xsd:element name="persistence-unit-metadata"
type="orm:persistence-unit-metadata"
minOccurs="0"/&gt;
&lt;xsd:element name="package" type="xsd:string"
minOccurs="0"/&gt;
&lt;xsd:element name="schema" type="xsd:string"
minOccurs="0"/&gt;
&lt;xsd:element name="catalog" type="xsd:string"
minOccurs="0"/&gt;
&lt;xsd:element name="access" type="orm:access-type"
minOccurs="0"/&gt;
&lt;xsd:element name="sequence-generator" type="orm:sequence-generator"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="table-generator" type="orm:table-generator"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="named-query" type="orm:named-query"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="named-native-query" type="orm:named-native-query"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="sql-result-set-mapping"
type="orm:sql-result-set-mapping"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="mapped-superclass" type="orm:mapped-superclass"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="entity" type="orm:entity"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="embeddable" type="orm:embeddable"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="version" type="orm:versionType"
fixed="1.0" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;/xsd:element&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="persistence-unit-metadata"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
Metadata that applies to the persistence unit and not just to
the mapping file in which it is contained.
If the xml-mapping-metadata-complete element is specified then
the complete set of mapping metadata for the persistence unit
is contained in the XML mapping files for the persistence unit.
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="xml-mapping-metadata-complete" type="orm:emptyType"
minOccurs="0"/&gt;
&lt;xsd:element name="persistence-unit-defaults"
type="orm:persistence-unit-defaults"
minOccurs="0"/&gt;
&lt;/xsd:sequence&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="persistence-unit-defaults"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
These defaults are applied to the persistence unit as a whole
unless they are overridden by local annotation or XML
element settings.
schema - Used as the schema for all tables or secondary tables
that apply to the persistence unit
catalog - Used as the catalog for all tables or secondary tables
that apply to the persistence unit
access - Used as the access type for all managed classes in
the persistence unit
cascade-persist - Adds cascade-persist to the set of cascade options
in entity relationships of the persistence unit
entity-listeners - List of default entity listeners to be invoked
on each entity in the persistence unit.
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="schema" type="xsd:string"
minOccurs="0"/&gt;
&lt;xsd:element name="catalog" type="xsd:string"
minOccurs="0"/&gt;
&lt;xsd:element name="access" type="orm:access-type"
minOccurs="0"/&gt;
&lt;xsd:element name="cascade-persist" type="orm:emptyType"
minOccurs="0"/&gt;
&lt;xsd:element name="entity-listeners" type="orm:entity-listeners"
minOccurs="0"/&gt;
&lt;/xsd:sequence&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="entity"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
Defines the settings and mappings for an entity. Is allowed to be
sparsely populated and used in conjunction with the annotations.
Alternatively, the metadata-complete attribute can be used to
indicate that no annotations on the entity class (and its fields
or properties) are to be processed. If this is the case then
the defaulting rules for the entity and its subelements will
be recursively applied.
@Target(TYPE) @Retention(RUNTIME)
public @interface Entity {
String name() default "";
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="description" type="xsd:string" minOccurs="0"/&gt;
&lt;xsd:element name="table" type="orm:table"
minOccurs="0"/&gt;
&lt;xsd:element name="secondary-table" type="orm:secondary-table"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="primary-key-join-column"
type="orm:primary-key-join-column"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="id-class" type="orm:id-class" minOccurs="0"/&gt;
&lt;xsd:element name="inheritance" type="orm:inheritance" minOccurs="0"/&gt;
&lt;xsd:element name="discriminator-value" type="orm:discriminator-value"
minOccurs="0"/&gt;
&lt;xsd:element name="discriminator-column"
type="orm:discriminator-column"
minOccurs="0"/&gt;
&lt;xsd:element name="sequence-generator" type="orm:sequence-generator"
minOccurs="0"/&gt;
&lt;xsd:element name="table-generator" type="orm:table-generator"
minOccurs="0"/&gt;
&lt;xsd:element name="named-query" type="orm:named-query"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="named-native-query" type="orm:named-native-query"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="sql-result-set-mapping"
type="orm:sql-result-set-mapping"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="exclude-default-listeners" type="orm:emptyType"
minOccurs="0"/&gt;
&lt;xsd:element name="exclude-superclass-listeners" type="orm:emptyType"
minOccurs="0"/&gt;
&lt;xsd:element name="entity-listeners" type="orm:entity-listeners"
minOccurs="0"/&gt;
&lt;xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/&gt;
&lt;xsd:element name="post-persist" type="orm:post-persist"
minOccurs="0"/&gt;
&lt;xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/&gt;
&lt;xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/&gt;
&lt;xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/&gt;
&lt;xsd:element name="post-update" type="orm:post-update" minOccurs="0"/&gt;
&lt;xsd:element name="post-load" type="orm:post-load" minOccurs="0"/&gt;
&lt;xsd:element name="attribute-override" type="orm:attribute-override"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="association-override"
type="orm:association-override"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="attributes" type="orm:attributes" minOccurs="0"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="name" type="xsd:string"/&gt;
&lt;xsd:attribute name="class" type="xsd:string" use="required"/&gt;
&lt;xsd:attribute name="access" type="orm:access-type"/&gt;
&lt;xsd:attribute name="metadata-complete" type="xsd:boolean"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="attributes"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
This element contains the entity field or property mappings.
It may be sparsely populated to include only a subset of the
fields or properties. If metadata-complete for the entity is true
then the remainder of the attributes will be defaulted according
to the default rules.
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:choice&gt;
&lt;xsd:element name="id" type="orm:id"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="embedded-id" type="orm:embedded-id"
minOccurs="0"/&gt;
&lt;/xsd:choice&gt;
&lt;xsd:element name="basic" type="orm:basic"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="version" type="orm:version"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="many-to-one" type="orm:many-to-one"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="one-to-many" type="orm:one-to-many"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="one-to-one" type="orm:one-to-one"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="many-to-many" type="orm:many-to-many"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="embedded" type="orm:embedded"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="transient" type="orm:transient"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;/xsd:sequence&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:simpleType name="access-type"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
This element determines how the persistence provider accesses the
state of an entity or embedded object.
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:restriction base="xsd:token"&gt;
&lt;xsd:enumeration value="PROPERTY"/&gt;
&lt;xsd:enumeration value="FIELD"/&gt;
&lt;/xsd:restriction&gt;
&lt;/xsd:simpleType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="entity-listeners"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({TYPE}) @Retention(RUNTIME)
public @interface EntityListeners {
Class[] value();
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="entity-listener" type="orm:entity-listener"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;/xsd:sequence&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="entity-listener"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
Defines an entity listener to be invoked at lifecycle events
for the entities that list this listener.
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/&gt;
&lt;xsd:element name="post-persist" type="orm:post-persist"
minOccurs="0"/&gt;
&lt;xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/&gt;
&lt;xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/&gt;
&lt;xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/&gt;
&lt;xsd:element name="post-update" type="orm:post-update" minOccurs="0"/&gt;
&lt;xsd:element name="post-load" type="orm:post-load" minOccurs="0"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="class" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="pre-persist"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD}) @Retention(RUNTIME)
public @interface PrePersist {}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="method-name" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="post-persist"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD}) @Retention(RUNTIME)
public @interface PostPersist {}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="method-name" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="pre-remove"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD}) @Retention(RUNTIME)
public @interface PreRemove {}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="method-name" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="post-remove"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD}) @Retention(RUNTIME)
public @interface PostRemove {}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="method-name" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="pre-update"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD}) @Retention(RUNTIME)
public @interface PreUpdate {}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="method-name" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="post-update"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD}) @Retention(RUNTIME)
public @interface PostUpdate {}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="method-name" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="post-load"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD}) @Retention(RUNTIME)
public @interface PostLoad {}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="method-name" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="query-hint"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({}) @Retention(RUNTIME)
public @interface QueryHint {
String name();
String value();
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;xsd:attribute name="value" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="named-query"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({TYPE}) @Retention(RUNTIME)
public @interface NamedQuery {
String name();
String query();
QueryHint[] hints() default {};
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="query" type="xsd:string"/&gt;
&lt;xsd:element name="hint" type="orm:query-hint"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="named-native-query"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({TYPE}) @Retention(RUNTIME)
public @interface NamedNativeQuery {
String name();
String query();
QueryHint[] hints() default {};
Class resultClass() default void.class;
String resultSetMapping() default ""; //named SqlResultSetMapping
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="query" type="xsd:string"/&gt;
&lt;xsd:element name="hint" type="orm:query-hint"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;xsd:attribute name="result-class" type="xsd:string"/&gt;
&lt;xsd:attribute name="result-set-mapping" type="xsd:string"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="sql-result-set-mapping"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({TYPE}) @Retention(RUNTIME)
public @interface SqlResultSetMapping {
String name();
EntityResult[] entities() default {};
ColumnResult[] columns() default {};
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="entity-result" type="orm:entity-result"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="column-result" type="orm:column-result"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="entity-result"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({}) @Retention(RUNTIME)
public @interface EntityResult {
Class entityClass();
FieldResult[] fields() default {};
String discriminatorColumn() default "";
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="field-result" type="orm:field-result"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="entity-class" type="xsd:string" use="required"/&gt;
&lt;xsd:attribute name="discriminator-column" type="xsd:string"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="field-result"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({}) @Retention(RUNTIME)
public @interface FieldResult {
String name();
String column();
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;xsd:attribute name="column" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="column-result"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({}) @Retention(RUNTIME)
public @interface ColumnResult {
String name();
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="table"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({TYPE}) @Retention(RUNTIME)
public @interface Table {
String name() default "";
String catalog() default "";
String schema() default "";
UniqueConstraint[] uniqueConstraints() default {};
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="unique-constraint" type="orm:unique-constraint"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="name" type="xsd:string"/&gt;
&lt;xsd:attribute name="catalog" type="xsd:string"/&gt;
&lt;xsd:attribute name="schema" type="xsd:string"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="secondary-table"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({TYPE}) @Retention(RUNTIME)
public @interface SecondaryTable {
String name();
String catalog() default "";
String schema() default "";
PrimaryKeyJoinColumn[] pkJoinColumns() default {};
UniqueConstraint[] uniqueConstraints() default {};
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="primary-key-join-column"
type="orm:primary-key-join-column"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="unique-constraint" type="orm:unique-constraint"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;xsd:attribute name="catalog" type="xsd:string"/&gt;
&lt;xsd:attribute name="schema" type="xsd:string"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="unique-constraint"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({}) @Retention(RUNTIME)
public @interface UniqueConstraint {
String[] columnNames();
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="column-name" type="xsd:string"
maxOccurs="unbounded"/&gt;
&lt;/xsd:sequence&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="column"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface Column {
String name() default "";
boolean unique() default false;
boolean nullable() default true;
boolean insertable() default true;
boolean updatable() default true;
String columnDefinition() default "";
String table() default "";
int length() default 255;
int precision() default 0; // decimal precision
int scale() default 0; // decimal scale
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="name" type="xsd:string"/&gt;
&lt;xsd:attribute name="unique" type="xsd:boolean"/&gt;
&lt;xsd:attribute name="nullable" type="xsd:boolean"/&gt;
&lt;xsd:attribute name="insertable" type="xsd:boolean"/&gt;
&lt;xsd:attribute name="updatable" type="xsd:boolean"/&gt;
&lt;xsd:attribute name="column-definition" type="xsd:string"/&gt;
&lt;xsd:attribute name="table" type="xsd:string"/&gt;
&lt;xsd:attribute name="length" type="xsd:int"/&gt;
&lt;xsd:attribute name="precision" type="xsd:int"/&gt;
&lt;xsd:attribute name="scale" type="xsd:int"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="join-column"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface JoinColumn {
String name() default "";
String referencedColumnName() default "";
boolean unique() default false;
boolean nullable() default true;
boolean insertable() default true;
boolean updatable() default true;
String columnDefinition() default "";
String table() default "";
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="name" type="xsd:string"/&gt;
&lt;xsd:attribute name="referenced-column-name" type="xsd:string"/&gt;
&lt;xsd:attribute name="unique" type="xsd:boolean"/&gt;
&lt;xsd:attribute name="nullable" type="xsd:boolean"/&gt;
&lt;xsd:attribute name="insertable" type="xsd:boolean"/&gt;
&lt;xsd:attribute name="updatable" type="xsd:boolean"/&gt;
&lt;xsd:attribute name="column-definition" type="xsd:string"/&gt;
&lt;xsd:attribute name="table" type="xsd:string"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:simpleType name="generation-type"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
public enum GenerationType { TABLE, SEQUENCE, IDENTITY, AUTO };
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:restriction base="xsd:token"&gt;
&lt;xsd:enumeration value="TABLE"/&gt;
&lt;xsd:enumeration value="SEQUENCE"/&gt;
&lt;xsd:enumeration value="IDENTITY"/&gt;
&lt;xsd:enumeration value="AUTO"/&gt;
&lt;/xsd:restriction&gt;
&lt;/xsd:simpleType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="attribute-override"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
public @interface AttributeOverride {
String name();
Column column();
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="column" type="orm:column"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="association-override"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
public @interface AssociationOverride {
String name();
JoinColumn[] joinColumns();
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="join-column" type="orm:join-column"
maxOccurs="unbounded"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="id-class"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({TYPE}) @Retention(RUNTIME)
public @interface IdClass {
Class value();
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="class" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="id"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface Id {}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="column" type="orm:column"
minOccurs="0"/&gt;
&lt;xsd:element name="generated-value" type="orm:generated-value"
minOccurs="0"/&gt;
&lt;xsd:element name="temporal" type="orm:temporal"
minOccurs="0"/&gt;
&lt;xsd:element name="table-generator" type="orm:table-generator"
minOccurs="0"/&gt;
&lt;xsd:element name="sequence-generator" type="orm:sequence-generator"
minOccurs="0"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="embedded-id"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface EmbeddedId {}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="attribute-override" type="orm:attribute-override"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="transient"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface Transient {}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="version"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface Version {}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="column" type="orm:column" minOccurs="0"/&gt;
&lt;xsd:element name="temporal" type="orm:temporal" minOccurs="0"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="basic"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface Basic {
FetchType fetch() default EAGER;
boolean optional() default true;
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="column" type="orm:column" minOccurs="0"/&gt;
&lt;xsd:choice&gt;
&lt;xsd:element name="lob" type="orm:lob" minOccurs="0"/&gt;
&lt;xsd:element name="temporal" type="orm:temporal" minOccurs="0"/&gt;
&lt;xsd:element name="enumerated" type="orm:enumerated" minOccurs="0"/&gt;
&lt;/xsd:choice&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;xsd:attribute name="fetch" type="orm:fetch-type"/&gt;
&lt;xsd:attribute name="optional" type="xsd:boolean"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:simpleType name="fetch-type"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
public enum FetchType { LAZY, EAGER };
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:restriction base="xsd:token"&gt;
&lt;xsd:enumeration value="LAZY"/&gt;
&lt;xsd:enumeration value="EAGER"/&gt;
&lt;/xsd:restriction&gt;
&lt;/xsd:simpleType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="lob"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface Lob {}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:simpleType name="temporal"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface Temporal {
TemporalType value();
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:restriction base="orm:temporal-type"/&gt;
&lt;/xsd:simpleType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:simpleType name="temporal-type"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
public enum TemporalType {
DATE, // java.sql.Date
TIME, // java.sql.Time
TIMESTAMP // java.sql.Timestamp
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:restriction base="xsd:token"&gt;
&lt;xsd:enumeration value="DATE"/&gt;
&lt;xsd:enumeration value="TIME"/&gt;
&lt;xsd:enumeration value="TIMESTAMP"/&gt;
&lt;/xsd:restriction&gt;
&lt;/xsd:simpleType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:simpleType name="enumerated"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface Enumerated {
EnumType value() default ORDINAL;
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:restriction base="orm:enum-type"/&gt;
&lt;/xsd:simpleType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:simpleType name="enum-type"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
public enum EnumType {
ORDINAL,
STRING
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:restriction base="xsd:token"&gt;
&lt;xsd:enumeration value="ORDINAL"/&gt;
&lt;xsd:enumeration value="STRING"/&gt;
&lt;/xsd:restriction&gt;
&lt;/xsd:simpleType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="many-to-one"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface ManyToOne {
Class targetEntity() default void.class;
CascadeType[] cascade() default {};
FetchType fetch() default EAGER;
boolean optional() default true;
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:choice&gt;
&lt;xsd:element name="join-column" type="orm:join-column"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="join-table" type="orm:join-table"
minOccurs="0"/&gt;
&lt;/xsd:choice&gt;
&lt;xsd:element name="cascade" type="orm:cascade-type"
minOccurs="0"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;xsd:attribute name="target-entity" type="xsd:string"/&gt;
&lt;xsd:attribute name="fetch" type="orm:fetch-type"/&gt;
&lt;xsd:attribute name="optional" type="xsd:boolean"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="cascade-type"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
public enum CascadeType { ALL, PERSIST, MERGE, REMOVE, REFRESH};
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="cascade-all" type="orm:emptyType"
minOccurs="0"/&gt;
&lt;xsd:element name="cascade-persist" type="orm:emptyType"
minOccurs="0"/&gt;
&lt;xsd:element name="cascade-merge" type="orm:emptyType"
minOccurs="0"/&gt;
&lt;xsd:element name="cascade-remove" type="orm:emptyType"
minOccurs="0"/&gt;
&lt;xsd:element name="cascade-refresh" type="orm:emptyType"
minOccurs="0"/&gt;
&lt;/xsd:sequence&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="one-to-one"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface OneToOne {
Class targetEntity() default void.class;
CascadeType[] cascade() default {};
FetchType fetch() default EAGER;
boolean optional() default true;
String mappedBy() default "";
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:choice&gt;
&lt;xsd:element name="primary-key-join-column"
type="orm:primary-key-join-column"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="join-column" type="orm:join-column"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="join-table" type="orm:join-table"
minOccurs="0"/&gt;
&lt;/xsd:choice&gt;
&lt;xsd:element name="cascade" type="orm:cascade-type"
minOccurs="0"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;xsd:attribute name="target-entity" type="xsd:string"/&gt;
&lt;xsd:attribute name="fetch" type="orm:fetch-type"/&gt;
&lt;xsd:attribute name="optional" type="xsd:boolean"/&gt;
&lt;xsd:attribute name="mapped-by" type="xsd:string"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="one-to-many"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface OneToMany {
Class targetEntity() default void.class;
CascadeType[] cascade() default {};
FetchType fetch() default LAZY;
String mappedBy() default "";
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="order-by" type="orm:order-by"
minOccurs="0"/&gt;
&lt;xsd:element name="map-key" type="orm:map-key"
minOccurs="0"/&gt;
&lt;xsd:choice&gt;
&lt;xsd:element name="join-table" type="orm:join-table"
minOccurs="0"/&gt;
&lt;xsd:element name="join-column" type="orm:join-column"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;/xsd:choice&gt;
&lt;xsd:element name="cascade" type="orm:cascade-type"
minOccurs="0"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;xsd:attribute name="target-entity" type="xsd:string"/&gt;
&lt;xsd:attribute name="fetch" type="orm:fetch-type"/&gt;
&lt;xsd:attribute name="mapped-by" type="xsd:string"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="join-table"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface JoinTable {
String name() default "";
String catalog() default "";
String schema() default "";
JoinColumn[] joinColumns() default {};
JoinColumn[] inverseJoinColumns() default {};
UniqueConstraint[] uniqueConstraints() default {};
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="join-column" type="orm:join-column"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="inverse-join-column" type="orm:join-column"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="unique-constraint" type="orm:unique-constraint"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="name" type="xsd:string"/&gt;
&lt;xsd:attribute name="catalog" type="xsd:string"/&gt;
&lt;xsd:attribute name="schema" type="xsd:string"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="many-to-many"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface ManyToMany {
Class targetEntity() default void.class;
CascadeType[] cascade() default {};
FetchType fetch() default LAZY;
String mappedBy() default "";
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="order-by" type="orm:order-by"
minOccurs="0"/&gt;
&lt;xsd:element name="map-key" type="orm:map-key"
minOccurs="0"/&gt;
&lt;xsd:element name="join-table" type="orm:join-table"
minOccurs="0"/&gt;
&lt;xsd:element name="cascade" type="orm:cascade-type"
minOccurs="0"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;xsd:attribute name="target-entity" type="xsd:string"/&gt;
&lt;xsd:attribute name="fetch" type="orm:fetch-type"/&gt;
&lt;xsd:attribute name="mapped-by" type="xsd:string"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="generated-value"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface GeneratedValue {
GenerationType strategy() default AUTO;
String generator() default "";
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="strategy" type="orm:generation-type"/&gt;
&lt;xsd:attribute name="generator" type="xsd:string"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="map-key"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface MapKey {
String name() default "";
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="name" type="xsd:string"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:simpleType name="order-by"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface OrderBy {
String value() default "";
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:restriction base="xsd:string"/&gt;
&lt;/xsd:simpleType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="inheritance"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({TYPE}) @Retention(RUNTIME)
public @interface Inheritance {
InheritanceType strategy() default SINGLE_TABLE;
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="strategy" type="orm:inheritance-type"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:simpleType name="inheritance-type"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
public enum InheritanceType
{ SINGLE_TABLE, JOINED, TABLE_PER_CLASS};
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:restriction base="xsd:token"&gt;
&lt;xsd:enumeration value="SINGLE_TABLE"/&gt;
&lt;xsd:enumeration value="JOINED"/&gt;
&lt;xsd:enumeration value="TABLE_PER_CLASS"/&gt;
&lt;/xsd:restriction&gt;
&lt;/xsd:simpleType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:simpleType name="discriminator-value"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({TYPE}) @Retention(RUNTIME)
public @interface DiscriminatorValue {
String value();
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:restriction base="xsd:string"/&gt;
&lt;/xsd:simpleType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:simpleType name="discriminator-type"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
public enum DiscriminatorType { STRING, CHAR, INTEGER };
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:restriction base="xsd:token"&gt;
&lt;xsd:enumeration value="STRING"/&gt;
&lt;xsd:enumeration value="CHAR"/&gt;
&lt;xsd:enumeration value="INTEGER"/&gt;
&lt;/xsd:restriction&gt;
&lt;/xsd:simpleType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="primary-key-join-column"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
public @interface PrimaryKeyJoinColumn {
String name() default "";
String referencedColumnName() default "";
String columnDefinition() default "";
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="name" type="xsd:string"/&gt;
&lt;xsd:attribute name="referenced-column-name" type="xsd:string"/&gt;
&lt;xsd:attribute name="column-definition" type="xsd:string"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="discriminator-column"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({TYPE}) @Retention(RUNTIME)
public @interface DiscriminatorColumn {
String name() default "DTYPE";
DiscriminatorType discriminatorType() default STRING;
String columnDefinition() default "";
int length() default 31;
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="name" type="xsd:string"/&gt;
&lt;xsd:attribute name="discriminator-type" type="orm:discriminator-type"/&gt;
&lt;xsd:attribute name="column-definition" type="xsd:string"/&gt;
&lt;xsd:attribute name="length" type="xsd:int"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="embeddable"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
Defines the settings and mappings for embeddable objects. Is
allowed to be sparsely populated and used in conjunction with
the annotations. Alternatively, the metadata-complete attribute
can be used to indicate that no annotations are to be processed
in the class. If this is the case then the defaulting rules will
be recursively applied.
@Target({TYPE}) @Retention(RUNTIME)
public @interface Embeddable {}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="description" type="xsd:string" minOccurs="0"/&gt;
&lt;xsd:element name="attributes" type="orm:embeddable-attributes"
minOccurs="0"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="class" type="xsd:string" use="required"/&gt;
&lt;xsd:attribute name="access" type="orm:access-type"/&gt;
&lt;xsd:attribute name="metadata-complete" type="xsd:boolean"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="embeddable-attributes"&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="basic" type="orm:basic"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;xsd:element name="transient" type="orm:transient"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;/xsd:sequence&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="embedded"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({METHOD, FIELD}) @Retention(RUNTIME)
public @interface Embedded {}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="attribute-override" type="orm:attribute-override"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="mapped-superclass"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
Defines the settings and mappings for a mapped superclass. Is
allowed to be sparsely populated and used in conjunction with
the annotations. Alternatively, the metadata-complete attribute
can be used to indicate that no annotations are to be processed
If this is the case then the defaulting rules will be recursively
applied.
@Target(TYPE) @Retention(RUNTIME)
public @interface MappedSuperclass{}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="description" type="xsd:string" minOccurs="0"/&gt;
&lt;xsd:element name="id-class" type="orm:id-class" minOccurs="0"/&gt;
&lt;xsd:element name="exclude-default-listeners" type="orm:emptyType"
minOccurs="0"/&gt;
&lt;xsd:element name="exclude-superclass-listeners" type="orm:emptyType"
minOccurs="0"/&gt;
&lt;xsd:element name="entity-listeners" type="orm:entity-listeners"
minOccurs="0"/&gt;
&lt;xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/&gt;
&lt;xsd:element name="post-persist" type="orm:post-persist"
minOccurs="0"/&gt;
&lt;xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/&gt;
&lt;xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/&gt;
&lt;xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/&gt;
&lt;xsd:element name="post-update" type="orm:post-update" minOccurs="0"/&gt;
&lt;xsd:element name="post-load" type="orm:post-load" minOccurs="0"/&gt;
&lt;xsd:element name="attributes" type="orm:attributes" minOccurs="0"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="class" type="xsd:string" use="required"/&gt;
&lt;xsd:attribute name="access" type="orm:access-type"/&gt;
&lt;xsd:attribute name="metadata-complete" type="xsd:boolean"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="sequence-generator"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
public @interface SequenceGenerator {
String name();
String sequenceName() default "";
int initialValue() default 1;
int allocationSize() default 50;
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;xsd:attribute name="sequence-name" type="xsd:string"/&gt;
&lt;xsd:attribute name="initial-value" type="xsd:int"/&gt;
&lt;xsd:attribute name="allocation-size" type="xsd:int"/&gt;
&lt;/xsd:complexType&gt;
&lt;!-- **************************************************** --&gt;
&lt;xsd:complexType name="table-generator"&gt;
&lt;xsd:annotation&gt;
&lt;xsd:documentation&gt;
@Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
public @interface TableGenerator {
String name();
String table() default "";
String catalog() default "";
String schema() default "";
String pkColumnName() default "";
String valueColumnName() default "";
String pkColumnValue() default "";
int initialValue() default 0;
int allocationSize() default 50;
UniqueConstraint[] uniqueConstraints() default {};
}
&lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt;
&lt;xsd:sequence&gt;
&lt;xsd:element name="unique-constraint" type="orm:unique-constraint"
minOccurs="0" maxOccurs="unbounded"/&gt;
&lt;/xsd:sequence&gt;
&lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
&lt;xsd:attribute name="table" type="xsd:string"/&gt;
&lt;xsd:attribute name="catalog" type="xsd:string"/&gt;
&lt;xsd:attribute name="schema" type="xsd:string"/&gt;
&lt;xsd:attribute name="pk-column-name" type="xsd:string"/&gt;
&lt;xsd:attribute name="value-column-name" type="xsd:string"/&gt;
&lt;xsd:attribute name="pk-column-value" type="xsd:string"/&gt;
&lt;xsd:attribute name="initial-value" type="xsd:int"/&gt;
&lt;xsd:attribute name="allocation-size" type="xsd:int"/&gt;
&lt;/xsd:complexType&gt;
&lt;/xsd:schema&gt;
</fo:block></fo:block><fo:block id="jpa_overview_meta_complete"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Conclusion
</fo:marker><fo:block font-size="20.735999999999997pt">5.4. 
Conclusion
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
That exhausts persistence metadata annotations. We present the class definitions
for our sample model below:
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_meta_complete_ex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.2. 
Complete Metadata
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e3810">
package org.mag;
@Entity
@IdClass(Magazine.MagazineId.class)
public class Magazine {
@Id private String isbn;
@Id private String title;
@Version private int version;
private double price; // defaults to @Basic
private int copiesSold; // defaults to @Basic
@OneToOne(fetch=FetchType.LAZY,
cascade={CascadeType.PERSIST,CascadeType.REMOVE})
private Article coverArticle;
@OneToMany(cascade={CascadeType.PERSIST,CascadeType.REMOVE})
@OrderBy
private Collection&lt;Article&gt; articles;
@ManyToOne(fetch=FetchType.LAZY, cascade=CascadeType.PERSIST)
private Company publisher;
@Transient private byte[] data;
...
public static class MagazineId {
...
}
}
@Entity
public class Article {
@Id private long id;
@Version private int version;
private String title; // defaults to @Basic
private byte[] content; // defaults to @Basic
@ManyToMany(cascade=CascadeType.PERSIST)
@OrderBy("lastName, firstName")
private Collection&lt;Author&gt; authors;
...
}
package org.mag.pub;
@Entity
public class Company {
@Id private long id;
@Version private int version;
private String name; // defaults to @Basic
private double revenue; // defaults to @Basic
private Address address; // defaults to @Embedded
@OneToMany(mappedBy="publisher", cascade=CascadeType.PERSIST)
private Collection&lt;Magazine&gt; mags;
@OneToMany(cascade={CascadeType.PERSIST,CascadeType.REMOVE})
private Collection&lt;Subscription&gt; subscriptions;
...
}
@Entity
public class Author {
@Id private long id;
@Version private int version;
private String firstName; // defaults to @Basic
private double lastName; // defaults to @Basic
private Address address; // defaults to @Embedded
@ManyToMany(mappedBy="authors", cascade=CascadeType.PERSIST)
private Collection&lt;Article&gt; arts;
...
}
@Embeddable
public class Address {
private String street; // defaults to @Basic
private String city; // defaults to @Basic
private String state; // defaults to @Basic
private String zip; // defaults to @Basic
...
}
package org.mag.subscribe;
@MappedSuperclass
public abstract class Document {
@Id private long id;
@Version private int version;
...
}
@Entity
public class Contract
extends Document {
private String terms; // defaults to @Basic
...
}
@Entity
public class Subscription {
@Id private long id;
@Version private int version;
private Date startDate; // defaults to @Basic
private double payment; // defaults to @Basic
@OneToMany(cascade={CascadeType.PERSIST,CascadeType.REMOVE})
@MapKey(name="num")
private Map&lt;Long,LineItem&gt; lineItems;
...
@Entity
public static class LineItem
extends Contract {
private String comments; // defaults to @Basic
private double price; // defaults to @Basic
private long num; // defaults to @Basic
@ManyToOne
private Magazine magazine;
...
}
}
@Entity(name="Lifetime")
public class LifetimeSubscription
extends Subscription {
@Basic(fetch=FetchType.LAZY)
private boolean getEliteClub() { ... }
public void setEliteClub(boolean elite) { ... }
...
}
@Entity(name="Trial")
public class TrialSubscription
extends Subscription {
public Date getEndDate() { ... }
public void setEndDate(Date end) { ... }
...
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The same metadata declarations in XML:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e3814">
&lt;entity-mappings&gt;
&lt;!-- declares a default access type for all entities --&gt;
&lt;access-type&gt;FIELD&lt;/access-type&gt;
&lt;mapped-superclass class="org.mag.subscribe.Document"&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;generated-value strategy="IDENTITY"/&gt;
&lt;/id&gt;
&lt;version name="version"/&gt;
&lt;/attributes&gt;
&lt;/mapped-superclass&gt;
&lt;entity class="org.mag.Magazine"&gt;
&lt;id-class="org.mag.Magazine$MagazineId"/&gt;
&lt;attributes&gt;
&lt;id name="isbn"/&gt;
&lt;id name="title"/&gt;
&lt;basic name="name"/&gt;
&lt;basic name="price"/&gt;
&lt;basic name="copiesSold"/&gt;
&lt;version name="version"/&gt;
&lt;many-to-one name="publisher" fetch="LAZY"&gt;
&lt;cascade&gt;
&lt;cascade-persist/&gt;
&lt;/cascade&gt;
&lt;/many-to-one&gt;
&lt;one-to-many name="articles"&gt;
&lt;order-by/&gt;
&lt;cascade&gt;
&lt;cascade-persist/&gt;
&lt;cascade-remove/&gt;
&lt;/cascade&gt;
&lt;/one-to-many&gt;
&lt;one-to-one name="coverArticle" fetch="LAZY"&gt;
&lt;cascade&gt;
&lt;cascade-persist/&gt;
&lt;cascade-remove/&gt;
&lt;/cascade&gt;
&lt;/one-to-one&gt;
&lt;transient name="data"/&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.Article"&gt;
&lt;attributes&gt;
&lt;id name="id"/&gt;
&lt;basic name="title"/&gt;
&lt;basic name="content"/&gt;
&lt;version name="version"/&gt;
&lt;many-to-many name="articles"&gt;
&lt;order-by&gt;lastName, firstName&lt;/order-by&gt;
&lt;/many-to-many&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.pub.Company"&gt;
&lt;attributes&gt;
&lt;id name="id"/&gt;
&lt;basic name="name"/&gt;
&lt;basic name="revenue"/&gt;
&lt;version name="version"/&gt;
&lt;one-to-many name="mags" mapped-by="publisher"&gt;
&lt;cascade&gt;
&lt;cascade-persist/&gt;
&lt;/cascade&gt;
&lt;/one-to-many&gt;
&lt;one-to-many name="subscriptions"&gt;
&lt;cascade&gt;
&lt;cascade-persist/&gt;
&lt;cascade-remove/&gt;
&lt;/cascade&gt;
&lt;/one-to-many&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.pub.Author"&gt;
&lt;attributes&gt;
&lt;id name="id"/&gt;
&lt;basic name="firstName"/&gt;
&lt;basic name="lastName"/&gt;
&lt;version name="version"/&gt;
&lt;many-to-many name="arts" mapped-by="authors"&gt;
&lt;cascade&gt;
&lt;cascade-persist/&gt;
&lt;/cascade&gt;
&lt;/many-to-many&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subcribe.Contract"&gt;
&lt;attributes&gt;
&lt;basic name="terms"/&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subcribe.Subscription"&gt;
&lt;attributes&gt;
&lt;id name="id"/&gt;
&lt;basic name="payment"/&gt;
&lt;basic name="startDate"/&gt;
&lt;version name="version"/&gt;
&lt;one-to-many name="items"&gt;
&lt;map-key name="num"&gt;
&lt;cascade&gt;
&lt;cascade-persist/&gt;
&lt;cascade-remove/&gt;
&lt;/cascade&gt;
&lt;/one-to-many&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.Subscription.LineItem"&gt;
&lt;attributes&gt;
&lt;basic name="comments"/&gt;
&lt;basic name="price"/&gt;
&lt;basic name="num"/&gt;
&lt;many-to-one name="magazine"/&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.LifetimeSubscription" name="Lifetime"
access="PROPERTY"&gt;
&lt;attributes&gt;
&lt;basic name="eliteClub" fetch="LAZY"/&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.TrialSubscription" name="Trial"&gt;
&lt;attributes&gt;
&lt;basic name="endDate"/&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;embeddable class="org.mag.pub.Address"&gt;
&lt;attributes&gt;
&lt;basic name="street"/&gt;
&lt;basic name="city"/&gt;
&lt;basic name="state"/&gt;
&lt;basic name="zip"/&gt;
&lt;/attributes&gt;
&lt;/embeddable&gt;
&lt;/entity-mappings&gt;
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:basic-link internal-destination="jpa_overview_mapping"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 12, <fo:inline font-style="italic">
Mapping Metadata
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping"/>]</fo:inline></fo:basic-link> will show you how to map your
persistent classes to the datastore using additional annotations and XML markup.
First, however, we turn to the JPA runtime APIs.
</fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Persistence
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Persistence
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="jpa_overview_persistence"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 6. 
Persistence
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e3824"><!--
Persistence
--></fo:wrapper><fo:wrapper id="d0e3827"><!--
EntityManagerFactory
,
construction
--></fo:wrapper><fo:wrapper id="d0e3832"><!--
Persistence
,
getEntityManagerFactory
--></fo:wrapper><fo:wrapper id="d0e3837"><!--
getEntityManagerFactory
--></fo:wrapper><fo:block id="d0e3842"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/persistence.png" width="285px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e3846"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA also includes the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/OpenJPAPersistence.html">
<fo:inline font-family="monospace">OpenJPAPersistence</fo:inline></fo:basic-link> helper class to provide
additional utility methods.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Within a container, you will typically use <fo:inline font-style="italic">injection</fo:inline> to
access an <fo:inline font-family="monospace">EntityManagerFactory</fo:inline>. Applications operating
of a container, however, can use the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api/javax/persistence/Persistence.html">
<fo:inline font-family="monospace">Persistence</fo:inline></fo:basic-link> class to obtain <fo:inline font-family="monospace">
EntityManagerFactory</fo:inline> objects in a vendor-neutral fashion.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e3870">
public static EntityManagerFactory createEntityManagerFactory(String name);
public static EntityManagerFactory createEntityManagerFactory(String name, Map props);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Each <fo:inline font-family="monospace">createEntityManagerFactory</fo:inline> method searches the
system for an <fo:inline font-family="monospace">EntityManagerFactory</fo:inline> definition with the
given name. Use <fo:inline font-family="monospace">null</fo:inline> for an unnamed factory. The optional map
contains vendor-specific property settings used to further configure the
factory.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-family="monospace">persistence.xml</fo:inline> files define <fo:inline font-family="monospace">
EntityManagerFactories</fo:inline>. The <fo:inline font-family="monospace">createEntityManagerFactory
</fo:inline> methods search for <fo:inline font-family="monospace">persistence.xml</fo:inline> files
within the <fo:inline font-family="monospace">META-INF</fo:inline> directory of any <fo:inline font-family="monospace">CLASSPATH
</fo:inline> element. For example, if your <fo:inline font-family="monospace">CLASSPATH</fo:inline> contains
the <fo:inline font-family="monospace">conf</fo:inline> directory, you could place an <fo:inline font-family="monospace">
EntityManagerFactory</fo:inline> definition in <fo:inline font-family="monospace">
conf/META-INF/persistence.xml</fo:inline>.
</fo:block><fo:block id="jpa_overview_persistence_xml"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
persistence.xml
</fo:marker><fo:block font-size="20.735999999999997pt">6.1. 
persistence.xml
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">persistence.xml</fo:inline> file format obeys the following
Document Type Descriptor (DTD):
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e3923">
&lt;!ELEMENT persistence (persistence-unit*)&gt;
&lt;!ELEMENT persistence-unit (description?,provider?,jta-data-source?,
non-jta-data-source?,(class|jar-file|mapping-file)*,
exclude-unlisted-classes?,properties?)&gt;
&lt;!ATTLIST persistence-unit name CDATA #REQUIRED&gt;
&lt;!ATTLIST persistence-unit transaction-type (JTA|RESOURCE_LOCAL) "JTA"&gt;
&lt;!ELEMENT description (#PCDATA)&gt;
&lt;!ELEMENT provider (#PCDATA)&gt;
&lt;!ELEMENT jta-data-source (#PCDATA)&gt;
&lt;!ELEMENT non-jta-data-source (#PCDATA)&gt;
&lt;!ELEMENT mapping-file (#PCDATA)&gt;
&lt;!ELEMENT jar-file (#PCDATA)&gt;
&lt;!ELEMENT class (#PCDATA)&gt;
&lt;!ELEMENT exclude-unlisted-classes EMPTY&gt;
&lt;!ELEMENT properties (property*)&gt;
&lt;!ELEMENT property EMPTY&gt;
&lt;!ATTLIST property name CDATA #REQUIRED&gt;
&lt;!ATTLIST property value CDATA #REQUIRED&gt;
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The root element of a <fo:inline font-family="monospace">persistence.xml</fo:inline> file is <fo:inline font-family="monospace">
persistence</fo:inline>, which then contains one or more <fo:inline font-family="monospace">
persistence-unit</fo:inline> definitions. Each persistence unit describes the
configuration for the entity managers created by the persistence unit's entity
manager factory. The persistence unit can specify these elements and attribtues.
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e3936"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3937"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>: This is the name you pass to the <fo:inline font-family="monospace">
Persistence.createEntityManagerFactory</fo:inline> methods described above. The
name attribute is required.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3946"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">transaction-type</fo:inline>: Whether to use managed
(<fo:inline font-family="monospace">JTA</fo:inline>) or local (<fo:inline font-family="monospace">RESOURCE_LOCAL</fo:inline>)
transaction management.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3958"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">provider</fo:inline>: If you are using a third-party JPA vendor, this
element names its implementation of the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api/javax/persistence/spi/PersistenceProvider.html">
<fo:inline font-family="monospace">PersistenceProvider</fo:inline></fo:basic-link> bootstrapping interface.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e3969"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Set the <fo:inline font-family="monospace">provider</fo:inline> to <fo:inline font-family="monospace">
org.apache.openjpa.persistence.PersistenceProviderImpl</fo:inline> to use
OpenJPA.
</fo:block></fo:block></fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3978"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">jta-data-source</fo:inline>: The JNDI name of a JDBC <fo:inline font-family="monospace">
DataSource</fo:inline> that is automatically enlisted in JTA transactions. This
may be an XA <fo:inline font-family="monospace">DataSource</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3990"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">non-jta-data-source</fo:inline>: The JNDI name of a JDBC <fo:inline font-family="monospace">
DataSource</fo:inline> that is not enlisted in JTA transactions.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e3999"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">mapping-file</fo:inline>*: The resource names of XML mapping files for
entities and embeddable classes. You can also specify mapping information in an
<fo:inline font-family="monospace">orm.xml</fo:inline> file in your <fo:inline font-family="monospace">META-INF</fo:inline>
directory. If present, the <fo:inline font-family="monospace">orm.xml</fo:inline> mapping file will be
read automatically.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4014"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">jar-file</fo:inline>*: The names of jar files containing entities and
embeddable classes. The implementation will scan the jar for annotated classes.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4020"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">class</fo:inline>*: The class names of entities and embeddable classes.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4026"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">properties</fo:inline>: This element contains nested <fo:inline font-family="monospace">property
</fo:inline> elements used to specify vendor-specific settings. Each <fo:inline font-family="monospace">
property</fo:inline> has a name attribute and a value attribute.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e4038"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The Reference Guide's <fo:basic-link internal-destination="ref_guide_conf"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 2, <fo:inline font-style="italic">
Configuration
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf"/>]</fo:inline></fo:basic-link> describes OpenJPA's
configuration properties.
</fo:block></fo:block></fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Here is a typical <fo:inline font-family="monospace">persistence.xml</fo:inline> file for a non-EE
environment:
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_persistence_xmlex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 6.1. 
persistence.xml
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e4051">
&lt;?xml version="1.0"?&gt;
&lt;persistence&gt;
&lt;persistence-unit name="openjpa"&gt;
&lt;provider&gt;org.apache.openjpa.persistence.PersistenceProviderImpl&lt;/provider&gt;
&lt;class&gt;tutorial.Animal&lt;/class&gt;
&lt;class&gt;tutorial.Dog&lt;/class&gt;
&lt;class&gt;tutorial.Rabbit&lt;/class&gt;
&lt;class&gt;tutorial.Snake&lt;/class&gt;
&lt;properties&gt;
&lt;property name="openjpa.ConnectionURL" value="jdbc:hsqldb:tutorial_database"/&gt;
&lt;property name="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver"/&gt;
&lt;property name="openjpa.ConnectionUserName" value="sa"/&gt;
&lt;property name="openjpa.ConnectionPassword" value=""/&gt;
&lt;property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO"/&gt;
&lt;/properties&gt;
&lt;/persistence-unit&gt;
&lt;/persistence&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_persistence_use"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Non-EE Use
</fo:marker><fo:block font-size="20.735999999999997pt">6.2. 
Non-EE Use
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The example below demonstrates the <fo:inline font-family="monospace">Persistence</fo:inline> class in
action. You will typically execute code like this on application startup, then
cache the resulting factory for future use. This bootstrapping code is only
necessary in non-EE environments; in an EE environment <fo:inline font-family="monospace">
EntityManagerFactories</fo:inline> are typically injected.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_persistence_getemfactory"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 6.2. 
Obtaining an EntityManagerFactory
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e4067">
// if your persistence.xml file does not contain all settings already, you
// can add vendor settings to a map
Properties props = new Properties();
...
// create the factory defined by the "openjpa" entity-manager entry
EntityManagerFactory emf = Persistence.createEntityManagerFactory("openjpa", props);
</fo:block></fo:block></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
EntityManagerFactory
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
EntityManagerFactory
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="jpa_overview_emfactory"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 7. 
EntityManagerFactory
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e4073"><!--
EntityManagerFactory
--></fo:wrapper><fo:block id="d0e4076"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/entitymanagerfactory.png" width="279px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">EntityManagerFactory</fo:inline> creates <fo:inline font-family="monospace">
EntityManager</fo:inline> instances for application use.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e4088"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA extends the standard <fo:inline font-family="monospace">EntityManagerFactory</fo:inline>
interface with the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/OpenJPAEntityManagerFactory.html">
<fo:inline font-family="monospace">OpenJPAEntityManagerFactory</fo:inline></fo:basic-link> to provide additional
functionality.
</fo:block></fo:block></fo:block><fo:block id="jpa_overview_emfactory_obtain"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Obtaining an EntityManagerFactory
</fo:marker><fo:block font-size="20.735999999999997pt">7.1. 
Obtaining an EntityManagerFactory
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e4102"><!--
EntityManagerFactory
,
construction
--></fo:wrapper><fo:wrapper id="d0e4107"><!--
Java Connector Architecture
--></fo:wrapper><fo:wrapper id="d0e4112"><!--
JCA
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Within a container, you will typically use <fo:inline font-style="italic">injection</fo:inline> to
access an <fo:inline font-family="monospace">EntityManagerFactory</fo:inline>. There are, however,
alternative mechanisms for <fo:inline font-family="monospace">EntityManagerFactory</fo:inline>
construction.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Some vendors may supply public constructors for their <fo:inline font-family="monospace">
EntityManagerFactory</fo:inline> implementations, but we recommend using the
Java Connector Architecture (JCA) in a managed environment, or the <fo:inline font-family="monospace">
Persistence</fo:inline> class' <fo:inline font-family="monospace">createEntityManagerFactory
</fo:inline> methods in an unmanaged environment, as described in
<fo:basic-link internal-destination="jpa_overview_persistence"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 6, <fo:inline font-style="italic">
Persistence
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_persistence"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_persistence"/>]</fo:inline></fo:basic-link>. These strategies allow
vendors to pool factories, cutting down on resource utilization.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e4141"><!--
JNDI
--></fo:wrapper>
JPA allows you to create and configure an <fo:inline font-family="monospace">
EntityManagerFactory</fo:inline>, then store it in a Java Naming and Directory
Interface (JNDI) tree for later retrieval and use.
</fo:block></fo:block><fo:block id="jpa_overview_emfactory_em"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Obtaining EntityManagers
</fo:marker><fo:block font-size="20.735999999999997pt">7.2. 
Obtaining EntityManagers
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e4151"><!--
EntityManager
,
obtaining
--></fo:wrapper><fo:wrapper id="d0e4158"><!--
EntityManagerFactory
,
obtaining EntityManagers
--></fo:wrapper><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e4163">
public EntityManager createEntityManager();
public EntityManager createEntityManager(Map map);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The two <fo:inline font-family="monospace">createEntityManager</fo:inline> methods above create a new
<fo:inline font-family="monospace">EntityManager</fo:inline> each time they are invoked. The optional
<fo:inline font-family="monospace">Map</fo:inline> is used to to supply vendor-specific settings. If you
have configured your implementation for JTA transactions and a JTA transaction
is active, the returned <fo:inline font-family="monospace">EntityManager</fo:inline> will be
synchronized with that transaction.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e4179"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA recognizes the following string keys in the map supplied to <fo:inline font-family="monospace">
createEntityManager</fo:inline>:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e4185"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4186"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">openjpa.ConnectionUserName</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4192"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">openjpa.ConnectionPassword</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4198"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">openjpa.ConnectionRetainMode</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4204"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">openjpa.TransactionMode</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4210"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">openjpa.&lt;property&gt;</fo:inline>, where <fo:inline font-style="italic">&lt;property&gt;
</fo:inline> is any JavaBean property of the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/OpenJPAEntityManager.html">
<fo:inline font-family="monospace">
org.apache.openjpa.persistence.OpenJPAEntityManager</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The last option uses reflection to configure any property of OpenJPA's
<fo:inline font-family="monospace">EntityManager</fo:inline> implementation with the value supplied in
your map. The first options correspond exactly to the same-named OpenJPA
configuration keys described in <fo:basic-link internal-destination="ref_guide_conf"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 2, <fo:inline font-style="italic">
Configuration
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf"/>]</fo:inline></fo:basic-link> of the
Reference Guide.
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_emfactory_perscontext"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Persistence Context
</fo:marker><fo:block font-size="20.735999999999997pt">7.3. 
Persistence Context
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e4234"><!--
persistence context
--></fo:wrapper><fo:wrapper id="d0e4237"><!--
PersistenceContextType
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A persistence context is a set of entities such that for any persistent identity
there is a unique entity instance. Within a persistence context, entities are
<fo:inline font-style="italic">managed</fo:inline>. The <fo:inline font-family="monospace"> EntityManager</fo:inline> controls
their lifecycle, and they can access datastore resources.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When a persistence context ends, previously-managed entities become <fo:inline font-style="italic">
detached</fo:inline>. A detached entity is no longer under the control of the
<fo:inline font-family="monospace">EntityManager</fo:inline>, and no longer has access to datastore
resources. We discuss detachment is detail in
<fo:basic-link internal-destination="jpa_overview_em_lifecycle"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 8.2, “
Entity Lifecycle Management
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_em_lifecycle"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_em_lifecycle"/>]</fo:inline></fo:basic-link>. For now, it is sufficient to
know that detachment as has two obvious consequences:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.2em" id="d0e4260"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4261"><fo:list-item-label end-indent="label-end()"><fo:block>1.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The detached entity cannot load any additional persistent state.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4264"><fo:list-item-label end-indent="label-end()"><fo:block>2.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The <fo:inline font-family="monospace">EntityManager</fo:inline> will not return the detached entity
from <fo:inline font-family="monospace">find</fo:inline>, nor will queries include the detached
entity in their results. Instead, <fo:inline font-family="monospace">find</fo:inline> method
invocations and query executions that would normally incorporate the detached
entity will create a new managed entity with the same identity.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e4276"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA offers several features related to detaching entities. See
<fo:basic-link internal-destination="ref_guide_detach"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 11.1, “
Detach and Attach
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_detach"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_detach"/>]</fo:inline></fo:basic-link> in the Reference Guide.
<fo:basic-link internal-destination="ref_guide_detach_graph"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 11.1.3, “
Defining the Detached Object Graph
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_detach_graph"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_detach_graph"/>]</fo:inline></fo:basic-link> in particular describes how to
use the <fo:inline font-family="monospace">DetachState</fo:inline> setting to boost the performance of
merging detached entities.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Injected <fo:inline font-family="monospace">EntityManager</fo:inline>s have use a <fo:inline font-style="italic">transaction
</fo:inline>, while <fo:inline font-family="monospace"> EntityManager</fo:inline>s obtained through the
<fo:inline font-family="monospace">EntityManagerFactory</fo:inline> have an <fo:inline font-style="italic">extended
</fo:inline> persistence context. We describe these persistence context types
below.
</fo:block><fo:block id="jpa_overview_emfactory_perscontext_trans"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Transaction Persistence Context
</fo:marker><fo:block font-size="17.28pt">7.3.1. 
Transaction Persistence Context
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Under the transaction persistence context model, an <fo:inline font-family="monospace"> EntityManager
</fo:inline> begins a new persistence context with each transaction, and ends
the context when the transaction commits or rolls back. Within the transaction,
entities you retrieve through the <fo:inline font-family="monospace">EntityManager</fo:inline> or via
<fo:inline font-family="monospace">Queries</fo:inline> are managed entities. They can access datastore
resources to lazy-load additional persistent state as needed, and only one
entity may exist for any persistent identity.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When the transaction completes, all entities lose their association with the
<fo:inline font-family="monospace">EntityManager</fo:inline> and become detached. Traversing a
persistent field that wasn't already loaded now has undefined results. And using
the <fo:inline font-family="monospace"> EntityManager</fo:inline> or a <fo:inline font-family="monospace">Query</fo:inline> to
retrieve additional objects may now create new instances with the same
persistent identities as detached instances.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If you use an <fo:inline font-family="monospace">EntityManager</fo:inline> with a transaction
persistence context model outside of an active transaction, each method
invocation creates a new persistence context, performs the method action, and
ends the persistence context. For example, consider using the <fo:inline font-family="monospace">
EntityManager.find</fo:inline> method outside of a transaction. The <fo:inline font-family="monospace">
EntityManager</fo:inline> will create a temporary persistence context, perform
the find operation, end the persistence context, and return the detached result
object to you. A second call with the same id will return a second detached
object.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When the next transaction begins, the <fo:inline font-family="monospace">EntityManager</fo:inline> will
begin a new persistence context, and will again start returning managed
entities. As you'll see in <fo:basic-link internal-destination="jpa_overview_em"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 8, <fo:inline font-style="italic">
EntityManager
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_em"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_em"/>]</fo:inline></fo:basic-link>, you can
also merge the previously-detached entites back into the new persistence
context.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_emfactory_perscontext_transex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.1. 
Behavior of Transaction Persistence Context
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following code illustrates the behavior of entites under an <fo:inline font-family="monospace">
EntityManager</fo:inline> using a transaction persistence context.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e4354">
EntityManager em; // injected
...
// outside a transaction:
// each operation occurs in a separate persistence context, and returns
// a new detached instance
Magazine mag1 = em.find(Magazine.class, magId);
Magazine mag2 = em.find(Magazine.class, magId);
assertTrue(mag2 != mag1);
...
// transaction begins:
// within a transaction, a subsequent lookup doesn't return any of the
// detached objects. however, two lookups within the same transaction
// return the same instance, because the persistence context spans the
// transaction
Magazine mag3 = em.find(Magazine.class, magId);
assertTrue(mag3 != mag1 &amp;&amp; mag3 != mag2);
Magazine mag4 = em.find(Magazine.class (magId);
assertTrue(mag4 == mag3);
...
// transaction commits:
// once again, each operation returns a new instance
Magazine mag5 = em.find(Magazine.class, magId);
assertTrue(mag5 != mag3);
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_emfactory_perscontext_extend"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Extended Persistence Context
</fo:marker><fo:block font-size="17.28pt">7.3.2. 
Extended Persistence Context
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
An <fo:inline font-family="monospace">EntityManager</fo:inline> using an extended persistence context
maintains the same persistence context for its entire lifecycle. Whether inside
a transaction or not, all entities returned from the <fo:inline font-family="monospace">EntityManager
</fo:inline> are managed, and the <fo:inline font-family="monospace">EntityManager</fo:inline> never
creates two entity instances to represent the same persistent identity. Entities
only become detached when you finally close the <fo:inline font-family="monospace">EntityManager
</fo:inline> (or when they are serialized).
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_emfactory_perscontext_extendex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.2. 
Behavior of Extended Persistence Context
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following code illustrates the behavior of entites under an <fo:inline font-family="monospace">
EntityManager</fo:inline> using an extended persistence context.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e4381">
EntityManagerFactory emf = ...
EntityManager em = emf.createEntityManager();
// persistence context active for entire life of EM, so only one entity
// for a given persistent identity
Magazine mag1 = em.find(Magazine.class, magId);
Magazine mag2 = em.find(Magazine.class, magId);
assertTrue(mag2 == mag1);
em.getTransaction().begin();
// same persistence context active within the transaction
Magazine mag3 = em.find(Magazine.class, magId);
assertTrue(mag3 == mag1);
Magazine mag4 = em.find(Magazine.class (magId);
assertTrue(mag4 == mag1);
em.getTransaction.commit ();
// when the transaction commits, instance still managed
Magazine mag5 = em.find(Magazine.class, magId);
assertTrue(mag5 == mag1);
// instance finally becomes detached when EM closes
em.close();
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_emfactory_close"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Closing the EntityManagerFactory
</fo:marker><fo:block font-size="20.735999999999997pt">7.4. 
Closing the EntityManagerFactory
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e4386"><!--
EntityManagerFactory
,
closing
--></fo:wrapper><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e4391">
public boolean isOpen ();
public void close ();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-family="monospace">EntityManagerFactory</fo:inline> instances are heavyweight objects.
Each factory might maintain a metadata cache, object state cache, <fo:inline font-family="monospace">
EntityManager</fo:inline> pool, connection pool, and more. If your application
no longer needs an <fo:inline font-family="monospace">EntityManagerFactory</fo:inline>, you should
close it to free these resources. When an <fo:inline font-family="monospace">EntityManagerFactory
</fo:inline> closes, all <fo:inline font-family="monospace">EntityManager</fo:inline>s from that
factory, and by extension all entities managed by those <fo:inline font-family="monospace">
EntityManager</fo:inline> s, become invalid. Attempting to close an <fo:inline font-family="monospace">
EntityManagerFactory</fo:inline> while one or more of its <fo:inline font-family="monospace">
EntityManager</fo:inline>s has an active transaction may result in an
<fo:inline font-family="monospace">IllegalStateException</fo:inline>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Closing an <fo:inline font-family="monospace">EntityManagerFactory</fo:inline> should not be taken
lightly. It is much better to keep a factory open for a long period of time than
to repeatedly create and close new factories. Thus, most applications will never
close the factory, or only close it when the application is exiting. Only
applications that require multiple factories with different configurations have
an obvious reason to create and close multiple <fo:inline font-family="monospace">EntityManagerFactory
</fo:inline> instances. Once a factory is closed, all methods except
<fo:inline font-family="monospace">isOpen</fo:inline> throw an <fo:inline font-family="monospace">
IllegalStateException</fo:inline>.
</fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
EntityManager
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
EntityManager
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="jpa_overview_em"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 8. 
EntityManager
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e4440"><!--
EntityManager
--></fo:wrapper><fo:block id="d0e4443"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/entitymanager.png" width="189px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The diagram above presents an overview of the <fo:inline font-family="monospace">EntityManager
</fo:inline> interface. For a complete treatment of the <fo:inline font-family="monospace">
EntityManager</fo:inline> API, see the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api/javax/persistence/EntityManager.html">
Javadoc</fo:basic-link> documentation. Methods whose parameter signatures consist of
an ellipsis (...) are overloaded to take multiple parameter types.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e4458"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA extends the standard <fo:inline font-family="monospace">EntityManager</fo:inline> interface with
the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/OpenJPAEntityManager.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.OpenJPAEntityManager</fo:inline>
</fo:basic-link> interface to provide additional functionality.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">EntityManager</fo:inline> is the primary interface used by
application developers to interact with the JPA runtime. The methods
of the <fo:inline font-family="monospace">EntityManager</fo:inline> can be divided into the following
functional categories:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e4478"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4479"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Transaction</fo:inline> association.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4485"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Entity lifecycle management.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4488"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Entity identity management.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4491"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Cache management.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4494"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Query</fo:inline> factory.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4500"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Closing.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block id="jpa_overview_em_trans"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Transaction Association
</fo:marker><fo:block font-size="20.735999999999997pt">8.1. 
Transaction Association
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e4506"><!--
EntityManager
,
obtaining the Transaction
--></fo:wrapper><fo:wrapper id="d0e4513"><!--
Transaction
,
obtaining from EntityManager
--></fo:wrapper><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e4518">
public EntityTransaction getTransaction ();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Every <fo:inline font-family="monospace">EntityManager</fo:inline> has a one-to-one relation with an
<fo:basic-link internal-destination="jpa_overview_trans"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">EntityTransaction</fo:inline>
</fo:inline></fo:basic-link> instance. In fact, many vendors use a single class to implement both the
<fo:inline font-family="monospace">EntityManager</fo:inline> and <fo:inline font-family="monospace">EntityTransaction
</fo:inline> interfaces. If your application requires multiple concurrent
transactions, you will use multiple <fo:inline font-family="monospace">EntityManager</fo:inline>s.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can retrieve the <fo:inline font-family="monospace">EntityTransaction</fo:inline> associated with an
<fo:inline font-family="monospace">EntityManager</fo:inline> through the <fo:inline font-family="monospace">getTransaction
</fo:inline> method. Note that most most JPA implementations can
integrate with an application server's managed transactions. If you take
advantage of this feature, you will control transactions by declarative
demarcation or through the Java Transaction API (JTA) rather than through the
<fo:inline font-family="monospace">EntityTransaction</fo:inline>.
</fo:block></fo:block><fo:block id="jpa_overview_em_lifecycle"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Entity Lifecycle Management
</fo:marker><fo:block font-size="20.735999999999997pt">8.2. 
Entity Lifecycle Management
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e4556"><!--
EntityManager
,
lifecycle operations
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-family="monospace">EntityManager</fo:inline>s perform several actions that affect the
lifecycle state of entity instances.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e4566">
public void persist(Object entity);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e4570"><!--
EntityManager
,
persist
--></fo:wrapper>
<fo:wrapper id="d0e4576"><!--
persist
--></fo:wrapper>
<fo:wrapper id="d0e4582"><!--
persistent objects
,
persisting
--></fo:wrapper>
Transitions new instances to managed. On the next flush or commit, the newly
persisted instances will be inserted into the datastore.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
For a given entity <fo:inline font-family="monospace">A</fo:inline>, the <fo:inline font-family="monospace">persist</fo:inline>
method behaves as follows:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e4596"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4597"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If <fo:inline font-family="monospace">A</fo:inline> is a new entity, it becomes managed.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4603"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If <fo:inline font-family="monospace">A</fo:inline> is an existing managed entity, it is ignored. However,
the persist operation cascades as defined below.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4609"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If <fo:inline font-family="monospace">A</fo:inline> is a removed entity, it becomes managed.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4615"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If <fo:inline font-family="monospace">A</fo:inline> is a detached entity, an <fo:inline font-family="monospace">
IllegalArgumentException</fo:inline> is thrown.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4624"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The persist operation recurses on all relation fields of <fo:inline font-family="monospace">A</fo:inline>
whose <fo:basic-link internal-destination="jpa_overview_meta_cascade"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">cascades</fo:inline></fo:basic-link> include
<fo:inline font-family="monospace">CascadeType.PERSIST</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This action can only be used in the context of an active transaction.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e4638">
public void remove(Object entity);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e4642"><!--
EntityManager
,
remove
--></fo:wrapper>
<fo:wrapper id="d0e4648"><!--
remove
--></fo:wrapper>
<fo:wrapper id="d0e4654"><!--
persistent objects
,
deleting
--></fo:wrapper>
Transitions managed instances to removed. The instances will be deleted from the
datastore on the next flush or commit. Accessing a removed entity has undefined
results.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
For a given entity <fo:inline font-family="monospace">A</fo:inline>, the <fo:inline font-family="monospace">remove</fo:inline>
method behaves as follows:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e4668"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4669"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If <fo:inline font-family="monospace">A</fo:inline> is a new entity, it is ignored. However, the remove
operation cascades as defined below.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4675"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If <fo:inline font-family="monospace">A</fo:inline> is an existing managed entity, it becomes removed.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4681"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If <fo:inline font-family="monospace">A</fo:inline> is a removed entity, it is ignored.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4687"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If <fo:inline font-family="monospace">A</fo:inline> is a detached entity, an <fo:inline font-family="monospace">
IllegalArgumentException</fo:inline> is thrown.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4696"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The remove operation recurses on all relation fields of <fo:inline font-family="monospace">A</fo:inline>
whose <fo:basic-link internal-destination="jpa_overview_meta_cascade"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">cascades</fo:inline></fo:basic-link> include
<fo:inline font-family="monospace">CascadeType.REMOVE</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This action can only be used in the context of an active transaction.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e4710">
public void refresh(Object entity);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e4714"><!--
EntityManager
,
refresh
--></fo:wrapper>
<fo:wrapper id="d0e4720"><!--
refresh
--></fo:wrapper>
<fo:wrapper id="d0e4726"><!--
persistent objects
,
refreshing state
--></fo:wrapper>
<fo:wrapper id="d0e4732"><!--
transactions
,
optimistic
--></fo:wrapper>
Use the <fo:inline font-family="monospace">refresh</fo:inline> action to make sure the persistent
state of an instance is synchronized with the values in the datastore.
<fo:inline font-family="monospace">refresh</fo:inline> is intended for long-running optimistic
transactions in which there is a danger of seeing stale data.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
For a given entity <fo:inline font-family="monospace">A</fo:inline>, the <fo:inline font-family="monospace">refresh</fo:inline>
method behaves as follows:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e4752"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4753"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If <fo:inline font-family="monospace">A</fo:inline> is a new entity, it is ignored. However, the refresh
operation cascades as defined below.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4759"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If <fo:inline font-family="monospace">A</fo:inline> is an existing managed entity, its state is refreshed
from the datastore.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4765"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If <fo:inline font-family="monospace">A</fo:inline> is a removed entity, it is ignored.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4771"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If <fo:inline font-family="monospace">A</fo:inline> is a detached entity, an <fo:inline font-family="monospace">
IllegalArgumentException</fo:inline> is thrown.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4780"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The refresh operation recurses on all relation fields of <fo:inline font-family="monospace">A</fo:inline>
whose <fo:basic-link internal-destination="jpa_overview_meta_cascade"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">cascades</fo:inline></fo:basic-link> include
<fo:inline font-family="monospace">CascadeType.REFRESH</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e4792">
public Object merge(Object entity);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e4796"><!--
EntityManager
,
merge
--></fo:wrapper>
<fo:wrapper id="d0e4804"><!--
detachment
,
JPA
--></fo:wrapper>
<fo:wrapper id="d0e4810"><!--
merge
--></fo:wrapper>
<fo:wrapper id="d0e4816"><!--
data transfer object
--></fo:wrapper>
<fo:wrapper id="d0e4820"><!--
value object
--></fo:wrapper>
A common use case for an application running in a servlet or application server
is to "detach" objects from all server resources, modify them, and then "attach"
them again. For example, a servlet might store persistent data in a user session
between a modification based on a series of web forms. Between each form
request, the web container might decide to serialize the session, requiring that
the stored persistent state be disassociated from any other resources.
Similarly, a client/server application might transfer persistent objects to a
client via serialization, allow the client to modify their state, and then have
the client return the modified data in order to be saved. This is sometimes
referred to as the <fo:inline font-style="italic">data transfer object</fo:inline> or <fo:inline font-style="italic">value
object</fo:inline> pattern, and it allows fine-grained manipulation of data
objects without incurring the overhead of multiple remote method invocations.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA provides support for this pattern by automatically detaching
entities when they are serialized or when a persistence context ends (see
<fo:basic-link internal-destination="jpa_overview_emfactory_perscontext"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.3, “
Persistence Context
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_emfactory_perscontext"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_emfactory_perscontext"/>]</fo:inline></fo:basic-link> for an exploration of
persistence contexts). The JPA <fo:inline font-style="italic">merge</fo:inline> API
re-attaches detached entities. This allows you to detach a persistent instance,
modify the detached instance offline, and merge the instance back into an
<fo:inline font-family="monospace">EntityManager</fo:inline> (either the same one that detached the
instance, or a new one). The changes will then be applied to the existing
instance from the datastore.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A detached entity maintains its persistent identity, but cannot load additional
state from the datastore. Accessing any persistent field or property that was
not loaded at the time of detachment has undefined results. Also, be sure not to
alter the version or identity fields of detached instances if you plan on
merging them later.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">merge</fo:inline> method returns a managed copy of the given
detached entity. Changes made to the persistent state of the detached entity are
applied to this managed instance. Because merging involves changing persistent
state, you can only merge within a transaction.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If you attempt to merge an instance whose representation has changed in the
datastore since detachment, the merge operation will throw an exception, or the
transaction in which you perform the merge will fail on commit, just as if a
normal optimistic conflict were detected.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e4849"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA offers enhancements to JPA detachment functionality,
including additional options to control which fields are detached. See
<fo:basic-link internal-destination="ref_guide_detach"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 11.1, “
Detach and Attach
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_detach"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_detach"/>]</fo:inline></fo:basic-link> in the Reference Guide for details.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
For a given entity <fo:inline font-family="monospace">A</fo:inline>, the <fo:inline font-family="monospace">merge</fo:inline>
method behaves as follows:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e4862"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4863"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If <fo:inline font-family="monospace">A</fo:inline> is a detached entity, its state is copied into existing
managed instance <fo:inline font-family="monospace">A'</fo:inline> of the same entity identity, or a new
managed copy of <fo:inline font-family="monospace">A</fo:inline> is created.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4875"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If <fo:inline font-family="monospace">A</fo:inline> is a new entity, a new managed entity <fo:inline font-family="monospace">A'
</fo:inline> is created and the state of <fo:inline font-family="monospace">A</fo:inline> is copied into
<fo:inline font-family="monospace">A'</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4890"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If <fo:inline font-family="monospace">A</fo:inline> is an existing managed entity, it is ignored. However,
the merge operation still cascades as defined below.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4896"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If <fo:inline font-family="monospace">A</fo:inline> is a removed entity, an <fo:inline font-family="monospace">
IllegalArgumentException</fo:inline> is thrown.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4905"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The merge operation recurses on all relation fields of <fo:inline font-family="monospace">A</fo:inline>
whose <fo:basic-link internal-destination="jpa_overview_meta_cascade"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">cascades</fo:inline></fo:basic-link> include
<fo:inline font-family="monospace">CascadeType.MERGE</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e4917">
public void lock (Object entity, LockModeType mode);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e4921"><!--
EntityManager
,
lock
--></fo:wrapper>
<fo:wrapper id="d0e4927"><!--
locking
--></fo:wrapper>
This method locks the given entity using the named mode. The
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api/javax/persistence/LockmodeType.html">
<fo:inline font-family="monospace">javax.persistence.LockModeType</fo:inline></fo:basic-link> enum defines two
modes:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e4938"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4939"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">READ</fo:inline>: Other transactions may concurrently read the object,
but cannot concurrently update it.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e4945"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">WRITE</fo:inline>: Other transactions cannot concurrently read or write
the object. When a transaction is committed that holds WRITE locks on any
entites, those entites will have their version incremented even if the entities
themselves did not change in the transaction.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e4951"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA has additional APIs for controlling object locking. See
<fo:basic-link internal-destination="ref_guide_locking"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 9.3, “
Object Locking
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_locking"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_locking"/>]</fo:inline></fo:basic-link> in the Reference Guide for details.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following diagram illustrates the lifecycle of an entity with respect to the
APIs presented in this section.
</fo:block><fo:block id="d0e4958"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/jpa-state-transitions.png" width="297px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block></fo:block><fo:block id="jpa_overview_em_lifeexamples"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Lifecycle Examples
</fo:marker><fo:block font-size="20.735999999999997pt">8.3. 
Lifecycle Examples
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The examples below demonstrate how to use the lifecycle methods presented in the
previous section. The examples are appropriate for out-of-container use. Within
a container, <fo:inline font-family="monospace"> EntityManager</fo:inline>s are usually injected, and
transactions are usually managed. You would therefore omit the <fo:inline font-family="monospace">
createEntityManager</fo:inline> and <fo:inline font-family="monospace">close</fo:inline> calls, as
well as all transaction demarcation code.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_em_lifecycle_persist"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 8.1. 
Persisting Objects
</fo:block><fo:wrapper id="d0e4979"><!--
persistent objects
,
persisting
,
example
--></fo:wrapper><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e4986">
// create some objects
Magazine mag = new Magazine("1B78-YU9L", "JavaWorld");
Company pub = new Company("Weston House");
pub.setRevenue(1750000D);
mag.setPublisher(pub);
pub.addMagazine(mag);
Article art = new Article("JPA Rules!", "Transparent Object Persistence");
art.addAuthor(new Author("Fred", "Hoyle"));
mag.addArticle(art);
// persist
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
em.persist(mag);
em.persist(pub);
em.persist(art);
em.getTransaction().commit();
// or we could continue using the EntityManager...
em.close();
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_em_lifecycle_update"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 8.2. 
Updating Objects
</fo:block><fo:wrapper id="d0e4991"><!--
persistent objects
,
updating
,
example
--></fo:wrapper><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e4998">
Magazine.MagazineId mi = new Magazine.MagazineId();
mi.isbn = "1B78-YU9L";
mi.title = "JavaWorld";
// updates should always be made within transactions; note that
// there is no code explicitly linking the magazine or company
// with the transaction; JPA automatically tracks all changes
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
Magazine mag = em.find(Magazine.class, mi);
mag.setPrice(5.99);
Company pub = mag.getPublisher();
pub.setRevenue(1750000D);
em.getTransaction().commit();
// or we could continue using the EntityManager...
em.close();
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_em_lifecycle_delete"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 8.3. 
Removing Objects
</fo:block><fo:wrapper id="d0e5003"><!--
persistent objects
,
deleting
,
example
--></fo:wrapper><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5010">
// assume we have an object id for the company whose subscriptions
// we want to delete
Object oid = ...;
// deletes should always be made within transactions
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
Company pub = (Company) em.find(Company.class, oid);
for (Subscription sub : pub.getSubscriptions())
em.remove(sub);
pub.getSubscriptions().clear();
em.getTransaction().commit();
// or we could continue using the EntityManager...
em.close();
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_em_detachex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 8.4. 
Detaching and Merging
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This example demonstrates a common client/server scenario. The client requests
objects and makes changes to them, while the server handles the object lookups
and transactions.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5017">
// CLIENT:
// requests an object with a given oid
Record detached = (Record) getFromServer(oid);
...
// SERVER:
// send object to client; object detaches on EM close
Object oid = processClientRequest();
EntityManager em = emf.createEntityManager();
Record record = em.find(Record.class, oid);
em.close();
sendToClient(record);
...
// CLIENT:
// makes some modifications and sends back to server
detached.setSomeField("bar");
sendToServer(detached);
...
// SERVER:
// merges the instance and commit the changes
Record modified = (Record) processClientRequest();
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
Record merged = (Record) em.merge(modified);
merged.setLastModified(System.currentTimeMillis());
merged.setModifier(getClientIdentityCode());
em.getTransaction().commit();
em.close();
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_em_identity"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Entity Identity Management
</fo:marker><fo:block font-size="20.735999999999997pt">8.4. 
Entity Identity Management
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Each <fo:inline font-family="monospace">EntityManager</fo:inline> is responsible for managing the
persistent identities of the managed objects in the persistence context. The
following methods allow you to interact with the management of persistent
identities. The behavior of these methods is deeply affected by the persistence
context type of the <fo:inline font-family="monospace">EntityManager</fo:inline>; see
<fo:basic-link internal-destination="jpa_overview_emfactory_perscontext"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.3, “
Persistence Context
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_emfactory_perscontext"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_emfactory_perscontext"/>]</fo:inline></fo:basic-link> for an explanation of
persistence contexts.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5032">
public &lt;T&gt; T find(Class&lt;T&gt; cls, Object oid);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e5036"><!--
EntityManager
,
find
--></fo:wrapper>
<fo:wrapper id="d0e5044"><!--
find
--></fo:wrapper>
<fo:wrapper id="d0e5050"><!--
identity
,
retrieving objects by identity
--></fo:wrapper>
This method returns the persistent instance of the given type with the given
persistent identity. If the instance is already present in the current
persistence context, the cached version will be returned. Otherwise, a new
instance will be constructed and loaded with state from the datastore. If no
entity with the given type and identity exists in the datastore, this method
returns null.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5056">
public &lt;T&gt; T getReference(Class&lt;T&gt; cls, Object oid);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e5060"><!--
EntityManager
,
getReference
--></fo:wrapper>
<fo:wrapper id="d0e5068"><!--
getReference
--></fo:wrapper>
<fo:wrapper id="d0e5074"><!--
identity
,
retrieving objects by identity
--></fo:wrapper>
<fo:wrapper id="d0e5080"><!--
EntityNotFoundException
--></fo:wrapper>
This method is similar to <fo:inline font-family="monospace">find</fo:inline>, but does not
necessarily go to the database when the entity is not found in cache. The
implementation may construct a <fo:inline font-style="italic">hollow</fo:inline> entity and return it
to you instead. Hollow entities do not have any state loaded. The state only
gets loaded when you attempt to access a persistent field. At that time, the
implementation may throw an <fo:inline font-family="monospace">EntityNotFoundException</fo:inline> if it
discovers that the entity does not exist in the datastore. The implementation
may also throw an <fo:inline font-family="monospace">EntityNotFoundException</fo:inline> from the
<fo:inline font-family="monospace">getReference</fo:inline> method itself. Unlike <fo:inline font-family="monospace">
find</fo:inline>, <fo:inline font-family="monospace">getReference</fo:inline> does not return null.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5105">
public boolean contains(Object entity);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e5109"><!--
EntityManager
,
contains
--></fo:wrapper>
<fo:wrapper id="d0e5115"><!--
contains
--></fo:wrapper>
Returns true if the given entity is part of the current persistence context, and
false otherwise. Removed entities are not considered part of the current
persistence context.
</fo:block></fo:block><fo:block id="jpa_overview_em_cache"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Cache Management
</fo:marker><fo:block font-size="20.735999999999997pt">8.5. 
Cache Management
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e5124"><!--
EntityManager
,
cache
--></fo:wrapper><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5129">
public void flush();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e5133"><!--
EntityManager
,
flush
--></fo:wrapper>
<fo:wrapper id="d0e5139"><!--
flush
--></fo:wrapper>
<fo:wrapper id="d0e5145"><!--
transactions
,
flushing changes before commit
--></fo:wrapper>
The <fo:inline font-family="monospace">flush</fo:inline> method writes any changes that have been made
in the current transaction to the datastore. If the <fo:inline font-family="monospace">EntityManager
</fo:inline> does not already have a connection to the datastore, it obtains one
for the flush and retains it for the duration of the transaction. Any exceptions
during flush cause the transaction to be marked for rollback. See
<fo:basic-link internal-destination="jpa_overview_trans"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 9, <fo:inline font-style="italic">
Transaction
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_trans"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_trans"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Flushing requires an active transaction. If there isn't a transaction in
progress, the <fo:inline font-family="monospace">flush</fo:inline> method throws a <fo:inline font-family="monospace">
TransactionRequiredException</fo:inline>.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5167">
public FlushModeType getFlushMode();
public void setFlushMode(FlushModeType flushMode);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e5171"><!--
EntityManager
,
FlushMode
--></fo:wrapper>
<fo:wrapper id="d0e5177"><!--
FlushMode
--></fo:wrapper>
The <fo:inline font-family="monospace">EntityManager</fo:inline>'s <fo:inline font-family="monospace">FlushMode</fo:inline> property
controls whether to flush transactional changes before executing queries. This
allows the query results to take into account changes you have made during the
current transaction. Available
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api/javax/persistence/FlushModeType.html">
<fo:inline font-family="monospace">javax.persistence.FlushModeType</fo:inline></fo:basic-link> constants are:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e5192"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e5193"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">COMMIT</fo:inline>: Only flush when committing, or when told to do so
through the <fo:inline font-family="monospace">flush</fo:inline> method. Query results may not take
into account changes made in the current transaction.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e5202"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">AUTO</fo:inline>: The implementation is permitted to flush before
queries to ensure that the results reflect the most recent object state.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can also set the flush mode on individual
<fo:basic-link internal-destination="jpa_overview_query"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">Query</fo:inline></fo:inline></fo:basic-link>
instances.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e5214"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA only flushes before a query if the query might be affected by data
changed in the current transaction. Additionally, OpenJPA allows fine-grained
control over flushing behavior. See the Reference Guide's
<fo:basic-link internal-destination="ref_guide_dbsetup_retain"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.8, “
Configuring the Use of JDBC Connections
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_retain"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_retain"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5219">
public void clear();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e5223"><!--
EntityManager
,
clear
--></fo:wrapper>
<fo:wrapper id="d0e5229"><!--
clear
--></fo:wrapper>
Clearing the <fo:inline font-family="monospace">EntityManager</fo:inline> effectively ends the
persistence context. All entities managed by the <fo:inline font-family="monospace">EntityManager
</fo:inline> become detached.
</fo:block></fo:block><fo:block id="jpa_overview_em_query"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Query Factory
</fo:marker><fo:block font-size="20.735999999999997pt">8.6. 
Query Factory
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e5244"><!--
EntityManager
,
as Query factory
--></fo:wrapper><fo:wrapper id="d0e5251"><!--
Query
,
creating
--></fo:wrapper><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5256">
public Query createQuery(String query);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-family="monospace">Query</fo:inline> objects are used to find entities matching certain
criteria. The <fo:inline font-family="monospace">createQuery</fo:inline> method creates a query using
the given Java Persistence Query Language (JPQL) string. See
<fo:basic-link internal-destination="jpa_overview_query"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 10, <fo:inline font-style="italic">
JPA Query
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_query"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_query"/>]</fo:inline></fo:basic-link> for details.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5268">
public Query createNamedQuery(String name);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This method retrieves a query defined in metadata by name. The returned
<fo:inline font-family="monospace">Query</fo:inline> instance is initialized with the information
declared in metadata. For more information on named queries, read
<fo:basic-link internal-destination="jpa_overview_query_named"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.1.10, “
Named Queries
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_query_named"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_query_named"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5277">
public Query createNativeQuery(String sql);
public Query createNativeQuery(String sql, Class resultCls);
public Query createNativeQuery(String sql, String resultMapping);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">Native</fo:inline> queries are queries in the datastore's native
language. For relational databases, this the Structured Query Language (SQL).
<fo:basic-link internal-destination="jpa_overview_sqlquery"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 11, <fo:inline font-style="italic">
SQL Queries
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_sqlquery"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_sqlquery"/>]</fo:inline></fo:basic-link> elaborates on JPA's
native query support.
</fo:block></fo:block><fo:block id="jpa_overview_em_closing"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Closing
</fo:marker><fo:block font-size="20.735999999999997pt">8.7. 
Closing
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e5289"><!--
EntityManager
,
closing
--></fo:wrapper><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5294">
public boolean isOpen();
public void close();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When an <fo:inline font-family="monospace">EntityManager</fo:inline> is no longer needed, you should
call its <fo:inline font-family="monospace">close</fo:inline> method. Closing an <fo:inline font-family="monospace">
EntityManager</fo:inline> releases any resources it is using. The persistence
context ends, and the entities managed by the <fo:inline font-family="monospace">EntityManager
</fo:inline> become detached. Any <fo:inline font-family="monospace">Query</fo:inline> instances the
<fo:inline font-family="monospace">EntityManager</fo:inline> created become invalid. Calling any method
other than <fo:inline font-family="monospace">isOpen</fo:inline> on a closed <fo:inline font-family="monospace">EntityManager
</fo:inline> results in an <fo:inline font-family="monospace">IllegalStateException</fo:inline>. You
cannot close a <fo:inline font-family="monospace">EntityManager</fo:inline> that is in the middle of a
transaction.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If you are in a managed environment using injected entity managers, you should
not close them.
</fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Transaction
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Transaction
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="jpa_overview_trans"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 9. 
Transaction
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e5334"><!--
transactions
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Transactions are critical to maintaining data integrity. They are used to group
operations into units of work that act in an all-or-nothing fashion.
Transactions have the following qualities:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e5341"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e5342"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e5345"><!--
atomicity
--></fo:wrapper>
<fo:wrapper id="d0e5351"><!--
transactions
,
atomicity
--></fo:wrapper>
<fo:inline font-style="italic">Atomicity</fo:inline>. Atomicity refers to the all-or-nothing property
of transactions. Either every data update in the transaction completes
successfully, or they all fail, leaving the datastore in its original state. A
transaction cannot be only partially successful.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e5360"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e5363"><!--
consistency
--></fo:wrapper>
<fo:wrapper id="d0e5369"><!--
transactions
,
consistency
--></fo:wrapper>
<fo:inline font-style="italic">Consistency</fo:inline>. Each transaction takes the datastore from one
consistent state to another consistent state.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e5378"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e5381"><!--
isolation
--></fo:wrapper>
<fo:wrapper id="d0e5387"><!--
transactions
,
isolation
--></fo:wrapper>
<fo:inline font-style="italic">Isolation</fo:inline>. Transactions are isolated from each other. When
you are reading persistent data in one transaction, you cannot "see" the changes
that are being made to that data in other transactions. Similarly, the updates
you make in one transaction cannot conflict with updates made in concurrent
transactions. The form of conflict resolution employed depends on whether you
are using pessimistic or optimistic transactions. Both types are described later
in this chapter.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e5396"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e5399"><!--
durability
--></fo:wrapper>
<fo:wrapper id="d0e5405"><!--
transactions
,
durability
--></fo:wrapper>
<fo:inline font-style="italic">Durability</fo:inline>. The effects of successful transactions are
durable; the updates made to persistent data last for the lifetime of the
datastore.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e5416"><!--
ACID
--></fo:wrapper>
<fo:wrapper id="d0e5422"><!--
transactions
,
ACID
--></fo:wrapper>
Together, these qualities are called the ACID properties of transactions. To
understand why these properties are so important to maintaining data integrity,
consider the following example:
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Suppose you create an application to manage bank accounts. The application
includes a method to transfer funds from one user to another, and it looks
something like this:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5430">
public void transferFunds(User from, User to, double amnt) {
from.decrementAccount(amnt);
to.incrementAccount(amnt);
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Now suppose that user Alice wants to transfer 100 dollars to user Bob. No
problem; you simply invoke your <fo:inline font-family="monospace">transferFunds</fo:inline> method,
supplying Alice in the <fo:inline font-family="monospace">from</fo:inline> parameter, Bob in the <fo:inline font-family="monospace">
to</fo:inline> parameter, and <fo:inline font-family="monospace">100.00</fo:inline> as the <fo:inline font-family="monospace">amnt
</fo:inline>. The first line of the method is executed, and 100 dollars is
subtracted from Alice's account. But then, something goes wrong. An unexpected
exception occurs, or the hardware fails, and your method never completes.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You are left with a situation in which the 100 dollars has simply disappeared.
Thanks to the first line of your method, it is no longer in Alice's account, and
yet it was never transferred to Bob's account either. The datastore is in an
inconsistent state.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The importance of transactions should now be clear. If the two lines of the
<fo:inline font-family="monospace">transferFunds</fo:inline> method had been placed together in a
transaction, it would be impossible for only the first line to succeed. Either
the funds would be transferred properly or they would not be transferred at all,
and an exception would be thrown. Money could never vanish into thin air, and
the data store could never get into an inconsistent state.
</fo:block><fo:block id="jpa_overview_trans_types"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Transaction Types
</fo:marker><fo:block font-size="20.735999999999997pt">9.1. 
Transaction Types
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e5459"><!--
transactions
,
types
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
There are two major types of transactions: pessimistic transactions and
optimistic transactions. Each type has both advantages and disadvantages.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e5468"><!--
transactions
,
pessimistic
--></fo:wrapper>
<fo:wrapper id="d0e5474"><!--
pessimistic transactions
--></fo:wrapper>
<fo:wrapper id="d0e5480"><!--
deadlock
--></fo:wrapper>
Pessimistic transactions generally lock the datastore records they act on,
preventing other concurrent transactions from using the same data. This avoids
conflicts between transactions, but consumes database resources. Additionally,
locking records can result in <fo:inline font-style="italic">deadlock</fo:inline>, a situation in
which two transactions are both waiting for the other to release its locks
before completing. The results of a deadlock are datastore-dependent; usually
one transaction is forcefully rolled back after some specified timeout interval,
and an exception is thrown.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e5491"><!--
transactions
,
datastore
--></fo:wrapper>
<fo:wrapper id="d0e5497"><!--
datastore transactions
--></fo:wrapper>
This document will often use the term <fo:inline font-style="italic">datastore</fo:inline> transaction
in place of <fo:inline font-style="italic">pessimistic</fo:inline> transaction. This is to acknowledge
that some datastores do not support pessimistic semantics, and that the exact
meaning of a non-optimistic JPA transaction is dependent on the datastore. Most
of the time, a datastore transaction is equivalent to a pessimistic transaction.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e5511"><!--
transactions
,
optimistic
--></fo:wrapper>
<fo:wrapper id="d0e5517"><!--
optimistic transactions
--></fo:wrapper>
Optimistic transactions consume less resources than pessimistic/datastore
transactions, but only at the expense of reliability. Because optimistic
transactions do not lock datastore records, two transactions might change the
same persistent information at the same time, and the conflict will not be
detected until the second transaction attempts to flush or commit. At this time,
the second transaction will realize that another transaction has concurrently
modified the same records (usually through a timestamp or versioning system),
and will throw an appropriate exception. Note that optimistic transactions still
maintain data integrity; they are simply more likely to fail in heavily
concurrent situations.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Despite their drawbacks, optimistic transactions are the best choice for most
applications. They offer better performance, better scalability, and lower risk
of hanging due to deadlock.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e5525"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA uses optimistic semantics by default, but supports both optimistic and
datastore transactions. OpenJPA also offers advanced locking and versioning APIs
for fine-grained control over database resource allocation and object
versioning. See <fo:basic-link internal-destination="ref_guide_locking"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 9.3, “
Object Locking
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_locking"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_locking"/>]</fo:inline></fo:basic-link> of the Reference Guide for
details on locking. <fo:basic-link internal-destination="jpa_overview_meta_version"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.5, “
Version
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_version"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_version"/>]</fo:inline></fo:basic-link>
of this document covers standard object versioning, while
<fo:basic-link internal-destination="ref_guide_mapping_jpa"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.7, “
Additional JPA Mappings
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_jpa"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_jpa"/>]</fo:inline></fo:basic-link> of the Reference Guide discusses
additional versioning strategies available in OpenJPA.
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_trans_local"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
The EntityTransaction Interface
</fo:marker><fo:block font-size="20.735999999999997pt">9.2. 
The EntityTransaction Interface
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e5537"><!--
Transaction
--></fo:wrapper><fo:block id="d0e5542"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/jpa-transaction.png" width="129px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA integrates with your container's <fo:inline font-style="italic">managed</fo:inline> transactions,
allowing you to use the container's declarative transaction demarcation and its
Java Transaction API (JTA) implementation for transaction management. Outside of
a container, though, you must demarcate transactions manually through JPA. The
<fo:inline font-family="monospace">EntityTransaction</fo:inline> interface controls unmanaged
transactions in JPA.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5554">
public void begin();
public void commit();
public void rollback();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e5558"><!--
Transaction
,
demarcation
--></fo:wrapper>
<fo:wrapper id="d0e5564"><!--
transactions
,
demarcating
--></fo:wrapper>
<fo:wrapper id="d0e5570"><!--
Transaction
,
begin
--></fo:wrapper>
<fo:wrapper id="d0e5576"><!--
Transaction
,
commit
--></fo:wrapper>
<fo:wrapper id="d0e5582"><!--
Transaction
,
rollback
--></fo:wrapper>
The <fo:inline font-family="monospace">begin</fo:inline>, <fo:inline font-family="monospace">commit</fo:inline>, and
<fo:inline font-family="monospace">rollback</fo:inline> methods demarcate transaction boundaries. The
methods should be self-explanatory: <fo:inline font-family="monospace">begin</fo:inline> starts a
transaction, <fo:inline font-family="monospace">commit</fo:inline> attempts to commit the
transaction's changes to the datastore, and <fo:inline font-family="monospace">rollback</fo:inline>
aborts the transaction, in which case the datastore is "rolled back" to its
previous state. JPA implementations will automatically roll back transactions if
any exception is thrown during the commit process.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Unless you are using an extended persistence context, committing or rolling back
also ends the persistence context. All managed entites will be detached from the
<fo:inline font-family="monospace">EntityManager</fo:inline>.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5611">
public boolean isActive();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e5615"><!--
Transaction
,
isActive
--></fo:wrapper>
Finally, the <fo:inline font-family="monospace">isActive</fo:inline> method returns <fo:inline font-family="monospace">true
</fo:inline> if the transaction is in progress (<fo:inline font-family="monospace">begin</fo:inline>
has been called more recently than <fo:inline font-family="monospace">commit</fo:inline> or
<fo:inline font-family="monospace">rollback</fo:inline>), and <fo:inline font-family="monospace">false</fo:inline> otherwise.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_trans_group"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 9.1. 
Grouping Operations with Transactions
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5642">
public void transferFunds(EntityManager em, User from, User to, double amnt) {
// note: it would be better practice to move the transaction demarcation
// code out of this method, but for the purposes of example...
Transaction trans = em.getTransaction();
trans.begin();
try
{
from.decrementAccount(amnt);
to.incrementAccount(amnt);
trans.commit();
}
catch (RuntimeException re)
{
if (trans.isActive())
trans.rollback(); // or could attempt to fix error and retry
throw re;
}
}
</fo:block></fo:block></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
JPA Query
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
JPA Query
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="jpa_overview_query"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 10. 
JPA Query
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e5648"><!--
JP Query
--></fo:wrapper><fo:wrapper id="d0e5653"><!--
queries
--></fo:wrapper><fo:block id="d0e5658"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/jpa-query.png" width="195px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">javax.persistence.Query</fo:inline> interface is the mechanism
for issuing queries in JPA. The primary query language used is the Java
Persistence Query Language, or <fo:inline font-family="monospace">JPQL</fo:inline>. JPQL is syntactically
very similar to SQL, but is object-oriented rather than table-oriented.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The API for executing JPQL queries will be discussed in
<fo:basic-link internal-destination="jpa_query_api"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.1, “
JPQL API
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_query_api"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_query_api"/>]</fo:inline></fo:basic-link>, and a full language reference will be
covered in <fo:basic-link internal-destination="jpa_langref"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.2, “
JPQL Language Reference
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_langref"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_langref"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block id="jpa_query_api"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
JPQL API
</fo:marker><fo:block font-size="20.735999999999997pt">10.1. 
JPQL API
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_query_basic"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Query Basics
</fo:marker><fo:block font-size="17.28pt">10.1.1. 
Query Basics
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5682">SELECT x FROM Magazine x
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The preceding is a simple JPQL query for all <fo:inline font-family="monospace">Magazine</fo:inline>
entities.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5689">
public Query createQuery(String jpql);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api/javax/persistence/EntityManager.html">
<fo:inline font-family="monospace">EntityManager.createQuery</fo:inline></fo:basic-link> method creates a
<fo:inline font-family="monospace">Query</fo:inline> instance from a given JPQL string.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5701">
public List getResultList();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Invoking
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api/javax/persistence/Query.html#getResultList()">
<fo:inline font-family="monospace">Query.getResultList</fo:inline></fo:basic-link> executes the query and
returns a <fo:inline font-family="monospace">List</fo:inline> containing the matching objects. The
following example executes our <fo:inline font-family="monospace">Magazine</fo:inline> query above:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5716">
EntityManager em = ...
Query q = em.createQuery("SELECT x FROM Magazine x");
List&lt;Magazine&gt; results = (List&lt;Magazine&gt;) q.getResultList();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A JPQL query has an internal namespace declared in the <fo:inline font-family="monospace">from</fo:inline>
clause of the query. Arbitrary identifiers are assigned to entities so that they
can be referenced elsewhere in the query. In the query example above, the
identifier <fo:inline font-family="monospace">x</fo:inline> is assigned to the entity <fo:inline font-family="monospace"> Magazine
</fo:inline>.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e5729"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">as</fo:inline> keyword can optionally be used when declaring
identifiers in the <fo:inline font-family="monospace">from</fo:inline> clause. <fo:inline font-family="monospace">SELECT x FROM
Magazine x</fo:inline> and <fo:inline font-family="monospace">SELECT x FROM Magazine AS x</fo:inline> are
synonymous.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Following the <fo:inline font-family="monospace">select</fo:inline> clause of the query is the object or
objects that the query returns. In the case of the query above, the query's
result list will contain instances of the <fo:inline font-family="monospace">Magazine</fo:inline> class.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e5752"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When selecting entities, you can optional use the keyword <fo:inline font-family="monospace">object
</fo:inline>. The clauses <fo:inline font-family="monospace">select x</fo:inline> and <fo:inline font-family="monospace">SELECT
OBJECT(x)</fo:inline> are synonymous.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The optional <fo:inline font-family="monospace">where</fo:inline> clause places criteria on matching
results. For example:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5769">SELECT x FROM Magazine x WHERE x.title = 'JDJ'</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Keywords in JPQL expressions are case-insensitive, but entity, identifier, and
member names are not. For example, the expression above could also be expressed
as:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5773">SELECT x FROM Magazine x WHERE x.title = 'JDJ'</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
But it could not be expressed as:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5777">SELECT x FROM Magazine x WHERE x.TITLE = 'JDJ'</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
As with the <fo:inline font-family="monospace">select</fo:inline> clause, alias names in the <fo:inline font-family="monospace">where
</fo:inline> clause are resolved to the entity declared in the <fo:inline font-family="monospace">from
</fo:inline> clause. The query above could be described in English as "for all
<fo:inline font-family="monospace">Magazine</fo:inline> instances <fo:inline font-family="monospace">x</fo:inline>, return a list
of every <fo:inline font-family="monospace">x</fo:inline> such that <fo:inline font-family="monospace">x</fo:inline>'s <fo:inline font-family="monospace">title
</fo:inline> field is equal to 'JDJ'".
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPQL uses SQL-like syntax for query criteria. The <fo:inline font-family="monospace">and</fo:inline> and
<fo:inline font-family="monospace">or</fo:inline> logical operators chain multiple criteria together:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5813">
SELECT x FROM Magazine x WHERE x.title = 'JDJ' OR x.title = 'JavaPro'
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">=</fo:inline> operator tests for equality. <fo:inline font-family="monospace">&lt;&gt;
</fo:inline> tests for inequality. JPQL also supports the following arithmetic
operators for numeric comparisons: <fo:inline font-family="monospace">&gt;, &gt;=, &lt;, &lt;=</fo:inline>.
For example:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5826">
SELECT x FROM Magazine x WHERE x.price &gt; 3.00 AND x.price &lt;= 5.00
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This query returns all magazines whose price is greater than 3.00 and less than
or equal to 5.00.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5830">
SELECT x FROM Magazine x WHERE x.price &lt;&gt; 3.00
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This query returns all Magazines whose price is not equals to 3.00.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can group expressions together using parentheses in order to specify how
they are evaluated. This is similar to how parentheses are used in Java. For
example:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5836">
SELECT x FROM Magazine x WHERE (x.price &gt; 3.00 AND x.price &lt;= 5.00) OR x.price = 7.00
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This expression would match magazines whose price is 4.00, 5.00, or 7.00, but
not 6.00. Alternately:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5840">
SELECT x FROM Magazine x WHERE x.price &gt; 3.00 AND (x.price &lt;= 5.00 OR x.price = 7.00)
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This expression will magazines whose price is 5.00 or 7.00, but not 4.00 or
6.00.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPQL also includes the following conditionals:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e5846"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e5847"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e5850"><!--
BETWEEN expressions
--></fo:wrapper>
<fo:inline font-family="monospace">[NOT] BETWEEN</fo:inline>: Shorthand for expressing that a value falls
between two other values. The following two statements are synonymous:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5857">
SELECT x FROM Magazine x WHERE x.price &gt;= 3.00 AND x.price &lt;= 5.00
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5859">
SELECT x FROM Magazine x WHERE x.price BETWEEN 3.00 AND 5.00
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e5861"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e5864"><!--
LIKE expressions
--></fo:wrapper>
<fo:inline font-family="monospace">[NOT] LIKE</fo:inline>: Performs a string comparison with wildcard
support. The special character '_' in the parameter means to match any single
character, and the special character '%' means to match any sequence of
characters. The following statement matches title fields "JDJ" and "JavaPro",
but not "IT Insider":
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5871">
SELECT x FROM Magazine x WHERE x.title LIKE 'J%'
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following statement matches the title field "JDJ" but not "JavaPro":
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5875">
SELECT x FROM Magazine x WHERE x.title LIKE 'J__'
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e5877"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e5880"><!--
IN expressions
--></fo:wrapper>
<fo:inline font-family="monospace">[NOT] IN</fo:inline>: Specifies that the member must be equal to one
element of the provided list. The following two statements are synonymous:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5887">
SELECT x FROM Magazine x WHERE x.title IN ('JDJ', 'JavaPro', 'IT Insider')
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5889">SELECT x FROM Magazine x WHERE x.title = 'JDJ' OR x.title = 'JavaPro' OR x.title = 'IT Insider'
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e5891"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e5894"><!--
IS EMPTY expressions
--></fo:wrapper>
<fo:inline font-family="monospace">IS [NOT] EMPTY</fo:inline>: Specifies that the collection field holds no
elements. For example:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5901">
SELECT x FROM Magazine x WHERE x.articles is empty
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This statement will return all magazines whose <fo:inline font-family="monospace"> articles</fo:inline>
member contains no elements.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e5908"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e5911"><!--
IS NULL expressions
--></fo:wrapper>
<fo:inline font-family="monospace">IS [NOT] NULL</fo:inline>: Specifies that the field is equal to null.
For example:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5918">
SELECT x FROM Magazine x WHERE x.publisher is null
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This statement will return all Magazine instances whose "publisher" field is set
to <fo:inline font-family="monospace">null</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e5925"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e5928"><!--
NOT expressions
--></fo:wrapper>
<fo:inline font-family="monospace">NOT</fo:inline>: Negates the contained expression. For example, the
following two statements are synonymous:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5935">
SELECT x FROM Magazine x WHERE NOT(x.price = 10.0)
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5937">
SELECT x FROM Magazine x WHERE x.price &lt;&gt; 10.0
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="jpa_overview_query_relations"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Relation Traversal
</fo:marker><fo:block font-size="17.28pt">10.1.2. 
Relation Traversal
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Relations between objects can be traversed using Java-like syntax. For example,
if the Magazine class has a field named "publisher" or type Company, that
relation can be queried as follows:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5944">
SELECT x FROM Magazine x WHERE x.publisher.name = 'Random House'
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This query returns all <fo:inline font-family="monospace">Magazine</fo:inline> instances whose <fo:inline font-family="monospace">
publisher</fo:inline> field is set to a <fo:inline font-family="monospace">Company</fo:inline> instance
whose name is "Random House".
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Single-valued relation traversal implies that the relation is not null. In SQL
terms, this is known as an <fo:inline font-style="italic">inner join</fo:inline>. If you want to also
include relations that are null, you can specify:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5962">
SELECT x FROM Magazine x WHERE x.publisher.name = 'Random House' or x.publisher is null
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can also traverse collection fields in queries, but you must declare each
traversal in the <fo:inline font-family="monospace">from</fo:inline> clause. Consider:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e5969">
SELECT x FROM Magazine x, IN(x.articles) y WHERE y.authorName = 'John Doe'
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This query says that for each <fo:inline font-family="monospace">Magazine</fo:inline><fo:inline font-family="monospace"> x
</fo:inline>, traverse the <fo:inline font-family="monospace">articles</fo:inline> relation and check each
<fo:inline font-family="monospace">Article</fo:inline><fo:inline font-family="monospace">y</fo:inline>, and pass the filter if
<fo:inline font-family="monospace">y</fo:inline>'s <fo:inline font-family="monospace">authorName</fo:inline> field is equal to "John
Doe". In short, this query will return all magazines that have any articles
written by John Doe.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e5992"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">IN()</fo:inline> syntax can also be expressed with the keywords
<fo:inline font-family="monospace">inner join</fo:inline>. The statements <fo:inline font-family="monospace">SELECT x FROM Magazine
x, IN(x.articles) y WHERE y.authorName = 'John Doe'</fo:inline> and <fo:inline font-family="monospace">
SELECT x FROM Magazine x inner join x.articles y WHERE y.authorName = 'John Doe'
</fo:inline> are synonymous.
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_join_fetch"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Fetch Joins
</fo:marker><fo:block font-size="17.28pt">10.1.3. 
Fetch Joins
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPQL queries may specify one or more <fo:inline font-family="monospace">join fetch</fo:inline> declarations,
which allow the query to specify which fields in the returned instances will be
pre-fetched.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6015">
SELECT x FROM Magazine x join fetch x.articles WHERE x.title = 'JDJ'
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The query above returns <fo:inline font-family="monospace">Magazine</fo:inline> instances and guarantees
that the <fo:inline font-family="monospace">articles</fo:inline> field will already be fetched in the
returned instances.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Multiple fields may be specified in separate <fo:inline font-family="monospace">join fetch</fo:inline>
declarations: <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6030">
SELECT x FROM Magazine x join fetch x.articles join fetch x.authors WHERE x.title = 'JDJ'
</fo:block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e6035"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em"> Specifying the <fo:inline font-family="monospace">join fetch</fo:inline> declaration is
functionally equivalent to adding the fields to the Query's <fo:inline font-family="monospace">
FetchConfiguration</fo:inline>. See <fo:basic-link internal-destination="ref_guide_fetch"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.6, “
Fetch Groups
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_fetch"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_fetch"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:block>
</fo:block></fo:block><fo:block id="jpa_overview_query_functions"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
JPQL Functions
</fo:marker><fo:block font-size="17.28pt">10.1.4. 
JPQL Functions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
As well as supporting direct field and relation comparisons, JPQL supports a
pre-defined set of functions that you can apply.
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e6052"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6053"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e6056"><!--
CONCAT function
--></fo:wrapper>
<fo:inline font-family="monospace">CONCAT(string1, string2)</fo:inline>: Concatenates two string fields or
literals. For example:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6063">
SELECT x FROM Magazine x WHERE CONCAT(x.title, 's') = 'JDJs'
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6065"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e6068"><!--
SUBSTRING function
--></fo:wrapper>
<fo:inline font-family="monospace">SUBSTRING(string, startIndex, length)</fo:inline>: Returns the part of
the <fo:inline font-family="monospace">string</fo:inline> argument starting at <fo:inline font-family="monospace">startIndex</fo:inline>
(1-based) and ending at <fo:inline font-family="monospace">length</fo:inline> characters past <fo:inline font-family="monospace">
startIndex</fo:inline>.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6087">
SELECT x FROM Magazine x WHERE SUBSTRING(x.title, 1, 1) = 'J'
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6089"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e6092"><!--
TRIM function
--></fo:wrapper>
<fo:inline font-family="monospace">TRIM([LEADING | TRAILING | BOTH] [character FROM] string</fo:inline>:
Trims the specified character from either the beginning ( <fo:inline font-family="monospace">LEADING
</fo:inline>) end ( <fo:inline font-family="monospace">TRAILING</fo:inline>) or both ( <fo:inline font-family="monospace"> BOTH
</fo:inline>) of the string argument. If no trim character is specified, the
space character will be trimmed.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6108">
SELECT x FROM Magazine x WHERE TRIM(BOTH 'J' FROM x.title) = 'D'
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6110"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e6113"><!--
LOWER function
--></fo:wrapper>
<fo:inline font-family="monospace">LOWER(string)</fo:inline>: Returns the lower-case of the specified
string argument.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6120">
SELECT x FROM Magazine x WHERE LOWER(x.title) = 'jdj'
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6122"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e6125"><!--
UPPER function
--></fo:wrapper>
<fo:inline font-family="monospace">UPPER(string)</fo:inline>: Returns the upper-case of the specified
string argument.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6132">
SELECT x FROM Magazine x WHERE UPPER(x.title) = 'JAVAPRO'
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6134"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e6137"><!--
LENGTH function
--></fo:wrapper>
<fo:inline font-family="monospace">LENGTH(string)</fo:inline>: Returns the number of characters in the
specified string argument.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6144">
SELECT x FROM Magazine x WHERE LENGTH(x.title) = 3
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6146"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e6149"><!--
LOCATE function
--></fo:wrapper>
<fo:inline font-family="monospace">LOCATE(searchString, candidateString [, startIndex])</fo:inline>:
Returns the first index of <fo:inline font-family="monospace">searchString</fo:inline> in <fo:inline font-family="monospace">
candidateString</fo:inline>. Positions are 1-based. If the string is not found,
returns 0.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6162">
SELECT x FROM Magazine x WHERE LOCATE('D', x.title) = 2
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6164"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e6167"><!--
ABS function
--></fo:wrapper>
<fo:inline font-family="monospace">ABS(number)</fo:inline>: Returns the absolute value of the argument.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6174">
SELECT x FROM Magazine x WHERE ABS(x.price) &gt;= 5.00
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6176"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e6179"><!--
SQRT function
--></fo:wrapper>
<fo:inline font-family="monospace">SQRT(number)</fo:inline>: Returns the square root of the argument.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6186">
SELECT x FROM Magazine x WHERE SQRT(x.price) &gt;= 1.00
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6188"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e6191"><!--
MOD function
--></fo:wrapper>
<fo:inline font-family="monospace">MOD(number, divisor)</fo:inline>: Returns the modulo of <fo:inline font-family="monospace">number
</fo:inline> and <fo:inline font-family="monospace">divisor</fo:inline>.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6204">
SELECT x FROM Magazine x WHERE MOD(x.price, 10) = 0
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6206"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e6209"><!--
CURRENT_DATE function
--></fo:wrapper>
<fo:inline font-family="monospace">CURRENT_DATE</fo:inline>: Returns the current date.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6216"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e6219"><!--
CURRENT_TIME function
--></fo:wrapper>
<fo:inline font-family="monospace">CURRENT_TIME</fo:inline>: Returns the current time.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6226"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e6229"><!--
CURRENT_TIMESTAMP function
--></fo:wrapper>
<fo:inline font-family="monospace">CURRENT_TIMESTAMP</fo:inline>: Returns the current timestamp.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="jpa_overview_query_inheritance"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Polymorphic Queries
</fo:marker><fo:block font-size="17.28pt">10.1.5. 
Polymorphic Queries
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
All JPQL queries are polymorphic, which means the <fo:inline font-family="monospace">from</fo:inline> clause
of a query includes not only instances of the specific entity class to which it
refers, but all subclasses of that class as well. The instances returned by a
query include instances of the subclasses that satisfy the query conditions. For
example, the following query may return instances of <fo:inline font-family="monospace"> Magazine
</fo:inline>, as well as <fo:inline font-family="monospace">Tabloid</fo:inline> and <fo:inline font-family="monospace">Digest
</fo:inline> instances, where <fo:inline font-family="monospace">Tabloid</fo:inline> and <fo:inline font-family="monospace">
Digest</fo:inline> are <fo:inline font-family="monospace">Magazine</fo:inline> subclasses.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6262">SELECT x FROM Magazine x WHERE x.price &lt; 5</fo:block></fo:block><fo:block id="jpa_overview_query_params"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Query Parameters
</fo:marker><fo:block font-size="17.28pt">10.1.6. 
Query Parameters
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPQL provides support for parameterized queries. Either named parameters or
positional parameters may be specified in the query string. Parameters allow you
to re-use query templates where only the input parameters vary. A single query
can declare either named parameters or positional parameters, but is not allowed
to declare both named and positional parameters.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6269">
public Query setParameter (int pos, Object value);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Specify positional parameters in your JPQL string using an integer prefixed by a
question mark. You can then populate the <fo:inline font-family="monospace">Query</fo:inline> object
with positional parameter values via calls to the <fo:inline font-family="monospace">setParameter
</fo:inline> method above. The method returns the <fo:inline font-family="monospace">Query</fo:inline>
instance for optional method chaining.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6282">
EntityManager em = ...
Query q = em.createQuery("SELECT x FROM Magazine x WHERE x.title = ?1 and x.price &gt; ?2");
q.setParameter(1, "JDJ").setParameter(2, 5.0);
List&lt;Magazine&gt; results = (List&lt;Magazine&gt;) q.getResultList();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This code will substitute <fo:inline font-family="monospace">JDJ</fo:inline> for the <fo:inline font-family="monospace">?1</fo:inline>
parameter and <fo:inline font-family="monospace">5.0</fo:inline> for the <fo:inline font-family="monospace">?2</fo:inline> parameter,
then execute the query with those values.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6298">
public Query setParameter(String name, Object value);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Named parameter are denoted by prefixing an arbitrary name with a colon in your
JPQL string. You can then populate the <fo:inline font-family="monospace"> Query</fo:inline> object with
parameter values using the method above. Like the positional parameter method,
this method returns the <fo:inline font-family="monospace">Query</fo:inline> instance for optional
method chaining.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6308">
EntityManager em = ...
Query q = em.createQuery("SELECT x FROM Magazine x WHERE x.title = :titleParam and x.price &gt; :priceParam");
q.setParameter("titleParam", "JDJ").setParameter("priceParam", 5.0);
List&lt;Magazine&gt; results = (List&lt;Magazine&gt;) q.getResultList();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This code substitutes <fo:inline font-family="monospace">JDJ</fo:inline> for the <fo:inline font-family="monospace"> :titleParam
</fo:inline> parameter and <fo:inline font-family="monospace">5.0</fo:inline> for the <fo:inline font-family="monospace">:priceParam
</fo:inline> parameter, then executes the query with those values.
</fo:block></fo:block><fo:block id="jpa_overview_query_hints"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Query Hints
</fo:marker><fo:block font-size="17.28pt">10.1.7. 
Query Hints
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPQL provides support for hints which are name/value pairs used to control locking and optimization keywords in sql.
The following example shows how to use the JPA hint api to set the <fo:inline font-family="monospace">ReadLockMode</fo:inline> and <fo:inline font-family="monospace">ResultCount</fo:inline> in the OpenJPA fetch plan. This will result in the sql keywords OPTIMIZE FOR 2 ROWS and UPDATE to be emitted into the sql provided that a pessimistic LockManager is being used.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_query_hint1"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 10.1. 
Query Hints
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6338">
...
Query q = em.createQuery("select m from Magazine m where ... ");
q.setHint("openjpa.hint.OptimizeResultCount", new Integer(2));
q.setHint("openjpa.FetchPlan.ReadLockMode","WRITE");
List r = q.getResultList();
...
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Invalid hints or hints which can not be processed by a particular database are ignored. Otherwise, invalid hints will result in an ArgumentException being thrown.
</fo:block><fo:block id="jpa_hints_locking"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.1.7.1. 
Locking Hints
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To avoid deadlock and optimistic update exceptions among multiple updaters, use a pessimistic LockManager, specified in the persistence unit definition, and use a hint name of "openjpa.FetchPlan.ReadLockMode" on queries for entities that must be locked for serialization. The value of <fo:inline font-family="monospace">ReadLockMode</fo:inline> can be either "READ" or "WRITE". This results in FOR UPDATE or USE AND KEEP UPDATE LOCKS in sql.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Using a <fo:inline font-family="monospace">ReadLockMode</fo:inline> hint with JPA optimistic locking ( i.e. specifying LockManager = "version") will result in the entity version field either being reread at end of transaction in the case of a value of "READ" or the version field updated at end of transaction in the case of "WRITE". You must define a version field in the entity mapping when using a version LockManager and using ReadLockMode.
</fo:block><fo:block xmlns:rx="http://www.renderx.com/XSL/Extensions" space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="d0e6355"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Table 10.1. 
Interaction of ReadLockMode hint and LockManager
</fo:block><fo:table border-before-width.conditionality="retain" border-collapse="collapse" border-left-style="solid" border-right-style="solid" border-top-style="solid" border-bottom-style="solid" border-left-width="0.5pt" border-right-width="0.5pt" border-top-width="0.5pt" border-bottom-width="0.5pt" border-left-color="black" border-right-color="black" border-top-color="black" border-bottom-color="black" table-layout="fixed" width="100%"><fo:table-column column-number="1"/><fo:table-column column-number="2"/><fo:table-column column-number="3"/><fo:table-header start-indent="0pt" end-indent="0pt"><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">
ReadLockMode
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">
LockManager=pessimistic
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block font-weight="bold">
LockManager=version
</fo:block></fo:table-cell></fo:table-row></fo:table-header><fo:table-body start-indent="0pt" end-indent="0pt"><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
READ
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
sql with UPDATE
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>sql without update;
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
reread version field at the end of transaction and check for no change.
</fo:block>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
WRITE
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
sql with UPDATE
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
sql without update;
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
force update version field at the end of transaction
</fo:block>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
not specified
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
sql without update
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" text-align="left"><fo:block>
sql without update
</fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:block><fo:block id="jpa_hints_resultset"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.1.7.2. 
Result Set Size Hint
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To specify a result set size hint to those databases that support it, specify a hint name of "openjpa.hint.OptimizeResultCount" with an integer value greater than zero. This causes the sql keyword OPTIMIZE FOR to be generated.
</fo:block></fo:block><fo:block id="jpa_hints_isolation"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.1.7.3. 
Isolation Level Hint
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To specify an isolation level, specify a hint name of "openjpa.FetchPlan.Isolation". The value will be used to specify isolation level using the sql WITH &lt;isolation&gt; clause for those databases that support it. This hint only works in conjunction with the ReadLockMode hint.
</fo:block></fo:block><fo:block id="jpa_hints_fetchplan"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.1.7.4. 
Other Fetchplan Hints
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Any property of an OpenJPA FetchPlan can be changed using a hint by using a name of the form "openjpa.FetchPlan."&lt;property name&gt;.Valid property names include :
<fo:inline font-family="monospace">MaxFetchDepth</fo:inline>, <fo:inline font-family="monospace">FetchBatchSize</fo:inline>, <fo:inline font-family="monospace">LockTimeOut</fo:inline>, <fo:inline font-family="monospace">EagerFetchMode</fo:inline>, <fo:inline font-family="monospace">SubclassFetchMode</fo:inline> and <fo:inline font-family="monospace">Isolation</fo:inline>.
</fo:block></fo:block><fo:block id="d0e6431"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.1.7.5. 
Oracle Query Hints
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The hint name "openjpa.hint.OracleSelectHint" can be used to specify a string value of an Oracle query hint that will inserted into sql for an Oracle database.See <fo:basic-link internal-destination="dbsupport_oracle_query_hints"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.15.1, “
Using Query Hints with Oracle
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="dbsupport_oracle_query_hints"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="dbsupport_oracle_query_hints"/>]</fo:inline></fo:basic-link> for an example.
</fo:block></fo:block><fo:block id="jpa_hints_named"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.1.7.6. 
Named Query Hints
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Hints can also be included as part of a NamedQuery definition.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_query_hint2"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 10.2. 
Named Query using Hints
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6446">
...
@NamedQuery(name=" magsOverPrice",
query="SELECT x FROM Magazine x WHERE x.price &gt; ?1",
hints={ @QueryHint (name="openjpa.hint.OptimizeResultCount", value="2"),
@QueryHint (name="openjpa.FetchPlan.ReadLockMode",value="WRITE")} )
...
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_query_ordering"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Ordering
</fo:marker><fo:block font-size="17.28pt">10.1.8. 
Ordering
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPQL queries may optionally contain an <fo:inline font-family="monospace">order by</fo:inline> clause which
specifies one or more fields to order by when returning query results. You may
follow the <fo:inline font-family="monospace">order by field</fo:inline> clause with the <fo:inline font-family="monospace">asc
</fo:inline> or <fo:inline font-family="monospace">desc</fo:inline> keywords, which indicate that ordering
should be ascending or descending, respectively. If the direction is omitted,
ordering is ascending by default.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6465">
SELECT x FROM Magazine x order by x.title asc, x.price desc
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The query above returns <fo:inline font-family="monospace">Magazine</fo:inline> instances sorted by
their title in ascending order. In cases where the titles of two or more
magazines are the same, those instances will be sorted by price in descending
order.
</fo:block></fo:block><fo:block id="jpa_overview_query_aggregates"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Aggregates
</fo:marker><fo:block font-size="17.28pt">10.1.9. 
Aggregates
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPQL queries can select aggregate data as well as objects. JPQL includes the
<fo:inline font-family="monospace">min</fo:inline>, <fo:inline font-family="monospace">max</fo:inline>, <fo:inline font-family="monospace">avg</fo:inline>, and
<fo:inline font-family="monospace">count</fo:inline> aggregates. These functions can be used for reporting
and summary queries.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following query will return the average of all the prices of all the
magazines:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6491">
EntityManager em = ...
Query q = em.createQuery("SELECT AVG(x.price) FROM Magazine x");
Number result = (Number) q.getSingleResult();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following query will return the highest price of all the magazines titled
"JDJ":
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6495">
EntityManager em = ...
Query q = em.createQuery("SELECT MAX(x.price) FROM Magazine x WHERE x.title = 'JDJ'");
Number result = (Number) q.getSingleResult();
</fo:block></fo:block><fo:block id="jpa_overview_query_named"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Named Queries
</fo:marker><fo:block font-size="17.28pt">10.1.10. 
Named Queries
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Query templates can be statically declared using the <fo:inline font-family="monospace"> NamedQuery
</fo:inline> and <fo:inline font-family="monospace">NamedQueries</fo:inline> annotations. For example:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6508">
@Entity
@NamedQueries({
@NamedQuery(name="magsOverPrice",
query="SELECT x FROM Magazine x WHERE x.price &gt; ?1"),
@NamedQuery(name="magsByTitle",
query="SELECT x FROM Magazine x WHERE x.title = :titleParam")
})
public class Magazine {
...
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
These declarations will define two named queries called <fo:inline font-family="monospace">magsOverPrice
</fo:inline> and <fo:inline font-family="monospace">magsByTitle</fo:inline>.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6518">
public Query createNamedQuery(String name);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You retrieve named queries with the above <fo:inline font-family="monospace">EntityManager</fo:inline>
method. For example:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6525">
EntityManager em = ...
Query q = em.createNamedQuery("magsOverPrice");
q.setParameter(1, 5.0f);
List&lt;Magazine&gt; results = (List&lt;Magazine&gt;) q.getResultList();
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6527">
EntityManager em = ...
Query q = em.createNamedQuery("magsByTitle");
q.setParameter("titleParam", "JDJ");
List&lt;Magazine&gt; results = (List&lt;Magazine&gt;) q.getResultList();
</fo:block></fo:block><fo:block id="jpa_overview_query_delete"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Delete By Query
</fo:marker><fo:block font-size="17.28pt">10.1.11. 
Delete By Query
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Queries are useful not only for finding objects, but for efficiently deleting
them as well. For example, you might delete all records created before a certain
date. Rather than bring these objects into memory and delete them individually,
JPA allows you to perform a single bulk delete based on JPQL criteria.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Delete by query uses the same JPQL syntax as normal queries, with one exception:
begin your query string with the <fo:inline font-family="monospace">delete</fo:inline> keyword instead of
the <fo:inline font-family="monospace">select</fo:inline> keyword. To then execute the delete, you call the
following <fo:inline font-family="monospace">Query</fo:inline> method:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6545">
public int executeUpdate();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This method returns the number of objects deleted. The following example deletes
all subscriptions whose expiration date has passed.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_query_deleteex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 10.3. 
Delete by Query
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6552">
Query q = em.createQuery("DELETE FROM Subscription s WHERE s.subscriptionDate &lt; :today");
q.setParameter("today", new Date());
int deleted = q.executeUpdate();
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_query_update"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Update By Query
</fo:marker><fo:block font-size="17.28pt">10.1.12. 
Update By Query
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Similar to bulk deletes, it is sometimes necessary to perform updates against a
large number of queries in a single operation, without having to bring all the
instances down to the client. Rather than bring these objects into memory and
modifying them individually, JPA allows you to perform a single bulk update
based on JPQL criteria.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Update by query uses the same JPQL syntax as normal queries, except that the
query string begins with the <fo:inline font-family="monospace">update</fo:inline> keyword instead of
<fo:inline font-family="monospace">select</fo:inline>. To execute the update, you call the following
<fo:inline font-family="monospace">Query</fo:inline> method:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6570">
public int executeUpdate();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This method returns the number of objects updated. The following example updates
all subscriptions whose expiration date has passed to have the "paid" field set
to true..
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_query_updateex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 10.4. 
Update by Query
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6577">
Query q = em.createQuery("UPDATE Subscription s SET s.paid = :paid WHERE s.subscriptionDate &lt; :today");
q.setParameter("today", new Date());
q.setParameter("paid", true);
int updated = q.executeUpdate();
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_langref"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
JPQL Language Reference
</fo:marker><fo:block font-size="20.735999999999997pt">10.2. 
JPQL Language Reference
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The Java Persistence Query Language (JPQL) is used to define searches against
persistent entities independent of the mechanism used to store those entities.
As such, JPQL is "portable", and not constrained to any particular data store.
The Java Persistence query language is an extension of the Enterprise JavaBeans
query language, <fo:inline font-family="monospace">EJB QL</fo:inline>, adding operations such as bulk
deletes and updates, join operations, aggregates, projections, and subqueries.
Furthermore, JPQL queries can be declared statically in metadata, or can be
dynamically built in code. This chapter provides the full definition of the
language.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e6587"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Much of this section is paraphrased or taken directly from Chapter 4 of the
JSR 220 specification.
</fo:block></fo:block></fo:block><fo:block id="jpa_langref_stmnttypes"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
JPQL Statement Types
</fo:marker><fo:block font-size="17.28pt">10.2.1. 
JPQL Statement Types
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A JPQL statement may be either a <fo:inline font-family="monospace">SELECT</fo:inline> statement, an
<fo:inline font-family="monospace">UPDATE</fo:inline> statement, or a <fo:inline font-family="monospace">DELETE</fo:inline> statement.
This chapter refers to all such statements as "queries". Where it is important
to distinguish among statement types, the specific statement type is referenced.
In BNF syntax, a query language statement is defined as:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e6604"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6605"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
QL_statement ::= select_statement | update_statement | delete_statement
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The complete BNF for JPQL is defined in <fo:basic-link internal-destination="jpa_langref_bnf"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.2.12, “
JPQL BNF
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_langref_bnf"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_langref_bnf"/>]</fo:inline></fo:basic-link>.
Any JPQL statement may be constructed dynamically or may be statically defined
in a metadata annotation or XML descriptor element. All statement types may
have parameters, as discussed in <fo:basic-link internal-destination="jpa_langref_input_params"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.2.5.4, “
JPQL Input Parameters
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_langref_input_params"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_langref_input_params"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block id="jpa_langref_select"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.1.1. 
JPQL Select Statement
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A select statement is a string which consists of the following clauses:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e6619"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6620"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
a <fo:inline font-family="monospace">SELECT</fo:inline> clause, which determines the type of the objects
or values to be selected.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6626"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
a <fo:inline font-family="monospace">FROM</fo:inline> clause, which provides declarations that designate the
domain to which the expressions specified in the other clauses of the query
apply.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6632"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
an optional <fo:inline font-family="monospace">WHERE</fo:inline> clause, which may be used to restrict the
results that are returned by the query.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6638"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
an optional <fo:inline font-family="monospace">GROUP BY</fo:inline> clause, which allows query results to be
aggregated in terms of groups.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6644"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
an optional <fo:inline font-family="monospace">HAVING</fo:inline> clause, which allows filtering over
aggregated groups.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6650"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
an optional <fo:inline font-family="monospace">ORDER BY</fo:inline> clause, which may be used to order the
results that are returned by the query.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In BNF syntax, a select statement is defined as:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e6658"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6659"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
select_statement ::= select_clause from_clause [where_clause] [groupby_clause]
[having_clause] [orderby_clause]
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A select statement must always have a <fo:inline font-family="monospace">SELECT</fo:inline> and a
<fo:inline font-family="monospace">FROM</fo:inline> clause. The square brackets [] indicate that the other
clauses are optional.
</fo:block></fo:block><fo:block id="jpa_langref_bulk"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.1.2. 
JPQL Update and Delete Statements
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Update and delete statements provide bulk operations over sets of entities. In
BNF syntax, these operations are defined as:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e6675"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6676"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
update_statement ::= update_clause [where_clause]
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6679"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
delete_statement ::= delete_clause [where_clause]
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The update and delete clauses determine the type of the entities to be updated
or deleted. The <fo:inline font-family="monospace">WHERE</fo:inline> clause may be used to restrict the
scope of the update or delete operation. Update and delete statements are
described further in <fo:basic-link internal-destination="jpa_langref_bulk_ops"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.2.9, “
JPQL Bulk Update and Delete
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_langref_bulk_ops"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_langref_bulk_ops"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:block><fo:block id="jpa_langref_schematypes"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
JPQL Abstract Schema Types and Query Domains
</fo:marker><fo:block font-size="17.28pt">10.2.2. 
JPQL Abstract Schema Types and Query Domains
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The Java Persistence query language is a typed language, and every expression
has a type. The type of an expression is derived from the structure of the
expression, the abstract schema types of the identification variable
declarations, the types to which the persistent fields and relationships
evaluate, and the types of literals. The abstract schema type of an entity is
derived from the entity class and the metadata information provided by Java
language annotations or in the XML descriptor.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Informally, the abstract schema type of an entity can be characterized as
follows:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e6696"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6697"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
For every persistent field or get
accessor method (for a persistent property) of the entity class, there is a
field ("state-field") whose abstract schema type corresponds to that of the
field or the result type of the accessor method.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6700"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
For every persistent relationship field or get accessor method (for a persistent
relationship property) of the entity class, there is a field
("association-field") whose type is the abstract schema type of the related
entity (or, if the relationship is a one-to-many or many-to-many, a collection
of such). Abstract schema types are specific to the query language data model.
The persistence provider is not required to implement or otherwise materialize
an abstract schema type. The domain of a query consists of the abstract schema
types of all entities that are defined in the same persistence unit. The domain
of a query may be restricted by the navigability of the relationships of the
entity on which it is based. The association-fields of an entity's abstract
schema type determine navigability. Using the association-fields and their
values, a query can select related entities and use their abstract schema types
in the query.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block id="jpa_langref_schemanaming"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.2.1. 
JPQL Entity Naming
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Entities are designated in query strings by their entity names. The entity name
is defined by the name element of the Entity annotation (or the entity-name XML
descriptor element), and defaults to the unqualified name of the entity class.
Entity names are scoped within the persistence unit and must be unique within
the persistence unit.
</fo:block></fo:block><fo:block id="jpa_langref_schemaexample"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.2.2. 
JPQL Schema Example
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This example assumes that the application developer provides several entity
classes, representing magazines, publishers, authors, and articles. The abstract
schema types for these entities are <fo:inline font-family="monospace">Magazine</fo:inline>, <fo:inline font-family="monospace">
Publisher</fo:inline>, <fo:inline font-family="monospace">Author</fo:inline>, and <fo:inline font-family="monospace">Article</fo:inline>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Several Entities with Abstract Persistence Schemas Defined in the Same
Persistence Unit. The entity <fo:inline font-family="monospace">Publisher</fo:inline> has a one-to-many
relationships with <fo:inline font-family="monospace">Magazine</fo:inline>. There is also a one-to-many
relationship between <fo:inline font-family="monospace">Magazine</fo:inline> and <fo:inline font-family="monospace">Article</fo:inline>
. The entity <fo:inline font-family="monospace">Article</fo:inline> is related to <fo:inline font-family="monospace">Author</fo:inline>
in a one-to-one relationship.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Queries to select magazines can be defined by navigating over the
association-fields and state-fields defined by Magazine and Author. A query to
find all magazines that have unpublished articles is as follows:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6747">
SELECT DISTINCT mag FROM Magazine AS mag JOIN mag.articles AS art WHERE art.published = FALSE
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This query navigates over the association-field authors of the
abstract schema type <fo:inline font-family="monospace">Magazine</fo:inline> to find articles, and uses the
state-field <fo:inline font-family="monospace">published</fo:inline> of <fo:inline font-family="monospace">Article</fo:inline> to select
those magazines that have at least one article that is published. Although
predefined reserved identifiers, such as <fo:inline font-family="monospace">DISTINCT</fo:inline>, <fo:inline font-family="monospace">
FROM</fo:inline>, <fo:inline font-family="monospace">AS</fo:inline>, <fo:inline font-family="monospace">JOIN</fo:inline>, <fo:inline font-family="monospace">
WHERE</fo:inline>, and <fo:inline font-family="monospace">FALSE</fo:inline> appear in upper case in this
example, predefined reserved identifiers are case insensitive. The <fo:inline font-family="monospace">
SELECT</fo:inline> clause of this example designates the return type of this
query to be of type Magazine. Because the same persistence unit defines the
abstract persistence schemas of the related entities, the developer can also
specify a query over <fo:inline font-family="monospace">articles</fo:inline> that utilizes the abstract
schema type for products, and hence the state-fields and association-fields of
both the abstract schema types Magazine and Author. For example, if the
abstract schema type Author has a state-field named firstName, a query over
articles can be specified using this state-field. Such a query might be to
find all magazines that have articles authored by someone with the first name
"John".
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e6784">
SELECT DISTINCT mag FROM Magazine mag JOIN mag.articles art JOIN art.author auth WHERE auth.firstName = 'John'
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Because Magazine is related to Author by means of the
relationships between Magazine and Article and between Article and Author,
navigation using the association-fields authors and product is used to express
the query. This query is specified by using the abstract schema name Magazine,
which designates the abstract schema type over which the query ranges. The basis
for the navigation is provided by the association-fields authors and product of
the abstract schema types Magazine and Article respectively.
</fo:block></fo:block></fo:block><fo:block id="jpa_langref_fromclause"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
JPQL FROM Clause and Navigational Declarations
</fo:marker><fo:block font-size="17.28pt">10.2.3. 
JPQL FROM Clause and Navigational Declarations
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">FROM</fo:inline> clause of a query defines the domain of the query by
declaring identification variables. An identification variable is an identifier
declared in the <fo:inline font-family="monospace">FROM</fo:inline> clause of a query. The domain of the
query may be constrained by path expressions. Identification variables designate
instances of a particular entity abstract schema type. The <fo:inline font-family="monospace">FROM
</fo:inline> clause can contain multiple identification variable declarations
separated by a comma (,).
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e6802"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6803"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
from_clause ::= FROM identification_variable_declaration {,
{identification_variable_declaration | collection_member_declaration}}*
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6806"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
identification_variable_declaration ::= range_variable_declaration { join |
fetch_join }*
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6809"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
range_variable_declaration ::= abstract_schema_name [AS] identification_variable
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6812"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
join ::= join_spec join_association_path_expression [AS] identification_variable
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6815"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
fetch_join ::= join_spec FETCH join_association_path_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6818"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
join_association_path_expression ::= join_collection_valued_path_expression |
join_single_valued_association_path_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6821"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
join_spec ::= [ LEFT [OUTER] | INNER ] JOIN
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6824"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
collection_member_declaration ::= IN (collection_valued_path_expression) [AS]
identification_variable
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block id="jpa_langref_from_identifiers"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.3.1. 
JPQL FROM Identifiers
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
An identifier is a character sequence of unlimited length. The character
sequence must begin with a Java identifier start character, and all other
characters must be Java identifier part characters. An identifier start
character is any character for which the method <fo:inline font-family="monospace">
Character.isJavaIdentifierStart</fo:inline> returns <fo:inline font-family="monospace">true</fo:inline>.
This includes the underscore (_) character and the dollar sign ($) character. An
identifier part character is any character for which the method <fo:inline font-family="monospace">
Character.isJavaIdentifierPart</fo:inline> returns <fo:inline font-family="monospace">true</fo:inline>.
The question mark (?) character is reserved for use by the Java Persistence
query language. The following are reserved identifiers:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e6844"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6845"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">SELECT</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6851"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">FROM</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6857"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">WHERE</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6863"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">UPDATE</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6869"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">DELETE</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6875"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">JOIN</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6881"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">OUTER</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6887"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">INNER</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6893"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">LEFT</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6899"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">GROUP</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6905"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">BY</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6911"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">HAVING</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6917"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">FETCH</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6923"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">DISTINCT</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6929"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">OBJECT</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6935"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">NULL</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6941"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">TRUE</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6947"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">FALSE</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6953"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">NOT</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6959"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">AND</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6965"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">OR</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6971"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">BETWEEN</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6977"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">LIKE</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6983"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">IN</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6989"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">AS</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e6995"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">UNKNOWN</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7001"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">EMPTY</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7007"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">MEMBER</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7013"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">OF</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7019"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">IS</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7025"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">AVG</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7031"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">MAX</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7037"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">MIN</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7043"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">SUM</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7049"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">COUNT</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7055"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">ORDER</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7061"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">BY</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7067"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">ASC</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7073"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">DESC</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7079"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">MOD</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7085"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">UPPER</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7091"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">LOWER</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7097"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">TRIM</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7103"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">POSITION</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7109"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">CHARACTER_LENGTH</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7115"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">CHAR_LENGTH</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7121"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">BIT_LENGTH</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7127"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">CURRENT_TIME</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7133"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">CURRENT_DATE</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7139"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">CURRENT_TIMESTAMP</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7145"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">NEW</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7151"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">EXISTS</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7157"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">ALL</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7163"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">ANY</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7169"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">SOME</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Reserved identifiers are case insensitive. Reserved identifiers must not be
used as identification variables. It is recommended that other SQL reserved
words also not be as identification variables in queries because they may be
used as reserved identifiers in future releases of the specification.
</fo:block></fo:block><fo:block id="jpa_langref_from_vars"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.3.2. 
JPQL Identification Variables
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
An identification variable is a valid identifier declared in the <fo:inline font-family="monospace">FROM
</fo:inline> clause of a query. All identification variables must be declared in
the <fo:inline font-family="monospace">FROM</fo:inline> clause. Identification variables cannot be declared
in other clauses. An identification variable must not be a reserved identifier
or have the same name as any entity in the same persistence unit: Identification
variables are case insensitive. An identification variable evaluates to a value
of the type of the expression used in declaring the variable. For example,
consider the previous query: <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7188">SELECT DISTINCT mag FROM Magazine mag JOIN mag.articles art JOIN art.author auth WHERE auth.firstName = 'John'
</fo:block> In the <fo:inline font-family="monospace">FROM</fo:inline> clause declaration <fo:inline font-family="monospace">
mag.articles</fo:inline><fo:inline font-family="monospace">art</fo:inline>, the identification variable
<fo:inline font-family="monospace">art</fo:inline> evaluates to any <fo:inline font-family="monospace">Article</fo:inline> value
directly reachable from <fo:inline font-family="monospace">Magazine</fo:inline>. The association-field
<fo:inline font-family="monospace">articles</fo:inline> is a collection of instances of the abstract schema
type <fo:inline font-family="monospace">Article</fo:inline> and the identification variable <fo:inline font-family="monospace">art
</fo:inline> refers to an element of this collection. The type of <fo:inline font-family="monospace">auth
</fo:inline> is the abstract schema type of <fo:inline font-family="monospace">Author</fo:inline>. An
identification variable ranges over the abstract schema type of an entity. An
identification variable designates an instance of an entity abstract schema type
or an element of a collection of entity abstract schema type instances.
Identification variables are existentially quantified in a query. An
identification variable always designates a reference to a single value. It is
declared in one of three ways: in a range variable declaration, in a join
clause, or in a collection member declaration. The identification variable
declarations are evaluated from left to right in the <fo:inline font-family="monospace">FROM</fo:inline>
clause, and an identification variable declaration can use the result of a
preceding identification variable declaration of the query string.
</fo:block></fo:block><fo:block id="jpa_langref_range"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.3.3. 
JPQL Range Declarations
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The syntax for declaring an identification variable as a range variable is
similar to that of SQL; optionally, it uses the AS keyword.
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e7231"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7232"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
range_variable_declaration ::= abstract_schema_name [AS]
identification_variable
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Range variable declarations allow the developer to designate a "root" for
objects which may not be reachable by navigation. In order to select values by
comparing more than one instance of an entity abstract schema type, more than
one identification variable ranging over the abstract schema type is needed in
the <fo:inline font-family="monospace">FROM</fo:inline> clause.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following query returns magazines whose price is greater than the price of
magazines published by "Adventure" publishers. This example illustrates the use
of two different identification variables in the <fo:inline font-family="monospace">FROM</fo:inline> clause,
both of the abstract schema type Magazine. The <fo:inline font-family="monospace">SELECT</fo:inline> clause
of this query determines that it is the magazines with prices greater than those
of "Adventure" publisher's that are returned.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7248">
SELECT DISTINCT mag1 FROM Magazine mag1, Magazine mag2
WHERE mag1.price &gt; mag2.price AND mag2.publisher.name = 'Adventure'
</fo:block></fo:block><fo:block id="jpa_langref_path"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.3.4. 
JPQL Path Expressions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
An identification variable followed by the navigation operator (.) and a
state-field or association-field is a path expression. The type of the path
expression is the type computed as the result of navigation; that is, the type
of the state-field or association-field to which the expression navigates.
Depending on navigability, a path expression that leads to a association-field
may be further composed. Path expressions can be composed from other path
expressions if the original path expression evaluates to a single-valued type
(not a collection) corresponding to a association-field. Path expression
navigability is composed using "inner join" semantics. That is, if the value of
a non-terminal association-field in the path expression is null, the path is
considered to have no value, and does not participate in the determination of
the result. The syntax for single-valued path expressions and collection valued
path expressions is as follows:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e7255"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7256"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
single_valued_path_expression ::= state_field_path_expression |
single_valued_association_path_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7259"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
state_field_path_expression ::= {identification_variable |
single_valued_association_path_expression}.state_field
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7262"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
single_valued_association_path_expression ::=
identification_variable.{single_valued_association_field.}*single_valued_association_field
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7265"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
collection_valued_path_expression ::=
identification_variable.{single_valued_association_field.}*collection_valued_association_field
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7268"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
state_field ::= {embedded_class_state_field.}*simple_state_field
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A single_valued_association_field is designated by the name of an
association-field in a one-to-one or many-to-one relationship. The type of a
single_valued_association_field and thus a
single_valued_association_path_expression is the abstract schema type of the
related entity. A collection_valued_association_field is designated by the name
of an association-field in a one-to-many or a many-to-many relationship. The
type of a collection_valued_association_field is a collection of values of the
abstract schema type of the related entity. An embedded_class_state _field is
designated by the name of an entity state field that corresponds to an embedded
class. Navigation to a related entity results in a value of the related entity's
abstract schema type.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The evaluation of a path expression terminating in a state-field results in the
abstract schema type corresponding to the Java type designated by the
state-field. It is syntactically illegal to compose a path expression from a
path expression that evaluates to a collection. For example, if <fo:inline font-family="monospace">mag
</fo:inline> designates <fo:inline font-family="monospace">Magazine</fo:inline>, the path expression <fo:inline font-family="monospace">
mag.articles.author</fo:inline> is illegal since navigation to authors results in
a collection. This case should produce an error when the query string is
verified. To handle such a navigation, an identification variable must be
declared in the <fo:inline font-family="monospace">FROM</fo:inline> clause to range over the elements of the
<fo:inline font-family="monospace">articles</fo:inline> collection. Another path expression must be used to
navigate over each such element in the <fo:inline font-family="monospace">WHERE</fo:inline> clause of the
query, as in the following query which returns all authors that have any
articles in any magazines: <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7293">SELECT DISTINCT art.author FROM Magazine AS mag, IN(mag.articles) art
</fo:block>
</fo:block></fo:block><fo:block id="jpa_langref_Joins"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.3.5. 
JPQL Joins
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
An inner join may be implicitly specified by the use of a cartesian product in
the <fo:inline font-family="monospace">FROM</fo:inline> clause and a join condition in the <fo:inline font-family="monospace">WHERE
</fo:inline> clause.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The syntax for explicit join operations is as follows:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e7309"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7310"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
join ::= join_spec join_association_path_expression [AS] identification_variable
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7313"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
fetch_join ::= join_spec FETCH join_association_path_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7316"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
join_association_path_expression ::= join_collection_valued_path_expression |
join_single_valued_association_path_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7319"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
join_spec ::= [ LEFT [OUTER] | INNER ] JOIN
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following inner and outer join operation types are supported.
</fo:block><fo:block id="jpa_langref_inner_joins"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="12pt">10.2.3.5.1. 
JPQL Inner Joins (Relationship Joins)
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The syntax for the inner join operation is <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7329">
[ INNER ] JOIN join_association_path_expression [AS] identification_variable
</fo:block> For example, the query below joins over the relationship
between publishers and magazines. This type of join typically equates to a join
over a foreign key relationship in the database.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7332">
SELECT pub FROM Publisher pub JOIN pub.magazines mag WHERE pub.revenue &gt; 1000000
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The keyword <fo:inline font-family="monospace">INNER</fo:inline> may optionally be used:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7339">
SELECT pub FROM Publisher pub INNER JOIN pub.magazines mag WHERE pub.revenue &gt; 1000000
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This is equivalent to the following query using the earlier
<fo:inline font-family="monospace">IN</fo:inline> construct. It selects those publishers with revenue of
over 1 million for which at least one magazine exists:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7346">
SELECT OBJECT(pub) FROM Publisher pub, IN(pub.magazines) mag WHERE pub.revenue &gt; 1000000
</fo:block></fo:block><fo:block id="jpa_langref_outer_joins"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="12pt">10.2.3.5.2. 
JPQL Outer Joins
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-family="monospace">LEFT JOIN</fo:inline> and <fo:inline font-family="monospace">LEFT OUTER JOIN</fo:inline> are
synonymous. They enable the retrieval of a set of entities where matching values
in the join condition may be absent. The syntax for a left outer join is:
<fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7359">LEFT [OUTER] JOIN join_association_path_expression [AS] identification_variable
</fo:block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
For example: <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7364">SELECT pub FROM Publisher pub LEFT JOIN pub.magazines mag WHERE pub.revenue &gt; 1000000
</fo:block> The keyword <fo:inline font-family="monospace">OUTER</fo:inline> may optionally be used:
<fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7370">SELECT pub FROM Publisher pub LEFT OUTER JOIN pub.magazines mags WHERE pub.revenue &gt; 1000000
</fo:block> An important use case for <fo:inline font-family="monospace">LEFT JOIN</fo:inline> is in
enabling the prefetching of related data items as a side effect of a query. This
is accomplished by specifying the <fo:inline font-family="monospace">LEFT JOIN</fo:inline> as a <fo:inline font-family="monospace">
FETCH JOIN</fo:inline>.
</fo:block></fo:block><fo:block id="jpa_langref_fetch_joins"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="12pt">10.2.3.5.3. 
JPQL Fetch Joins
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A <fo:inline font-family="monospace">FETCH JOIN</fo:inline> enables the fetching of an association as a side
effect of the execution of a query. A <fo:inline font-family="monospace">FETCH JOIN</fo:inline> is specified
over an entity and its related entities. The syntax for a fetch join is
<fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e7393"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7394"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>fetch_join ::= [ LEFT [OUTER] | INNER ] JOIN
FETCH join_association_path_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The association referenced by the right side of the <fo:inline font-family="monospace">FETCH JOIN
</fo:inline> clause must be an association that belongs to an entity that is
returned as a result of the query. It is not permitted to specify an
identification variable for the entities referenced by the right side of the
<fo:inline font-family="monospace">FETCH JOIN</fo:inline> clause, and hence references to the implicitly
fetched entities cannot appear elsewhere in the query. The following query
returns a set of magazines. As a side effect, the associated articles for those
magazines are also retrieved, even though they are not part of the explicit
query result. The persistent fields or properties of the articles that are
eagerly fetched are fully initialized. The initialization of the relationship
properties of the <fo:inline font-family="monospace">articles</fo:inline> that are retrieved is determined
by the metadata for the <fo:inline font-family="monospace">Article</fo:inline> entity class.
<fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7412">SELECT mag FROM Magazine mag LEFT JOIN FETCH mag.articles WHERE mag.id = 1
</fo:block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A fetch join has the same join semantics as the corresponding inner or outer
join, except that the related objects specified on the right-hand side of the
join operation are not returned in the query result or otherwise referenced in
the query. Hence, for example, if magazine id 1 has five articles, the above
query returns five references to the magazine 1 entity.
</fo:block></fo:block></fo:block><fo:block id="jpa_langref_collection_dec"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.3.6. 
JPQL Collection Member Declarations
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
An identification variable declared by a collection_member_declaration ranges
over values of a collection obtained by navigation using a path expression. Such
a path expression represents a navigation involving the association-fields of an
entity abstract schema type. Because a path expression can be based on another
path expression, the navigation can use the association-fields of related
entities. An identification variable of a collection member declaration is
declared using a special operator, the reserved identifier <fo:inline font-family="monospace">IN</fo:inline>
. The argument to the <fo:inline font-family="monospace">IN</fo:inline> operator is a collection-valued path
expression. The path expression evaluates to a collection type specified as a
result of navigation to a collection-valued association-field of an entity
abstract schema type. The syntax for declaring a collection member
identification variable is as follows:
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e7430"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7431"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>collection_member_declaration ::= IN
(collection_valued_path_expression) [AS] identification_variable
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
For example, the query <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7437">SELECT DISTINCT mag FROM Magazine mag
JOIN mag.articles art
JOIN art.author auth
WHERE auth.lastName = 'Grisham'</fo:block> may equivalently be
expressed as follows, using the <fo:inline font-family="monospace">IN</fo:inline> operator: <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7443">SELECT DISTINCT mag FROM Magazine mag,
IN(mag.articles) art
WHERE art.author.lastName = 'Grisham'</fo:block> In this example,
<fo:inline font-family="monospace">articles</fo:inline> is the name of an association-field whose value is a
collection of instances of the abstract schema type <fo:inline font-family="monospace">Article</fo:inline>.
The identification variable <fo:inline font-family="monospace">art</fo:inline> designates a member of this
collection, a single <fo:inline font-family="monospace">Article</fo:inline> abstract schema type instance.
In this example, <fo:inline font-family="monospace">mag</fo:inline> is an identification variable of the
abstract schema type <fo:inline font-family="monospace">Magazine</fo:inline>.
</fo:block></fo:block><fo:block id="jpa_langref_polymorph"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.3.7. 
JPQL Polymorphism
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Java Persistence queries are automatically polymorphic. The <fo:inline font-family="monospace">FROM
</fo:inline> clause of a query designates not only instances of the specific
entity classes to which explicitly refers but of subclasses as well. The
instances returned by a query include instances of the subclasses that satisfy
the query criteria.
</fo:block></fo:block></fo:block><fo:block id="jpa_langref_where"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
JPQL WHERE Clause
</fo:marker><fo:block font-size="17.28pt">10.2.4. 
JPQL WHERE Clause
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">WHERE</fo:inline> clause of a query consists of a conditional
expression used to select objects or values that satisfy the expression. The
<fo:inline font-family="monospace">WHERE</fo:inline> clause restricts the result of a select statement or
the scope of an update or delete operation. A <fo:inline font-family="monospace">WHERE</fo:inline> clause is
defined as follows: <fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e7486"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7487"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>where_clause ::= WHERE
conditional_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">GROUP BY</fo:inline> construct enables the aggregation of values
according to the properties of an entity class. The <fo:inline font-family="monospace">HAVING</fo:inline>
construct enables conditions to be specified that further restrict the query
result as restrictions upon the groups. The syntax of the <fo:inline font-family="monospace">HAVING
</fo:inline> clause is as follows: <fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e7502"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7503"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>having_clause
::= HAVING conditional_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">GROUP BY</fo:inline> and <fo:inline font-family="monospace">HAVING</fo:inline> constructs are
further discussed in <fo:basic-link internal-destination="jpa_langref_group"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.2.6, “
JPQL GROUP BY, HAVING
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_langref_group"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_langref_group"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block><fo:block id="jpa_langref_cond"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
JPQL Conditional Expressions
</fo:marker><fo:block font-size="17.28pt">10.2.5. 
JPQL Conditional Expressions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following sections describe the language constructs that can be used in a
conditional expression of the <fo:inline font-family="monospace">WHERE</fo:inline> clause or <fo:inline font-family="monospace">
HAVING</fo:inline> clause. State-fields that are mapped in serialized form or as
lobs may not be portably used in conditional expressions. <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e7528"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em"> The
implementation is not expected to perform such query operations involving such
fields in memory rather than in the database.
</fo:block></fo:block></fo:block>
</fo:block><fo:block id="jpa_langref_lit"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.5.1. 
JPQL Literals
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A string literal is enclosed in single quotes--for example: 'literal'. A string
literal that includes a single quote is represented by two single quotes--for
example: 'literal''s'. String literals in queries, like Java String literals,
use unicode character encoding. The use of Java escape notation is not supported
in query string literals Exact numeric literals support the use of Java integer
literal syntax as well as SQL exact numeric literal syntax. Approximate literals
support the use Java floating point literal syntax as well as SQL approximate
numeric literal syntax. Enum literals support the use of Java enum literal
syntax. The enum class name must be specified. Appropriate suffixes may be used
to indicate the specific type of a numeric literal in accordance with the Java
Language Specification. The boolean literals are <fo:inline font-family="monospace">TRUE</fo:inline> and
<fo:inline font-family="monospace">FALSE</fo:inline>. Although predefined reserved literals appear in upper
case, they are case insensitive.
</fo:block></fo:block><fo:block id="jpa_langref_idvar"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.5.2. 
JPQL Identification Variables
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
All identification variables used in the <fo:inline font-family="monospace">WHERE</fo:inline> or <fo:inline font-family="monospace">
HAVING</fo:inline> clause of a <fo:inline font-family="monospace">SELECT</fo:inline> or <fo:inline font-family="monospace">DELETE
</fo:inline> statement must be declared in the <fo:inline font-family="monospace">FROM</fo:inline> clause, as
described in <fo:basic-link internal-destination="jpa_langref_from_vars"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.2.3.2, “
JPQL Identification Variables
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_langref_from_vars"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_langref_from_vars"/>]</fo:inline></fo:basic-link>. The identification
variables used in the <fo:inline font-family="monospace">WHERE</fo:inline> clause of an <fo:inline font-family="monospace">UPDATE
</fo:inline> statement must be declared in the <fo:inline font-family="monospace">UPDATE</fo:inline> clause.
Identification variables are existentially quantified in the <fo:inline font-family="monospace">WHERE
</fo:inline> and <fo:inline font-family="monospace">HAVING</fo:inline> clause. This means that an
identification variable represents a member of a collection or an instance of an
entity's abstract schema type. An identification variable never designates a
collection in its entirety.
</fo:block></fo:block><fo:block id="jpa_langref_path_exp"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.5.3. 
JPQL Path Expressions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
It is illegal to use a collection_valued_path_expression within a <fo:inline font-family="monospace">
WHERE</fo:inline> or <fo:inline font-family="monospace">HAVING</fo:inline> clause as part of a conditional
expression except in an empty_collection_comparison_expression, in a
collection_member_expression, or as an argument to the <fo:inline font-family="monospace">SIZE</fo:inline>
operator.
</fo:block></fo:block><fo:block id="jpa_langref_input_params"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.5.4. 
JPQL Input Parameters
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Either positional or named parameters may be used. Positional and named
parameters may not be mixed in a single query. Input parameters can only be used
in the <fo:inline font-family="monospace">WHERE</fo:inline> clause or <fo:inline font-family="monospace">HAVING</fo:inline> clause of a
query.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Note that if an input parameter value is null, comparison operations or
arithmetic operations involving the input parameter will return an unknown
value. See <fo:basic-link internal-destination="jpa_langref_null_values"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.2.10, “
JPQL Null Values
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_langref_null_values"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_langref_null_values"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block id="jpa_langref_pos_params"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="12pt">10.2.5.4.1. 
JPQL Positional Parameters
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following rules apply to positional parameters. <fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e7614"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7615"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block> Input parameters are designated by the question mark (?) prefix followed
by an integer. For example: ?1.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7618"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Input parameters are numbered starting from 1. Note that the same parameter can
be used more than once in the query string and that the ordering of the use of
parameters within the query string need not conform to the order of the
positional parameters.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block></fo:block><fo:block id="jpa_langref_named_params"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="12pt">10.2.5.4.2. 
JPQL Named Parameters
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A named parameter is an identifier that is prefixed by the ":" symbol. It
follows the rules for identifiers defined in
<fo:basic-link internal-destination="jpa_langref_from_identifiers"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.2.3.1, “
JPQL FROM Identifiers
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_langref_from_identifiers"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_langref_from_identifiers"/>]</fo:inline></fo:basic-link>. Named parameters are case
sensitive.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Example: <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7631">SELECT pub FROM Publisher pub WHERE pub.revenue &gt; :rev
</fo:block>
</fo:block></fo:block></fo:block><fo:block id="jpa_langref_cond_comp"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.5.5. 
JPQL Conditional Expression Composition
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Conditional expressions are composed of other conditional expressions,
comparison operations, logical operations, path expressions that evaluate to
boolean values, boolean literals, and boolean input parameters. Arithmetic
expressions can be used in comparison expressions. Arithmetic expressions are
composed of other arithmetic expressions, arithmetic operations, path
expressions that evaluate to numeric values, numeric literals, and numeric input
parameters. Arithmetic operations use numeric promotion. Standard bracketing ()
for ordering expression evaluation is supported. Conditional expressions are
defined as follows:
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e7641"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7642"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>conditional_expression ::= conditional_term |
conditional_expression OR conditional_term
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7645"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
conditional_term ::= conditional_factor | conditional_term AND
conditional_factor
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7648"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
conditional_factor ::= [ NOT ] conditional_primary
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7651"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
conditional_primary ::= simple_cond_expression | (conditional_expression)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7654"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
simple_cond_expression ::= comparison_expression | between_expression |
like_expression | in_expression | null_comparison_expression |
empty_collection_comparison_expression | collection_member_expression |
exists_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Aggregate functions can only be used in conditional expressions in a <fo:inline font-family="monospace">
HAVING</fo:inline> clause. See <fo:basic-link internal-destination="jpa_langref_group"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.2.6, “
JPQL GROUP BY, HAVING
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_langref_group"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_langref_group"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block><fo:block id="jpa_langref_operators"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.5.6. 
JPQL Operators and Operator Precedence
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The operators are listed below in order of decreasing precedence. <fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e7670"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7671"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block> Navigation operator (.)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7674"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Arithmetic operators: +, - unary *, / multiplication and division +, - addition
and subtraction
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7677"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Comparison operators: =, &gt;, &gt;=, &lt;, &lt;=, &lt;&gt; (not equal), [
<fo:inline font-family="monospace">NOT</fo:inline> ] <fo:inline font-family="monospace">BETWEEN</fo:inline>, [ <fo:inline font-family="monospace">NOT</fo:inline> ]
<fo:inline font-family="monospace">LIKE</fo:inline>, [ <fo:inline font-family="monospace">NOT</fo:inline> ] <fo:inline font-family="monospace">IN</fo:inline>,
<fo:inline font-family="monospace">IS</fo:inline> [ <fo:inline font-family="monospace">NOT</fo:inline> ] <fo:inline font-family="monospace">NULL</fo:inline>,
<fo:inline font-family="monospace">IS</fo:inline> [ <fo:inline font-family="monospace">NOT</fo:inline> ] <fo:inline font-family="monospace">EMPTY</fo:inline>, [
<fo:inline font-family="monospace">NOT</fo:inline> ] <fo:inline font-family="monospace">MEMBER</fo:inline> [ <fo:inline font-family="monospace">OF</fo:inline> ]
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7725"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Logical operators: <fo:inline font-family="monospace">NOT</fo:inline><fo:inline font-family="monospace">AND</fo:inline><fo:inline font-family="monospace">OR
</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
The following sections describe other operators used in specific expressions.
</fo:block></fo:block><fo:block id="jpa_langref_between"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.5.7. 
JPQL Between Expressions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The syntax for the use of the comparison operator [ <fo:inline font-family="monospace">NOT</fo:inline> ]
<fo:inline font-family="monospace">BETWEEN</fo:inline> in a conditional expression is as follows:
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
arithmetic_expression [NOT] BETWEEN arithmetic_expression AND
arithmetic_expression | string_expression [NOT] BETWEEN string_expression AND
string_expression | datetime_expression [NOT] BETWEEN datetime_expression AND
datetime_expression
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The BETWEEN expression <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7751">x BETWEEN y AND z</fo:block> is
semantically equivalent to: <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7754">y &lt;= x AND x &lt;= z
</fo:block> The rules for unknown and <fo:inline font-family="monospace">NULL</fo:inline> values in
comparison operations apply. See <fo:basic-link internal-destination="jpa_langref_null_values"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.2.10, “
JPQL Null Values
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_langref_null_values"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_langref_null_values"/>]</fo:inline></fo:basic-link>
. Examples are: <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7762">p.age BETWEEN 15 and 19</fo:block> is
equivalent to <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7765">p.age &gt;= 15 AND p.age &lt;= 19</fo:block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7770">p.age NOT BETWEEN 15 and 19</fo:block> is equivalent to
<fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7773">p.age &lt; 15 OR p.age &gt; 19</fo:block>
</fo:block></fo:block><fo:block id="jpa_langref_in"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.5.8. 
JPQL In Expressions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The syntax for the use of the comparison operator [ <fo:inline font-family="monospace">NOT</fo:inline> ]
<fo:inline font-family="monospace">IN</fo:inline> in a conditional expression is as follows:
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e7789"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7790"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>in_expression ::= state_field_path_expression
[NOT] IN ( in_item {, in_item}* | subquery)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7793"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
in_item ::= literal | input_parameter
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The state_field_path_expression must have a string, numeric, or enum value. The
literal and/or input_parameter values must be like the same abstract schema type
of the state_field_path_expression in type. (See
<fo:basic-link internal-destination="jpa_langref_equality"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.2.11, “
JPQL Equality and Comparison Semantics
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_langref_equality"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_langref_equality"/>]</fo:inline></fo:basic-link> ).
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The results of the subquery must be like the same abstract schema type of the
state_field_path_expression in type. Subqueries are discussed in
<fo:basic-link internal-destination="jpa_langref_subqueries"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.2.5.15, “
JPQL Subqueries
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_langref_subqueries"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_langref_subqueries"/>]</fo:inline></fo:basic-link>. Examples are: <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7805">o.country IN ('UK', 'US', 'France')
</fo:block> is true for UK and false for Peru, and is equivalent to the
expression: <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7808">(o.country = 'UK') OR (o.country = 'US') OR (o.country = ' France')
</fo:block> In the following expression: <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7811">o.country NOT IN ('UK', 'US', 'France')
</fo:block> is false for UK and true for Peru, and is equivalent to the
expression: <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7814">NOT ((o.country = 'UK') OR (o.country = 'US') OR (o.country = 'France'))
</fo:block> There must be at least one element in the comma separated list
that defines the set of values for the <fo:inline font-family="monospace">IN</fo:inline> expression. If the
value of a state_field_path_expression in an <fo:inline font-family="monospace">IN</fo:inline> or <fo:inline font-family="monospace">
NOT IN</fo:inline> expression is <fo:inline font-family="monospace">NULL</fo:inline> or unknown, the value of
the expression is unknown.
</fo:block></fo:block><fo:block id="jpa_langref_like"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.5.9. 
JPQL Like Expressions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The syntax for the use of the comparison operator [ <fo:inline font-family="monospace">NOT</fo:inline> ]
<fo:inline font-family="monospace">LIKE</fo:inline> in a conditional expression is as follows:
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
string_expression [NOT] LIKE pattern_value [ESCAPE escape_character]
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The string_expression must have a string value. The pattern_value is a string
literal or a string-valued input parameter in which an underscore (_) stands for
any single character, a percent (%) character stands for any sequence of
characters (including the empty sequence), and all other characters stand for
themselves. The optional escape_character is a single-character string literal
or a character-valued input parameter (i.e., char or Character) and is used to
escape the special meaning of the underscore and percent characters in
pattern_value. Examples are:
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e7846"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7847"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7849">address.phone LIKE '12%3'
</fo:block> is true for '123' '12993' and false for '1234'
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7852"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7855">asentence.word LIKE 'l_se'</fo:block> is true for 'lose'
and false for 'loose'
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7858"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7861">aword.underscored LIKE '\_%' ESCAPE '\'</fo:block> is true
for '_foo' and false for 'bar'
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7864"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7867">address.phone NOT LIKE '12%3'</fo:block> is false for
'123' and '12993' and true for '1234' If the value of the string_expression or
pattern_value is <fo:inline font-family="monospace">NULL</fo:inline> or unknown, the value of the <fo:inline font-family="monospace">
LIKE</fo:inline> expression is unknown. If the escape_character is specified and
is <fo:inline font-family="monospace">NULL</fo:inline>, the value of the <fo:inline font-family="monospace">LIKE</fo:inline> expression
is unknown.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block></fo:block><fo:block id="jpa_langref_null"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.5.10. 
JPQL Null Comparison Expressions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The syntax for the use of the comparison operator <fo:inline font-family="monospace">IS NULL</fo:inline> in
a conditional expression is as follows:
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
{single_valued_path_expression | input_parameter } IS [NOT] NULL
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A null comparison expression tests whether or not the single-valued path
expression or input parameter is a <fo:inline font-family="monospace">NULL</fo:inline> value.
</fo:block></fo:block><fo:block id="jpa_langref_empty_comp"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.5.11. 
JPQL Empty Collection Comparison Expressions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The syntax for the use of the comparison operator <fo:inline font-family="monospace">IS EMPTY</fo:inline> in
an empty_collection_comparison_expression is as follows:
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
collection_valued_path_expression IS [NOT] EMPTY
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This expression tests whether or not the collection designated by the
collection-valued path expression is empty (i.e, has no elements).
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
For example, the following query will return all magazines that don't have any
articles at all: <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7912">SELECT mag FROM Magazine mag WHERE mag.articles IS EMPTY
</fo:block> If the value of the collection-valued path expression in an
empty collection comparison expression is unknown, the value of the empty
comparison expression is unknown.
</fo:block></fo:block><fo:block id="jpa_langref_collection_member"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.5.12. 
JPQL Collection Member Expressions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The use of the comparison collection_member_expression is as follows: syntax for
the operator <fo:inline font-family="monospace">MEMBER OF</fo:inline> in an <fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e7923"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7924"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
collection_member_expression ::= entity_expression [NOT] MEMBER [OF]
collection_valued_path_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7927"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
entity_expression ::= single_valued_association_path_expression |
simple_entity_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7930"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
simple_entity_expression ::= identification_variable | input_parameter
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This expression tests whether the designated value is a member of the collection
specified by the collection-valued path expression. If the collection valued
path expression designates an empty collection, the value of the <fo:inline font-family="monospace">
MEMBER OF</fo:inline> expression is <fo:inline font-family="monospace">FALSE</fo:inline> and the value of the
<fo:inline font-family="monospace">NOT MEMBER OF</fo:inline> expression is <fo:inline font-family="monospace">TRUE</fo:inline>.
Otherwise, if the value of the collection-valued path expression or
single-valued association-field path expression in the collection member
expression is <fo:inline font-family="monospace">NULL</fo:inline> or unknown, the value of the collection
member expression is unknown.
</fo:block></fo:block><fo:block id="jpa_langref_exists"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.5.13. 
JPQL Exists Expressions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
An <fo:inline font-family="monospace">EXISTS</fo:inline> expression is a predicate that is true only if the
result of the subquery consists of one or more values and that is false
otherwise. The syntax of an exists expression is <fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e7959"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e7960"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
exists_expression ::= [NOT] EXISTS (subquery)
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The use of the reserved word OF is optional in this expression.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Example: <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e7968">SELECT DISTINCT auth FROM Author auth
WHERE EXISTS
(SELECT spouseAuthor FROM Author spouseAuthor WHERE spouseAuthor = auth.spouse)
</fo:block> The result of this query consists of all authors whose spouse
is also an author.
</fo:block></fo:block><fo:block id="jpa_langref_all_any"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.5.14. 
JPQL All or Any Expressions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
An <fo:inline font-family="monospace">ALL</fo:inline> conditional expression is a predicate that is true if
the comparison operation is true for all values in the result of the subquery or
the result of the subquery is empty. An <fo:inline font-family="monospace">ALL</fo:inline> conditional
expression is false if the result of the comparison is false for at least one
row, and is unknown if neither true nor false. An <fo:inline font-family="monospace">ANY</fo:inline>
conditional expression is a predicate that is true if the comparison operation
is true for some value in the result of the subquery. An <fo:inline font-family="monospace">ANY</fo:inline>
conditional expression is false if the result of the subquery is empty or if the
comparison operation is false for every value in the result of the subquery, and
is unknown if neither true nor false. The keyword <fo:inline font-family="monospace">SOME</fo:inline> is
synonymous with <fo:inline font-family="monospace">ANY</fo:inline>. The comparison operators used with
<fo:inline font-family="monospace">ALL</fo:inline> or <fo:inline font-family="monospace">ANY</fo:inline> conditional expressions are =,
&lt;, &lt;=, &gt;, &gt;=, &lt;&gt;. The result of the subquery must be like that
of the other argument to the comparison operator in type. See
<fo:basic-link internal-destination="jpa_langref_equality"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.2.11, “
JPQL Equality and Comparison Semantics
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_langref_equality"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_langref_equality"/>]</fo:inline></fo:basic-link>. The syntax of an <fo:inline font-family="monospace">ALL
</fo:inline> or <fo:inline font-family="monospace">ANY</fo:inline> expression is specified as follows:
<fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e8008"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8009"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>all_or_any_expression ::= { ALL | ANY | SOME}
(subquery)
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following example select the authors who make the highest salary for their
magazine: <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e8015">SELECT auth FROM Author auth
WHERE auth.salary &gt;= ALL(SELECT a.salary FROM Author a WHERE a.magazine = auth.magazine)
</fo:block>
</fo:block></fo:block><fo:block id="jpa_langref_subqueries"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.5.15. 
JPQL Subqueries
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Subqueries may be used in the <fo:inline font-family="monospace">WHERE</fo:inline> or <fo:inline font-family="monospace">HAVING
</fo:inline> clause. The syntax for subqueries is as follows: <fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e8029"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8030"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>subquery ::= simple_select_clause subquery_from_clause
[where_clause] [groupby_clause] [having_clause]
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Subqueries are restricted to the <fo:inline font-family="monospace">WHERE</fo:inline> and <fo:inline font-family="monospace">HAVING
</fo:inline> clauses in this release. Support for subqueries in the <fo:inline font-family="monospace">FROM
</fo:inline> clause will be considered in a later release of the specification.
<fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e8045"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8046"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>simple_select_clause ::= SELECT [DISTINCT]
simple_select_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8049"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
subquery_from_clause ::= FROM subselect_identification_variable_declaration {,
subselect_identification_variable_declaration}*
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8052"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
subselect_identification_variable_declaration ::=
identification_variable_declaration | association_path_expression [AS]
identification_variable | collection_member_declaration
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8055"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
simple_select_expression ::= single_valued_path_expression |
aggregate_expression | identification_variable
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Examples: <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e8061">SELECT DISTINCT auth FROM Author auth
WHERE EXISTS (SELECT spouseAuth FROM Author spouseAuth WHERE spouseAuth = auth.spouse)
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e8063">SELECT mag FROM Magazine mag
WHERE (SELECT COUNT(art) FROM mag.articles art) &gt; 10</fo:block>
Note that some contexts in which a subquery can be used require that the
subquery be a scalar subquery (i.e., produce a single result). This is
illustrated in the following example involving a numeric comparison operation.
<fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e8066">SELECT goodPublisher FROM Publisher goodPublisher
WHERE goodPublisher.revenue &lt; (SELECT AVG(p.revenue) FROM Publisher p)
</fo:block>
</fo:block></fo:block><fo:block id="jpa_langref_functional"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.5.16. 
JPQL Functional Expressions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The JPQL includes the following built-in functions, which may be used in the
<fo:inline font-family="monospace">WHERE</fo:inline> or <fo:inline font-family="monospace">HAVING</fo:inline> clause of a query. If the
value of any argument to a functional expression is null or unknown, the value
of the functional expression is unknown.
</fo:block><fo:block id="jpa_langref_string_fun"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="12pt">10.2.5.16.1. 
JPQL String Functions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e8085"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8086"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>functions_returning_strings ::=
CONCAT(string_primar y, string_primary) | SUBSTRING(string_primar y,
simple_arithmetic_expression, simple_arithmetic_expression) |
TRIM([[trim_specification] [trim_character] FROM] string_primary) |
LOWER(string_primar y) | UPPER(string_primar y)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8089"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
trim_specification ::= LEADING | TRAILING | BOTH
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8092"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
functions_returning_numerics ::= LENGTH(string_primar y) | LOCATE(string_primar
y, string_primar y[, simple_arithmetic_expression])
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">CONCAT</fo:inline> function returns a string that is a concatenation
of its arguments. The second and third arguments of the <fo:inline font-family="monospace">SUBSTRING
</fo:inline> function denote the starting position and length of the substring to
be returned. These arguments are integers. The first position of a string is
denoted by 1. The <fo:inline font-family="monospace">SUBSTRING</fo:inline> function returns a string. The
<fo:inline font-family="monospace">TRIM</fo:inline> function trims the specified character from a string. If
the character to be trimmed is not specified, it is assumed to be space (or
blank). The optional trim_character is a single-character string literal or a
character-valued input parameter (i.e., char or Character). If a trim
specification is not provided, <fo:inline font-family="monospace">BOTH</fo:inline> is assumed. The <fo:inline font-family="monospace">
TRIM</fo:inline> function returns the trimmed string. The <fo:inline font-family="monospace">LOWER</fo:inline>
and <fo:inline font-family="monospace">UPPER</fo:inline> functions convert a string to lower and upper case,
respectively. They return a string. The <fo:inline font-family="monospace">LOCATE</fo:inline> function
returns the position of a given string within a string, starting the search at a
specified position. It returns the first position at which the string was found
as an integer. The first argument is the string to be located; the second
argument is the string to be searched; the optional third argument is an integer
that represents the string position at which the search is started (by default,
the beginning of the string to be searched). The first position in a string is
denoted by 1. If the string is not found, 0 is returned. The <fo:inline font-family="monospace">LENGTH
</fo:inline> function returns the length of the string in characters as an
integer.
</fo:block></fo:block><fo:block id="jpa_langref_arithmetic"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="12pt">10.2.5.16.2. 
JPQL Arithmetic Functions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e8133"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8134"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>functions_returning_numerics ::=
ABS(simple_arithmetic_expression) | SQRT(simple_arithmetic_expression) |
MOD(simple_arithmetic_expression, simple_arithmetic_expression) |
SIZE(collection_valued_path_expression)
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">ABS</fo:inline> function takes a numeric argument and returns a
number (integer, float, or double) of the same type as the argument to the
function. The <fo:inline font-family="monospace">SQRT</fo:inline> function takes a numeric argument and
returns a double.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Note that not all databases support the use of a trim character other than the
space character; use of this argument may result in queries that are not
portable. Note that not all databases support the use of the third argument to
<fo:inline font-family="monospace">LOCATE</fo:inline>; use of this argument may result in queries that are
not portable.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">MOD</fo:inline> function takes two integer arguments and returns an
integer. The <fo:inline font-family="monospace">SIZE</fo:inline> function returns an integer value, the
number of elements of the collection. If the collection is empty, the <fo:inline font-family="monospace">
SIZE</fo:inline> function evaluates to zero. Numeric arguments to these functions
may correspond to the numeric Java object types as well as the primitive numeric
types.
</fo:block></fo:block><fo:block id="jpa_langref_datetime"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="12pt">10.2.5.16.3. 
JPQL Datetime Functions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
functions_returning_datetime:= CURRENT_DATE | CURRENT_TIME | CURRENT_TIMESTAMP
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The datetime functions return the value of current date, time, and timestamp on
the database server.
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_langref_group"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
JPQL GROUP BY, HAVING
</fo:marker><fo:block font-size="17.28pt">10.2.6. 
JPQL GROUP BY, HAVING
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">GROUP BY</fo:inline> construct enables the aggregation of values
according to a set of properties. The <fo:inline font-family="monospace">HAVING</fo:inline> construct
enables conditions to be specified that further restrict the query result. Such
conditions are restrictions upon the groups. The syntax of the <fo:inline font-family="monospace">GROUP
BY</fo:inline> and <fo:inline font-family="monospace">HAVING</fo:inline> clauses is as follows:
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e8188"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8189"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>groupby_clause ::= GROUP BY groupby_item {,
groupby_item}*
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8192"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
groupby_item ::= single_valued_path_expression | identification_variable
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8195"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
having_clause ::= HAVING conditional_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If a query contains both a <fo:inline font-family="monospace">WHERE</fo:inline> clause and a <fo:inline font-family="monospace">GROUP
BY</fo:inline> clause, the effect is that of first applying the where clause, and
then forming the groups and filtering them according to the <fo:inline font-family="monospace">HAVING
</fo:inline> clause. The <fo:inline font-family="monospace">HAVING</fo:inline> clause causes those groups to
be retained that satisfy the condition of the <fo:inline font-family="monospace">HAVING</fo:inline> clause.
The requirements for the <fo:inline font-family="monospace">SELECT</fo:inline> clause when <fo:inline font-family="monospace">GROUP
BY</fo:inline> is used follow those of SQL: namely, any item that appears in the
<fo:inline font-family="monospace">SELECT</fo:inline> clause (other than as an argument to an aggregate
function) must also appear in the <fo:inline font-family="monospace">GROUP BY</fo:inline> clause. In forming
the groups, null values are treated as the same for grouping purposes. Grouping
by an entity is permitted. In this case, the entity must contain no serialized
state fields or lob-valued state fields. The <fo:inline font-family="monospace">HAVING</fo:inline> clause
must specify search conditions over the grouping items or aggregate functions
that apply to grouping items.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If there is no <fo:inline font-family="monospace">GROUP BY</fo:inline> clause and the <fo:inline font-family="monospace">HAVING
</fo:inline> clause is used, the result is treated as a single group, and the
select list can only consist of aggregate functions. When a query declares a
<fo:inline font-family="monospace">HAVING</fo:inline> clause, it must always also declare a <fo:inline font-family="monospace">GROUP
BY</fo:inline> clause.
</fo:block></fo:block><fo:block id="jpa_langref_select_clause"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
JPQL SELECT Clause
</fo:marker><fo:block font-size="17.28pt">10.2.7. 
JPQL SELECT Clause
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">SELECT</fo:inline> clause denotes the query result. More than one
value may be returned from the <fo:inline font-family="monospace">SELECT</fo:inline> clause of a query. The
<fo:inline font-family="monospace">SELECT</fo:inline> clause may contain one or more of the following
elements: a single range variable or identification variable that ranges over an
entity abstract schema type, a single-valued path expression, an aggregate
select expression, a constructor expression. The <fo:inline font-family="monospace">SELECT</fo:inline>
clause has the following syntax:
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e8264"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8265"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>select_clause ::= SELECT [DISTINCT]
select_expression {, select_expression}*
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8268"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
select_expression ::= single_valued_path_expression | aggregate_expression |
identification_variable | OBJECT(identification_variable) |
constructor_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8271"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
constructor_expression ::= NEW constructor_name ( constructor_item {,
constructor_item}*)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8274"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
constructor_item ::= single_valued_path_expression | aggregate_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8277"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
aggregate_expression ::= { AVG | MAX | MIN | SUM } ([DISTINCT]
state_field_path_expression) | COUNT ([DISTINCT] identification_variable |
state_field_path_expression | single_valued_association_path_expression)
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
For example: <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e8283">SELECT pub.id, pub.revenue
FROM Publisher pub JOIN pub.magazines mag WHERE mag.price &gt; 5.00
</fo:block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Note that the <fo:inline font-family="monospace">SELECT</fo:inline> clause must be specified to return only
single-valued expressions. The query below is therefore not valid:
<fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e8291">SELECT mag.authors FROM Magazine AS mag</fo:block> The
<fo:inline font-family="monospace">DISTINCT</fo:inline> keyword is used to specify that duplicate values
must be eliminated from the query result. If <fo:inline font-family="monospace">DISTINCT</fo:inline> is not
specified, duplicate values are not eliminated. Standalone identification
variables in the <fo:inline font-family="monospace">SELECT</fo:inline> clause may optionally be qualified by
the <fo:inline font-family="monospace">OBJECT</fo:inline> operator. The <fo:inline font-family="monospace">SELECT</fo:inline> clause
must not use the OBJECT operator to qualify path expressions.
</fo:block><fo:block id="jpa_langref_resulttype"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.7.1. 
JPQL Result Type of the SELECT Clause
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The type of the query result specified by the <fo:inline font-family="monospace">SELECT</fo:inline> clause
of a query is an entity abstract schema type, a state-field type, the result of
an aggregate function, the result of a construction operation, or some sequence
of these. The result type of the <fo:inline font-family="monospace">SELECT</fo:inline> clause is defined by
the the result types of the select_expressions contained in it. When multiple
select_expressions are used in the <fo:inline font-family="monospace">SELECT</fo:inline> clause, the result
of the query is of type Object[], and the elements in this result correspond in
order to the order of their specification in the <fo:inline font-family="monospace">SELECT</fo:inline>
clause and in type to the result types of each of the select_expressions. The
type of the result of a select_expression is as follows: <fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e8326"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8327"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block> A single_valued_path_expression that is a
state_field_path_expression results in an object of the same type as the
corresponding state field of the entity. If the state field of the entity is a
primitive type, the corresponding object type is returned.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8330"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
single_valued_path_expression that is a
single_valued_association_path_expression results in an entity object of the
type of the relationship field or the subtype of the relationship field of the
entity object as determined by the object/relational mapping.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8333"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The result type of an identification_variable is the type of the entity to which
that identification variable corresponds or a subtype as determined by the
object/relational mapping.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8336"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The result type of aggregate_expression is defined in section
<fo:basic-link internal-destination="jpa_langref_aggregates"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.2.7.4, “
JPQL Aggregate Functions
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_langref_aggregates"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_langref_aggregates"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8341"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The result type of a constructor_expression is the type of the class for which
the constructor is defined. The types of the arguments to the constructor are
defined by the above rules.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block></fo:block><fo:block id="jpa_langref_constructor"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.7.2. 
JPQL Constructor Expressions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
in the <fo:inline font-family="monospace">SELECT</fo:inline> Clause A constructor may be used in the
<fo:inline font-family="monospace">SELECT</fo:inline> list to return one or more Java instances. The
specified class is not required to be an entity or to be mapped to the database.
The constructor name must be fully qualified.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If an entity class name is specified in the <fo:inline font-family="monospace">SELECT NEW</fo:inline>
clause, the resulting entity instances are in the new state. <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e8361">SELECT NEW com.company.PublisherInfo(pub.id, pub.revenue, mag.price)
FROM Publisher pub JOIN pub.magazines mag WHERE mag.price &gt; 5.00
</fo:block>
</fo:block></fo:block><fo:block id="jpa_langref_null_select"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.7.3. 
JPQL Null Values in the Query Result
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If the result of a query corresponds to a association-field or state-field whose
value is null, that null value is returned in the result of the query method.
The <fo:inline font-family="monospace">IS NOT NULL</fo:inline> construct can be used to eliminate such null
values from the result set of the query. Note, however, that state-field types
defined in terms of Java numeric primitive types cannot produce <fo:inline font-family="monospace">NULL
</fo:inline> values in the query result. A query that returns such a state-field
type as a result type must not return a null value.
</fo:block></fo:block><fo:block id="jpa_langref_aggregates"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">10.2.7.4. 
JPQL Aggregate Functions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
in the <fo:inline font-family="monospace">SELECT</fo:inline> Clause The result of a query may be the result
of an aggregate function applied to a path expression. The following aggregate
functions can be used in the <fo:inline font-family="monospace">SELECT</fo:inline> clause of a query:
<fo:inline font-family="monospace">AVG</fo:inline>, <fo:inline font-family="monospace">COUNT</fo:inline>, <fo:inline font-family="monospace">MAX</fo:inline>,
<fo:inline font-family="monospace">MIN</fo:inline>, <fo:inline font-family="monospace">SUM</fo:inline>. For all aggregate functions
except <fo:inline font-family="monospace">COUNT</fo:inline>, the path expression that is the argument to
the aggregate function must terminate in a state-field. The path expression
argument to <fo:inline font-family="monospace">COUNT</fo:inline> may terminate in either a state-field or a
association-field, or the argument to <fo:inline font-family="monospace">COUNT</fo:inline> may be an
identification variable. Arguments to the functions <fo:inline font-family="monospace">SUM</fo:inline> and
<fo:inline font-family="monospace">AVG</fo:inline> must be numeric. Arguments to the functions <fo:inline font-family="monospace">MAX
</fo:inline> and <fo:inline font-family="monospace">MIN</fo:inline> must correspond to orderable state-field
types (i.e., numeric types, string types, character types, or date types). The
Java type that is contained in the result of a query using an aggregate function
is as follows: <fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e8422"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8423"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block><fo:inline font-family="monospace">COUNT</fo:inline> returns
Long.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8428"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">MAX</fo:inline>, <fo:inline font-family="monospace">MIN</fo:inline> return the type of the
state-field to which they are applied.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8437"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">AVG</fo:inline> returns Double.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8443"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">SUM</fo:inline> returns Long when applied to state-fields of integral
types (other than BigInteger); Double when applied to state-fields of floating
point types; BigInteger when applied to state-fields of type BigInteger; and
BigDecimal when applied to state-fields of type BigDecimal. If <fo:inline font-family="monospace">SUM
</fo:inline>, <fo:inline font-family="monospace">AVG</fo:inline>, <fo:inline font-family="monospace">MAX</fo:inline>, or <fo:inline font-family="monospace">MIN
</fo:inline> is used, and there are no values to which the aggregate function can
be applied, the result of the aggregate function is <fo:inline font-family="monospace">NULL</fo:inline>. If
<fo:inline font-family="monospace">COUNT</fo:inline> is used, and there are no values to which <fo:inline font-family="monospace">
COUNT</fo:inline> can be applied, the result of the aggregate function is 0.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The argument to an aggregate function may be preceded by the keyword <fo:inline font-family="monospace">
DISTINCT</fo:inline> to specify that duplicate values are to be eliminated before
the aggregate function is applied. Null values are eliminated before the
aggregate function is applied, regardless of whether the keyword <fo:inline font-family="monospace">
DISTINCT</fo:inline> is specified.
</fo:block><fo:block id="jpa_langref_agg_examples"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="12pt">10.2.7.4.1. 
JPQL Aggregate Examples
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Examples The following query returns the average price of all magazines:
<fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e8484">SELECT AVG(mag.price) FROM Magazine mag</fo:block> The
following query returns the sum total cost of all the prices from all the
magazines published by 'Larry': <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e8487">SELECT SUM(mag.price) FROM Publisher pub JOIN pub.magazines mag pub.firstName = 'Larry'
</fo:block> The following query returns the total number of magazines:
<fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e8490">SELECT COUNT(mag) FROM Magazine mag</fo:block>
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_langref_orderby"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
JPQL ORDER BY Clause
</fo:marker><fo:block font-size="17.28pt">10.2.8. 
JPQL ORDER BY Clause
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">ORDER BY</fo:inline> clause allows the objects or values that are
returned by the query to be ordered. The syntax of the <fo:inline font-family="monospace">ORDER BY
</fo:inline> clause is
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e8506"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8507"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>orderby_clause ::= ORDER BY orderby_item {,
orderby_item}*
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8510"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
orderby_item ::= state_field_path_expression [ASC | DESC]
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
It is legal to specify <fo:inline font-family="monospace">DISTINCT</fo:inline> with <fo:inline font-family="monospace">MAX</fo:inline>
or <fo:inline font-family="monospace">MIN</fo:inline>, but it does not affect the result.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When the <fo:inline font-family="monospace">ORDER BY</fo:inline> clause is used in a query, each element of
the <fo:inline font-family="monospace">SELECT</fo:inline> clause of the query must be one of the following:
an identification variable x, optionally denoted as <fo:inline font-family="monospace">OBJECT(x)</fo:inline>
, a single_valued_association_path_expression, or a state_field_path_expression.
For example: <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e8536">
SELECT pub FROM Publisher pub JOIN pub.magazines mag ORDER BY o.revenue, o.name
</fo:block> If more than one orderby_item is specified, the left-to-right
sequence of the orderby_item elements determines the precedence, whereby the
leftmost orderby_item has highest precedence. The keyword <fo:inline font-family="monospace">ASC</fo:inline>
specifies that ascending ordering be used; the keyword <fo:inline font-family="monospace">DESC</fo:inline>
specifies that descending ordering be used. Ascending ordering is the default.
SQL rules for the ordering of null values apply: that is, all null values must
appear before all non-null values in the ordering or all null values must appear
after all non-null values in the ordering, but it is not specified which. The
ordering of the query result is preserved in the result of the query method if
the <fo:inline font-family="monospace">ORDER BY</fo:inline> clause is used.
</fo:block></fo:block><fo:block id="jpa_langref_bulk_ops"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
JPQL Bulk Update and Delete
</fo:marker><fo:block font-size="17.28pt">10.2.9. 
JPQL Bulk Update and Delete
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Operations Bulk update and delete operations apply to entities of a single
entity class (together with its subclasses, if any). Only one entity abstract
schema type may be specified in the <fo:inline font-family="monospace">FROM</fo:inline> or <fo:inline font-family="monospace">UPDATE
</fo:inline> clause. The syntax of these operations is as follows:
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e8561"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8562"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>update_statement ::= update_clause [where_clause]
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8565"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
update_clause ::= UPDATE abstract_schema_name [[AS] identification_variable] SET
update_item {, update_item}*
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8568"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
update_item ::= [identification_variable.]{state_field |
single_valued_association_field} = new_value
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8571"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
new_value ::= simple_arithmetic_expression | string_primary | datetime_primary |
boolean_primary | enum_primary simple_entity_expression | NULL
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8574"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
delete_statement ::= delete_clause [where_clause]
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8577"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
delete_clause ::= DELETE FROM abstract_schema_name [[AS]
identification_variable]
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The syntax of the <fo:inline font-family="monospace">WHERE</fo:inline> clause is described in
<fo:basic-link internal-destination="jpa_langref_where"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.2.4, “
JPQL WHERE Clause
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_langref_where"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_langref_where"/>]</fo:inline></fo:basic-link>. A delete operation only applies to
entities of the specified class and its subclasses. It does not cascade to
related entities. The new_value specified for an update operation must be
compatible in type with the state-field to which it is assigned. Bulk update
maps directly to a database update operation, bypassing optimistic locking
checks. Portable applications must manually update the value of the version
column, if desired, and/or manually validate the value of the version column.
The persistence context is not synchronized with the result of the bulk update
or delete. Caution should be used when executing bulk update or delete
operations because they may result in inconsistencies between the database and
the entities in the active persistence context. In general, bulk update and
delete operations should only be performed within a separate transaction or at
the beginning of a transaction (before entities have been accessed whose state
might be affected by such operations).
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Examples: <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e8590">DELETE FROM Publisher pub WHERE pub.revenue &gt; 1000000.0
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e8592">DELETE FROM Publisher pub WHERE pub.revenue = 0 AND pub.magazines IS EMPTY
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e8594">UPDATE Publisher pub SET pub.status = 'outstanding'
WHERE pub.revenue &lt; 1000000 AND 20 &gt; (SELECT COUNT(mag) FROM pub.magazines mag)
</fo:block>
</fo:block></fo:block><fo:block id="jpa_langref_null_values"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
JPQL Null Values
</fo:marker><fo:block font-size="17.28pt">10.2.10. 
JPQL Null Values
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When the target of a reference does not exist in the database, its value is
regarded as <fo:inline font-family="monospace">NULL</fo:inline>. SQL 92 <fo:inline font-family="monospace">NULL</fo:inline> semantics
defines the evaluation of conditional expressions containing <fo:inline font-family="monospace">NULL
</fo:inline> values. The following is a brief description of these semantics:
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e8613"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8614"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block> Comparison or arithmetic operations with a
<fo:inline font-family="monospace">NULL</fo:inline> value always yield an unknown value.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8620"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Two <fo:inline font-family="monospace">NULL</fo:inline> values are not considered to be equal, the
comparison yields an unknown value.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8626"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Comparison or arithmetic operations with an unknown value always yield an
unknown value.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8629"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The <fo:inline font-family="monospace">IS NULL</fo:inline> and <fo:inline font-family="monospace">IS NOT NULL</fo:inline> operators
convert a <fo:inline font-family="monospace">NULL</fo:inline> state-field or single-valued association-field
value into the respective <fo:inline font-family="monospace">TRUE</fo:inline> or <fo:inline font-family="monospace">FALSE</fo:inline>
value.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Note: The JPQL defines the empty string, "", as a string with 0 length, which is
not equal to a <fo:inline font-family="monospace">NULL</fo:inline> value. However, <fo:inline font-family="monospace">NULL</fo:inline>
values and empty strings may not always be distinguished when queries are mapped
to some databases. Application developers should therefore not rely on the
semantics of query comparisons involving the empty string and <fo:inline font-family="monospace">NULL
</fo:inline> value.
</fo:block></fo:block><fo:block id="jpa_langref_equality"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
JPQL Equality and Comparison Semantics
</fo:marker><fo:block font-size="17.28pt">10.2.11. 
JPQL Equality and Comparison Semantics
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Only the values of like types are permitted to be compared. A type is like
another type if they correspond to the same Java language type, or if one is a
primitive Java language type and the other is the wrappered Java class type
equivalent (e.g., int and Integer are like types in this sense). There is one
exception to this rule: it is valid to compare numeric values for which the
rules of numeric promotion apply. Conditional expressions attempting to compare
non-like type values are disallowed except for this numeric case. Note that the
arithmetic operators and comparison operators are permitted to be applied to
state-fields and input parameters of the wrappered Java class equivalents to the
primitive numeric Java types. Two entities of the same abstract schema type are
equal if and only if they have the same primary key value. Only
equality/inequality comparisons over enums are required to be supported.
</fo:block></fo:block><fo:block id="jpa_langref_bnf"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
JPQL BNF
</fo:marker><fo:block font-size="17.28pt">10.2.12. 
JPQL BNF
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following is the BNF for the Java Persistence query language, from section
4.14 of the JSR 220 specification.
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e8669"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8670"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
QL_statement ::= select_statement | update_statement | delete_statement
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8673"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
select_statement ::= select_clause from_clause [where_clause] [groupby_clause]
[having_clause] [orderby_clause]
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8676"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
update_statement ::= update_clause [where_clause]
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8679"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
delete_statement ::= delete_clause [where_clause]
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8682"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
from_clause ::= <fo:inline font-family="monospace">FROM</fo:inline> identification_variable_declaration {,
{identification_variable_declaration | collection_member_declaration}}*
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8688"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
identification_variable_declaration ::= range_variable_declaration { join |
fetch_join }*
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8691"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
range_variable_declaration ::= abstract_schema_name [ <fo:inline font-family="monospace">AS</fo:inline> ]
identification_variable
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8697"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
join ::= join_spec join_association_path_expression [ <fo:inline font-family="monospace">AS</fo:inline> ]
identification_variable
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8703"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
fetch_join ::= join_spec <fo:inline font-family="monospace">FETCH</fo:inline>
join_association_path_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8709"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
association_path_expression ::= collection_valued_path_expression |
single_valued_association_path_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8712"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
join_spec ::= [ <fo:inline font-family="monospace">LEFT</fo:inline> [ <fo:inline font-family="monospace">OUTER</fo:inline> ]| <fo:inline font-family="monospace">
INNER</fo:inline> ] <fo:inline font-family="monospace">JOIN</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8727"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
join_association_path_expression ::= join_collection_valued_path_expression |
join_single_valued_association_path_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8730"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
join_collection_valued_path_expression ::=
identification_variable.collection_valued_association_field
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8733"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
join_single_valued_association_path_expression ::=
identification_variable.single_valued_association_field
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8736"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
collection_member_declaration ::= <fo:inline font-family="monospace">IN</fo:inline>
(collection_valued_path_expression) [ <fo:inline font-family="monospace">AS</fo:inline> ]
identification_variable
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8745"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
single_valued_path_expression ::= state_field_path_expression |
single_valued_association_path_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8748"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
state_field_path_expression ::= {identification_variable |
single_valued_association_path_expression}.state_field
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8751"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
single_valued_association_path_expression ::=
identification_variable.{single_valued_association_field.}*
single_valued_association_field
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8754"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
collection_valued_path_expression ::=
identification_variable.{single_valued_association_field.}*collection_valued_association_field
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8757"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
state_field ::= {embedded_class_state_field.}*simple_state_field
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8760"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
update_clause ::= <fo:inline font-family="monospace">UPDATE</fo:inline> abstract_schema_name [[ <fo:inline font-family="monospace">AS
</fo:inline> ] identification_variable] <fo:inline font-family="monospace">SET</fo:inline> update_item {,
update_item}*
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8772"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
update_item ::= [identification_variable.]{state_field |
single_valued_association_field}= new_value
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8775"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
new_value ::= simple_arithmetic_expression | string_primary | datetime_primary |
boolean_primary | enum_primary simple_entity_expression | <fo:inline font-family="monospace">NULL
</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8781"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
delete_clause ::= <fo:inline font-family="monospace">DELETE</fo:inline><fo:inline font-family="monospace">FROM</fo:inline>
abstract_schema_name [[ <fo:inline font-family="monospace">AS</fo:inline> ] identification_variable]
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8792"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
select_clause ::= <fo:inline font-family="monospace">SELECT</fo:inline> [ <fo:inline font-family="monospace">DISTINCT</fo:inline> ]
select_expression {, select_expression}*
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8801"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
select_expression ::= single_valued_path_expression | aggregate_expression |
identification_variable | <fo:inline font-family="monospace">OBJECT</fo:inline> (identification_variable)|
constructor_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8807"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
constructor_expression ::= <fo:inline font-family="monospace">NEW</fo:inline> constructor_name(
constructor_item {, constructor_item}*)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8813"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
constructor_item ::= single_valued_path_expression | aggregate_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8816"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
aggregate_expression ::= { <fo:inline font-family="monospace">AVG</fo:inline> | <fo:inline font-family="monospace">MAX</fo:inline> |
<fo:inline font-family="monospace">MIN</fo:inline> | <fo:inline font-family="monospace">SUM</fo:inline> }([ <fo:inline font-family="monospace">DISTINCT</fo:inline>
] state_field_path_expression) | <fo:inline font-family="monospace">COUNT</fo:inline> ([ <fo:inline font-family="monospace">DISTINCT
</fo:inline> ] identification_variable | state_field_path_expression |
single_valued_association_path_expression)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8840"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
where_clause ::= <fo:inline font-family="monospace">WHERE</fo:inline> conditional_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8846"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
groupby_clause ::= <fo:inline font-family="monospace">GROUP</fo:inline><fo:inline font-family="monospace">BY</fo:inline> groupby_item {,
groupby_item}*
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8854"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
groupby_item ::= single_valued_path_expression | identification_variable
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8857"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
having_clause ::= <fo:inline font-family="monospace">HAVING</fo:inline> conditional_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8863"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
orderby_clause ::= <fo:inline font-family="monospace">ORDER</fo:inline><fo:inline font-family="monospace">BY</fo:inline> orderby_item {,
orderby_item}*
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8871"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
orderby_item ::= state_field_path_expression [ <fo:inline font-family="monospace">ASC</fo:inline> |
<fo:inline font-family="monospace">DESC</fo:inline> ]
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8880"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
subquery ::= simple_select_clause subquery_from_clause [where_clause]
[groupby_clause] [having_clause]
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8883"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
subquery_from_clause ::= <fo:inline font-family="monospace">FROM</fo:inline>
subselect_identification_variable_declaration {,
subselect_identification_variable_declaration}*
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8889"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
subselect_identification_variable_declaration ::=
identification_variable_declaration | association_path_expression [ <fo:inline font-family="monospace">AS
</fo:inline> ] identification_variable | collection_member_declaration
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8895"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
simple_select_clause ::= <fo:inline font-family="monospace">SELECT</fo:inline> [ <fo:inline font-family="monospace">DISTINCT</fo:inline>
] simple_select_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8904"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
simple_select_expression ::= single_valued_path_expression |
aggregate_expression | identification_variable
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8907"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
conditional_expression ::= conditional_term | conditional_expression <fo:inline font-family="monospace">
OR</fo:inline> conditional_term
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8913"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
conditional_term ::= conditional_factor | conditional_term <fo:inline font-family="monospace">AND
</fo:inline> conditional_factor
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8919"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
conditional_factor ::= [ <fo:inline font-family="monospace">NOT</fo:inline> ] conditional_primary
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8925"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
conditional_primary ::= simple_cond_expression |(conditional_expression)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8928"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
simple_cond_expression ::= comparison_expression | between_expression |
like_expression | in_expression | null_comparison_expression |
empty_collection_comparison_expression | collection_member_expression |
exists_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8931"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
between_expression ::= arithmetic_expression [ <fo:inline font-family="monospace">NOT</fo:inline> ]
<fo:inline font-family="monospace">BETWEEN</fo:inline> arithmetic_expression <fo:inline font-family="monospace">AND</fo:inline>
arithmetic_expression | string_expression [ <fo:inline font-family="monospace">NOT</fo:inline> ] <fo:inline font-family="monospace">
BETWEEN</fo:inline> string_expression <fo:inline font-family="monospace">AND</fo:inline> string_expression |
datetime_expression [ <fo:inline font-family="monospace">NOT</fo:inline> ] <fo:inline font-family="monospace">BETWEEN</fo:inline>
datetime_expression <fo:inline font-family="monospace">AND</fo:inline> datetime_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8961"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
in_expression ::= state_field_path_expression [ <fo:inline font-family="monospace">NOT</fo:inline> ]
<fo:inline font-family="monospace">IN</fo:inline> ( in_item {, in_item}* | subquery)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8970"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
in_item ::= literal | input_parameter
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8973"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
like_expression ::= string_expression [ <fo:inline font-family="monospace">NOT</fo:inline> ] <fo:inline font-family="monospace">LIKE
</fo:inline> pattern_value [ <fo:inline font-family="monospace">ESCAPE</fo:inline> escape_character]
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8985"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
null_comparison_expression ::= {single_valued_path_expression | input_parameter}
<fo:inline font-family="monospace">IS</fo:inline> [ <fo:inline font-family="monospace">NOT</fo:inline> ] <fo:inline font-family="monospace">NULL</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e8997"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
empty_collection_comparison_expression ::= collection_valued_path_expression
<fo:inline font-family="monospace">IS</fo:inline> [ <fo:inline font-family="monospace">NOT</fo:inline> ] <fo:inline font-family="monospace">EMPTY</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9009"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
collection_member_expression ::= entity_expression [ <fo:inline font-family="monospace">NOT</fo:inline> ]
<fo:inline font-family="monospace">MEMBER</fo:inline> [ <fo:inline font-family="monospace">OF</fo:inline> ]
collection_valued_path_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9021"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
exists_expression ::= [ <fo:inline font-family="monospace">NOT</fo:inline> ] <fo:inline font-family="monospace">EXISTS</fo:inline>
(subquery)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9030"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
all_or_any_expression ::= { <fo:inline font-family="monospace">ALL</fo:inline> | <fo:inline font-family="monospace">ANY</fo:inline> |
<fo:inline font-family="monospace">SOME</fo:inline> }(subquery)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9042"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
comparison_expression ::=
string_expressioncomparison_operator{string_expression|all_or_any_expression}|
boolean_expression {=|&lt;&gt;} {boolean_expression | all_or_any_expression} |
enum_expression {=|&lt;&gt;} {enum_expression | all_or_any_expression} |
datetime_expression comparison_operator {datetime_expression |
all_or_any_expression} | entity_expression {= |&lt;&gt; } {entity_expression |
all_or_any_expression} | arithmetic_expression comparison_operator
{arithmetic_expression | all_or_any_expression}
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9045"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
comparison_operator ::== |&gt; |&gt;= |&lt; |&lt;= |&lt;&gt;
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9048"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
arithmetic_expression ::= simple_arithmetic_expression |(subquery)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9051"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
simple_arithmetic_expression ::= arithmetic_term | simple_arithmetic_expression
{+ |- } arithmetic_term
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9054"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
arithmetic_term ::= arithmetic_factor | arithmetic_term {* |/ }
arithmetic_factor
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9057"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
arithmetic_factor ::= [{+ |-}] arithmetic_primary
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9060"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
arithmetic_primary ::= state_field_path_expression | numeric_literal |
(simple_arithmetic_expression) | input_parameter | functions_returning_numerics
| aggregate_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9063"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
string_expression ::= string_primary |(subquery)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9066"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
string_primary ::= state_field_path_expression | string_literal |
input_parameter | functions_returning_strings | aggregate_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9069"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
datetime_expression ::= datetime_primary |(subquery)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9072"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
datetime_primary ::= state_field_path_expression | input_parameter |
functions_returning_datetime | aggregate_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9075"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
boolean_expression ::= boolean_primary |(subquery)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9078"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
boolean_primary ::= state_field_path_expression | boolean_literal |
input_parameter |
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9081"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
enum_expression ::= enum_primary |(subquery)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9084"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
enum_primary ::= state_field_path_expression | enum_literal | input_parameter |
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9087"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
entity_expression ::= single_valued_association_path_expression |
simple_entity_expression
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9090"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
simple_entity_expression ::= identification_variable | input_parameter
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9093"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
functions_returning_numerics ::= <fo:inline font-family="monospace">LENGTH</fo:inline> (string_primary)|
<fo:inline font-family="monospace">LOCATE</fo:inline> (string_primary,string_primary [,
simple_arithmetic_expression]) | <fo:inline font-family="monospace">ABS</fo:inline>
(simple_arithmetic_expression) | <fo:inline font-family="monospace">SQRT</fo:inline>
(simple_arithmetic_expression) | <fo:inline font-family="monospace">MOD</fo:inline>
(simple_arithmetic_expression, simple_arithmetic_expression) | <fo:inline font-family="monospace">SIZE
</fo:inline> (collection_valued_path_expression)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9114"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
functions_returning_datetime ::= <fo:inline font-family="monospace">CURRENT_DATE</fo:inline> | <fo:inline font-family="monospace">
CURRENT_TIME</fo:inline> | <fo:inline font-family="monospace">CURRENT_TIMESTAMP</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9126"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
functions_returning_strings ::= <fo:inline font-family="monospace">CONCAT</fo:inline> (string_primary,
string_primary) | <fo:inline font-family="monospace">SUBSTRING</fo:inline> (string_primary,
simple_arithmetic_expression,simple_arithmetic_expression)| <fo:inline font-family="monospace">TRIM
</fo:inline> ([[trim_specification] [trim_character] <fo:inline font-family="monospace">FROM</fo:inline> ]
string_primary) | <fo:inline font-family="monospace">LOWER</fo:inline> (string_primary) | <fo:inline font-family="monospace">UPPER
</fo:inline> (string_primary)
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9147"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
trim_specification ::= <fo:inline font-family="monospace">LEADING</fo:inline> | <fo:inline font-family="monospace">TRAILING</fo:inline>
| <fo:inline font-family="monospace">BOTH</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
SQL Queries
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
SQL Queries
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="jpa_overview_sqlquery"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 11. 
SQL Queries
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e9163"><!--
SQL queries
--></fo:wrapper><fo:wrapper id="d0e9168"><!--
Query
,
SQL
--></fo:wrapper><fo:wrapper id="d0e9175"><!--
SQL
,
queries
--></fo:wrapper><fo:wrapper id="d0e9182"><!--
Native
,
queries
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPQL is a powerful query language, but there are times when it is not enough.
Maybe you're migrating a JDBC application to JPA on a strict deadline, and you
don't have time to translate your existing SQL selects to JPQL. Or maybe a
certain query requires database-specific SQL your JPA implementation doesn't
support. Or maybe your DBA has spent hours crafting the perfect select statement
for a query in your application's critical path. Whatever the reason, SQL
queries can remain an essential part of an application.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You are probably familiar with executing SQL queries by obtaining a <fo:inline font-family="monospace">
java.sql.Connection</fo:inline>, using the JDBC APIs to create a <fo:inline font-family="monospace">
Statement</fo:inline>, and executing that <fo:inline font-family="monospace">Statement</fo:inline> to
obtain a <fo:inline font-family="monospace">ResultSet</fo:inline>. And of course, you are free to
continue using this low-level approach to SQL execution in your JPA
applications. However, JPA also supports executing SQL queries through the
<fo:inline font-family="monospace">javax.persistence.Query</fo:inline> interface introduced in
<fo:basic-link internal-destination="jpa_overview_query"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 10, <fo:inline font-style="italic">
JPA Query
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_query"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_query"/>]</fo:inline></fo:basic-link>. Using a JPA SQL query, you can
retrieve either persistent objects or projections of column values. The
following sections detail each use.
</fo:block><fo:block id="jpa_overview_sqlquery_create"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Creating SQL Queries
</fo:marker><fo:block font-size="20.735999999999997pt">11.1. 
Creating SQL Queries
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e9213"><!--
SQL queries
,
creating
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">EntityManager</fo:inline> has two factory methods suitable for
creating SQL queries:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e9223">
public Query createNativeQuery(String sqlString, Class resultClass);
public Query createNativeQuery(String sqlString, String resultSetMapping);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The first method is used to create a new <fo:inline font-family="monospace">Query</fo:inline> instance
that will return instances of the specified class.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The second method uses a <fo:inline font-family="monospace">SqlResultSetMapping</fo:inline> to determine the
type of object or objects to return. The example below shows these methods in
action.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_sqlquery_createex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 11.1. 
Creating a SQL Query
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e9238">
EntityManager em = ...;
Query query = em.createNativeQuery("SELECT * FROM MAG", Magazine.class);
processMagazines(query.getResultList());
</fo:block></fo:block></fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e9240"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e9243"><!--
SQL queries
,
stored procedures
--></fo:wrapper>
<fo:wrapper id="d0e9249"><!--
stored procedures
,
as queries
--></fo:wrapper>
In addition to SELECT statements, OpenJPA supports stored procedure invocations
as SQL queries. OpenJPA will assume any SQL that does not begin with the
<fo:inline font-family="monospace">SELECT</fo:inline> keyword (ignoring case) is a stored procedure call,
and invoke it as such at the JDBC level.
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_sqlquery_obj"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Retrieving Persistent Objects with SQL
</fo:marker><fo:block font-size="20.735999999999997pt">11.2. 
Retrieving Persistent Objects with SQL
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e9263"><!--
SQL queries
,
retrieving persistent objects
--></fo:wrapper><fo:wrapper id="d0e9268"><!--
persistent objects
,
retrieving with SQL
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When you give a SQL <fo:inline font-family="monospace">Query</fo:inline> a candidate class, it will
return persistent instances of that class. At a minimum, your SQL must select
the class' primary key columns, discriminator column (if mapped), and version
column (also if mapped). The JPA runtime uses the values of the primary key
columns to construct each result object's identity, and possibly to match it
with a persistent object already in the <fo:inline font-family="monospace">EntityManager</fo:inline>'s
cache. When an object is not already cached, the implementation creates a new
object to represent the current result row. It might use the discriminator
column value to make sure it constructs an object of the correct subclass.
Finally, the query records available version column data for use in optimistic
concurrency checking, should you later change the result object and flush it
back to the database.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Aside from the primary key, discriminator, and version columns, any columns you
select are used to populate the persistent fields of each result object. JPA
implementations will compete on how effectively they map your selected data to
your persistent instance fields.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Let's make the discussion above concrete with an example. It uses the following
simple mapping between a class and the database:
</fo:block><fo:block id="d0e9287"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/sqlquery-model.png" width="213px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_sqlquery_objex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 11.2. 
Retrieving Persistent Objects
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e9294">
Query query = em.createNativeQuery("SELECT ISBN, TITLE, PRICE, "
+ "VERS FROM MAG WHERE PRICE &gt; 5 AND PRICE &lt; 10", Magazine.class);
List&lt;Magazine&gt; results = (List&lt;Magazine&gt;) query.getResultList();
for (Magazine mag : results)
processMagazine(mag);
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The query above works as advertised, but isn't very flexible. Let's update it to
take in parameters for the minimum and maximum price, so we can reuse it to find
magazines in any price range:
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_sqlquery_obj_paramex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 11.3. 
SQL Query Parameters
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e9301">
Query query = em.createNativeQuery("SELECT ISBN, TITLE, PRICE, "
+ "VERS FROM MAG WHERE PRICE &gt; ?1 AND PRICE &lt; ?2", Magazine.class);
query.setParameter(1, 5d);
query.setParameter(2, 10d);
List&lt;Magazine&gt; results = (List&lt;Magazine&gt;) query.getResultList();
for (Magazine mag : results)
processMagazine (mag);
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e9305"><!--
SQL queries
,
parameters
--></fo:wrapper>
<fo:wrapper id="d0e9311"><!--
parameters
,
in SQL queries
--></fo:wrapper>
Like JDBC prepared statements, SQL queries represent parameters with question
marks, but are followed by an integer to represent its index.
</fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Mapping Metadata
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Mapping Metadata
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="jpa_overview_mapping"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 12. 
Mapping Metadata
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e9323"><!--
mapping metadata
--></fo:wrapper><fo:wrapper id="d0e9326"><!--
entities
,
mapping to database
--></fo:wrapper><fo:wrapper id="d0e9333"><!--
metadata
,
mapping metadata
--></fo:wrapper><fo:wrapper id="d0e9340"><!--
ORM
--></fo:wrapper><fo:wrapper id="d0e9345"><!--
JPA
,
object-relational mapping
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">Object-relational mapping</fo:inline> is the process of mapping
entities to relational database tables. In JPA, you perform
object/relational mapping through <fo:inline font-style="italic">mapping metadata</fo:inline>.
Mapping metadata uses annotations to describe how to link your object model to
your relational model.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e9360"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA offers tools to automate mapping and schema creation. See
<fo:basic-link internal-destination="ref_guide_mapping"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 7, <fo:inline font-style="italic">
Mapping
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping"/>]</fo:inline></fo:basic-link> in the Reference Guide.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Throughout this chapter, we will draw on the object model introduced in
<fo:basic-link internal-destination="jpa_overview_meta"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 5, <fo:inline font-style="italic">
Metadata
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta"/>]</fo:inline></fo:basic-link>. We present that model again below.
As we discuss various aspects of mapping metadata, we will zoom in on specific
areas of the model and show how we map the object layer to the relational layer.
</fo:block><fo:block id="d0e9369"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/jpa-meta-model.png" width="369px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
All mapping metadata is optional. Where no explicit mapping metadata is given,
JPA uses the defaults defined by the specification. As we present
each mapping throughout this chapter, we also describe the defaults that apply
when the mapping is absent.
</fo:block><fo:block id="jpa_overview_mapping_table"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Table
</fo:marker><fo:block font-size="20.735999999999997pt">12.1. 
Table
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e9378"><!--
mapping metadata
,
class
,
table attribute
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">Table</fo:inline> annotation specifies the table for an entity
class. If you omit the <fo:inline font-family="monospace">Table</fo:inline> annotation, base entity
classes default to a table with their unqualified class name. The default table
of an entity subclass depends on the inheritance strategy, as you will see in
<fo:basic-link internal-destination="jpa_overview_mapping_inher"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.6, “
Inheritance
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_inher"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_inher"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-family="monospace">Table</fo:inline>s have the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e9400"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9401"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String name</fo:inline>: The name of the table. Defaults to the
unqualified entity class name.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9407"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String schema</fo:inline>: The table's schema. If you do not name a
schema, JPA uses the default schema for the database connection.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9413"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String catalog</fo:inline>: The table's catalog. If you do not name a
catalog, JPA uses the default catalog for the database connection.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9419"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">UniqueConstraint[] uniqueConstraints</fo:inline>: An array of unique
constraints to place on the table. We cover unique constraints below. Defaults
to an empty array.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">table</fo:inline>. It has the following
attributes, which correspond to the annotation properties above:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e9430"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9431"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9437"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">schema</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9443"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">catalog</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">table</fo:inline> element also accepts nested <fo:inline font-family="monospace">
unique-constraint</fo:inline> elements representing unique constraints. We will
detail unique constraints shortly.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Sometimes, some of the fields in a class are mapped to secondary tables. In that
case, use the class' <fo:inline font-family="monospace">Table</fo:inline> annotation to name what you
consider the class' primary table. Later, we will see how to map certain fields
to other tables.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The example below maps classes to tables according to the following diagram. The
<fo:inline font-family="monospace">CONTRACT</fo:inline>, <fo:inline font-family="monospace">SUB</fo:inline>, and <fo:inline font-family="monospace">LINE_ITEM
</fo:inline> tables are in the <fo:inline font-family="monospace">CNTRCT</fo:inline> schema; all other tables
are in the default schema.
</fo:block><fo:block id="d0e9476"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/mapping-tables.png" width="341px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Note that the diagram does not include our model's <fo:inline font-family="monospace">Document
</fo:inline> and <fo:inline font-family="monospace">Address</fo:inline> classes. Mapped superclasses and
embeddable classes are never mapped to tables.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_mapping_classex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.1. 
Mapping Classes
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e9491">
package org.mag;
@Entity
@IdClass(Magazine.MagazineId.class)
@Table(name="MAG")
public class Magazine {
...
public static class MagazineId {
...
}
}
@Entity
@Table(name="ART")
public class Article {
...
}
package org.mag.pub;
@Entity
@Table(name="COMP")
public class Company {
...
}
@Entity
@Table(name="AUTH")
public class Author {
...
}
@Embeddable
public class Address {
...
}
package org.mag.subscribe;
@MappedSuperclass
public abstract class Document {
...
}
@Entity
@Table(schema="CNTRCT")
public class Contract
extends Document {
...
}
@Entity
@Table(name="SUB", schema="CNTRCT")
public class Subscription {
...
@Entity
@Table(name="LINE_ITEM", schema="CNTRCT")
public static class LineItem
extends Contract {
...
}
}
@Entity(name="Lifetime")
public class LifetimeSubscription
extends Subscription {
...
}
@Entity(name="Trial")
public class TrialSubscription
extends Subscription {
...
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The same mapping information expressed in XML:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e9495">
&lt;entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
version="1.0"&gt;
&lt;mapped-superclass class="org.mag.subscribe.Document"&gt;
...
&lt;/mapped-superclass&gt;
&lt;entity class="org.mag.Magazine"&gt;
&lt;table name="MAG"/&gt;
&lt;id-class="org.mag.Magazine.MagazineId"/&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.Article"&gt;
&lt;table name="ART"/&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.pub.Company"&gt;
&lt;table name="COMP"/&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.pub.Author"&gt;
&lt;table name="AUTH"/&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.subcribe.Contract"&gt;
&lt;table schema="CNTRCT"/&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.subcribe.Subscription"&gt;
&lt;table name="SUB" schema="CNTRCT"/&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.Subscription.LineItem"&gt;
&lt;table name="LINE_ITEM" schema="CNTRCT"/&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.LifetimeSubscription" name="Lifetime"&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.TrialSubscription" name="Trial"&gt;
...
&lt;/entity&gt;
&lt;embeddable class="org.mag.pub.Address"&gt;
...
&lt;/embeddable&gt;
&lt;/entity-mappings&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_mapping_unq"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Unique Constraints
</fo:marker><fo:block font-size="20.735999999999997pt">12.2. 
Unique Constraints
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e9500"><!--
mapping metadata
,
unique constraints
--></fo:wrapper><fo:wrapper id="d0e9507"><!--
unique constraints
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Unique constraints ensure that the data in a column or combination of columns is
unique for each row. A table's primary key, for example, functions as an
implicit unique constraint. In JPA, you represent other unique
constraints with an array of <fo:inline font-family="monospace"> UniqueConstraint</fo:inline>
annotations within the table annotation. The unique constraints you define are
used during table creation to generate the proper database constraints, and may
also be used at runtime to order <fo:inline font-family="monospace">INSERT</fo:inline>, <fo:inline font-family="monospace">UPDATE
</fo:inline>, and <fo:inline font-family="monospace">DELETE</fo:inline> statements. For example, suppose there
is a unique constraint on the columns of field <fo:inline font-family="monospace">F</fo:inline>. In the
same transaction, you remove an object <fo:inline font-family="monospace">A</fo:inline> and persist a new
object <fo:inline font-family="monospace">B</fo:inline>, both with the same <fo:inline font-family="monospace">F</fo:inline> value. The
JPA runtime must ensure that the SQL deleting <fo:inline font-family="monospace">A</fo:inline>
is sent to the database before the SQL inserting <fo:inline font-family="monospace">B</fo:inline> to avoid a
unique constraint violation.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-family="monospace">UniqueConstraint</fo:inline> has a single property:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e9547"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9548"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String[] columnNames</fo:inline>: The names of the columns the
constraint spans.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In XML, unique constraints are represented by nesting <fo:inline font-family="monospace">
unique-constraint</fo:inline> elements within the <fo:inline font-family="monospace"> table</fo:inline>
element. Each <fo:inline font-family="monospace">unique-constraint</fo:inline> element in turn nests
<fo:inline font-family="monospace">column-name</fo:inline> text elements to enumerate the contraint's
columns.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_mapping_unq_attrex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.2. 
Defining a Unique Constraint
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following defines a unique constraint on the <fo:inline font-family="monospace"> TITLE</fo:inline>
column of the <fo:inline font-family="monospace">ART</fo:inline> table:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e9579">
@Entity
@Table(name="ART", uniqueConstraints=@Unique(columnNames="TITLE"))
public class Article {
...
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The same metadata expressed in XML form:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e9583">
&lt;entity class="org.mag.Article"&gt;
&lt;table name="ART"&gt;
&lt;unique-constraint&gt;
&lt;column-name&gt;TITLE&lt;/column-name&gt;
&lt;/unique-constraint&gt;
&lt;/table&gt;
...
&lt;/entity&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_mapping_column"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Column
</fo:marker><fo:block font-size="20.735999999999997pt">12.3. 
Column
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e9588"><!--
mapping metadata
,
Column
--></fo:wrapper><fo:wrapper id="d0e9593"><!--
Column
,
in mapping metadata
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In the previous section, we saw that a <fo:inline font-family="monospace">UniqueConstraint</fo:inline>
uses an array of column names. Field mappings, however, use full-fledged
<fo:inline font-family="monospace">Column</fo:inline> annotations. Column annotations have the following
properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e9608"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9609"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e9612"><!--
mapping metadata
,
Column
,
name property
--></fo:wrapper>
<fo:inline font-family="monospace">String name</fo:inline>: The column name. Defaults to the field name.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9623"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e9626"><!--
mapping metadata
,
Column
,
columnDefinition property
--></fo:wrapper>
<fo:inline font-family="monospace">String columnDefinition</fo:inline>: The database-specific column type
name. This property is only used by vendors that support creating tables from
your mapping metadata. During table creation, the vendor will use the value of
the <fo:inline font-family="monospace">columnDefinition</fo:inline> as the declared column type. If no
<fo:inline font-family="monospace">columnDefinition</fo:inline> is given, the vendor will choose an
appropriate default based on the field type combined with the column's length,
precision, and scale.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9643"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e9646"><!--
mapping metadata
,
Column
,
length property
--></fo:wrapper>
<fo:inline font-family="monospace">int length</fo:inline>: The column length. This property is typically
only used during table creation, though some vendors might use it to validate
data before flushing. <fo:inline font-family="monospace">CHAR</fo:inline> and <fo:inline font-family="monospace">VARCHAR</fo:inline>
columns typically default to a length of 255; other column types use the
database default.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9663"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e9666"><!--
mapping metadata
,
Column
,
precision property
--></fo:wrapper>
<fo:inline font-family="monospace">int precision</fo:inline>: The precision of a numeric column. This
property is often used in conjunction with <fo:inline font-family="monospace">scale</fo:inline> to form the
proper column type name during table creation.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9680"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e9683"><!--
mapping metadata
,
Column
,
scale property
--></fo:wrapper>
<fo:inline font-family="monospace">int scale</fo:inline>: The number of decimal digits a numeric column can
hold. This property is often used in conjunction with <fo:inline font-family="monospace">precision
</fo:inline> to form the proper column type name during table creation.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9697"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e9700"><!--
mapping metadata
,
Column
,
nullable property
--></fo:wrapper>
<fo:inline font-family="monospace">boolean nullable</fo:inline>: Whether the column can store null values.
Vendors may use this property both for table creation and at runtime; however,
it is never required. Defaults to <fo:inline font-family="monospace">true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9714"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e9717"><!--
mapping metadata
,
Column
,
insertable property
--></fo:wrapper>
<fo:inline font-family="monospace">boolean insertable</fo:inline>: By setting this property to <fo:inline font-family="monospace">
false</fo:inline>, you can omit the column from SQL <fo:inline font-family="monospace">INSERT</fo:inline>
statements. Defaults to <fo:inline font-family="monospace">true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9737"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e9740"><!--
mapping metadata
,
Column
,
updatable property
--></fo:wrapper>
<fo:inline font-family="monospace">boolean updatable</fo:inline>: By setting this property to <fo:inline font-family="monospace">
false</fo:inline>, you can omit the column from SQL <fo:inline font-family="monospace">UPDATE</fo:inline>
statements. Defaults to <fo:inline font-family="monospace">true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9760"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e9763"><!--
mapping metadata
,
Column
,
table property
--></fo:wrapper>
<fo:inline font-family="monospace">String table</fo:inline>: Sometimes you will need to map fields to
tables other than the primary table. This property allows you specify that the
column resides in a secondary table. We will see how to map fields to secondary
tables later in the chapter.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">column</fo:inline>. This element has
attributes that are exactly equivalent to the <fo:inline font-family="monospace"> Column</fo:inline>
annotation's properties described above:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e9782"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9783"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9789"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">column-definition</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9795"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">length</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9801"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">precision</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9807"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">scale</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9813"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">insertable</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9819"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">updatable</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9825"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">table</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="jpa_overview_mapping_id"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Identity Mapping
</fo:marker><fo:block font-size="20.735999999999997pt">12.4. 
Identity Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e9834"><!--
Id
--></fo:wrapper><fo:wrapper id="d0e9837"><!--
mapping metadata
,
identity
--></fo:wrapper><fo:wrapper id="d0e9842"><!--
identity
,
mapping
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
With our new knowledge of columns, we can map the identity fields of our
entities. The diagram below now includes primary key columns for our model's
tables. The primary key column for <fo:inline font-family="monospace">Author</fo:inline> uses
nonstandard type <fo:inline font-family="monospace"> INTEGER64</fo:inline>, and the <fo:inline font-family="monospace">Magazine.isbn
</fo:inline> field is mapped to a <fo:inline font-family="monospace">VARCHAR(9)</fo:inline> column instead of
a <fo:inline font-family="monospace">VARCHAR(255)</fo:inline> column, which is the default for string
fields. We do not need to point out either one of these oddities to the JPA
implementation for runtime use. If, however, we want to use the JPA
implementation to create our tables for us, it needs to know about
any desired non-default column types. Therefore, the example following the
diagram includes this data in its encoding of our mappings.
</fo:block><fo:block id="d0e9864"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/jpa-mapping-identity.png" width="341px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Note that many of our identity fields do not need to specify column information,
because they use the default column name and type.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_mapping_identityex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.3. 
Identity Mapping
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e9873">
package org.mag;
@Entity
@IdClass(Magazine.MagazineId.class)
@Table(name="MAG")
public class Magazine {
@Column(length=9)
@Id private String isbn;
@Id private String title;
...
public static class MagazineId {
...
}
}
@Entity
@Table(name="ART", uniqueConstraints=@Unique(columnNames="TITLE"))
public class Article {
@Id private long id;
...
}
package org.mag.pub;
@Entity
@Table(name="COMP")
public class Company {
@Column(name="CID")
@Id private long id;
...
}
@Entity
@Table(name="AUTH")
public class Author {
@Column(name="AID", columnDefinition="INTEGER64")
@Id private long id;
...
}
@Embeddable
public class Address {
...
}
package org.mag.subscribe;
@MappedSuperclass
public abstract class Document {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private long id;
...
}
@Entity
@Table(schema="CNTRCT")
public class Contract
extends Document {
...
}
@Entity
@Table(name="SUB", schema="CNTRCT")
public class Subscription {
@Id private long id;
...
@Entity
@Table(name="LINE_ITEM", schema="CNTRCT")
public static class LineItem
extends Contract {
...
}
}
@Entity(name="Lifetime")
public class LifetimeSubscription
extends Subscription {
...
}
@Entity(name="Trial")
public class TrialSubscription
extends Subscription {
...
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The same metadata for <fo:inline font-family="monospace">Magazine</fo:inline> and <fo:inline font-family="monospace">Company</fo:inline>
expressed in XML form:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e9883">
&lt;entity class="org.mag.Magazine"&gt;
&lt;id-class class="org.mag.Magazine.Magazine.MagazineId"/&gt;
&lt;table name="MAG"/&gt;
&lt;attributes&gt;
&lt;id name="isbn"&gt;
&lt;column length="9"/&gt;
&lt;/id&gt;
&lt;id name="title"/&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.pub.Company"&gt;
&lt;table name="COMP"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;column name="CID"/&gt;
&lt;/id&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_mapping_sequence"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Generators
</fo:marker><fo:block font-size="20.735999999999997pt">12.5. 
Generators
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e9888"><!--
generators
,
mapping metadata
--></fo:wrapper><fo:wrapper id="d0e9893"><!--
mapping metadata
,
generators
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
One aspect of identity mapping not covered in the previous section is JPA's
ability to automatically assign a value to your numeric identity fields using
<fo:inline font-style="italic">generators</fo:inline>. We discussed the available generator types in
<fo:basic-link internal-destination="jpa_overview_meta_id"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.2, “
Id
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_id"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_id"/>]</fo:inline></fo:basic-link>. Now we show you how to define
named generators.
</fo:block><fo:block id="jpa_overview_mapping_sequence_seqgen"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Sequence Generator
</fo:marker><fo:block font-size="17.28pt">12.5.1. 
Sequence Generator
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e9912"><!--
generators
,
SequenceGenerator
--></fo:wrapper><fo:wrapper id="d0e9917"><!--
SequenceGenerator
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Most databases allow you to create native sequences. These are database
structures that generate increasing numeric values. The <fo:inline font-family="monospace">
SequenceGenerator</fo:inline> annotation represents a named database sequence.
You can place the annotation on any package, entity class, persistent field
declaration (if your entity uses field access), or getter method for a
persistent property (if your entity uses property access). <fo:inline font-family="monospace">
SequenceGenerator</fo:inline> has the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e9928"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9929"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e9932"><!--
SequenceGenerator
,
name property
--></fo:wrapper>
<fo:inline font-family="monospace">String name</fo:inline>: The generator name. This property is required.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9941"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e9944"><!--
SequenceGenerator
,
sequenceName property
--></fo:wrapper>
<fo:inline font-family="monospace">String sequenceName</fo:inline>: The name of the database sequence. If
you do not specify the database sequence, your vendor will choose an appropriate
default.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9953"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e9956"><!--
SequenceGenerator
,
initialValue property
--></fo:wrapper>
<fo:inline font-family="monospace">int initialValue</fo:inline>: The initial sequence value.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e9965"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e9968"><!--
SequenceGenerator
,
allocationSize property
--></fo:wrapper>
<fo:inline font-family="monospace">int allocationSize</fo:inline>: Some databases can pre-allocate groups
of sequence values. This allows the database to service sequence requests from
cache, rather than physically incrementing the sequence with every request. This
allocation size defaults to 50.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e9977"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA allows you to use describe one of OpenJPA's built-in generator
implementations in the <fo:inline font-family="monospace">sequenceName</fo:inline> property. You can also
set the <fo:inline font-family="monospace">sequenceName</fo:inline> to <fo:inline font-family="monospace">system</fo:inline> to use the
system sequence defined by the <fo:basic-link internal-destination="openjpa.Sequence"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.Sequence</fo:inline></fo:inline></fo:basic-link> configuration property. See the Reference
Guide's <fo:basic-link internal-destination="ref_guide_sequence"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 9.6, “
Generators
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_sequence"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_sequence"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The XML element for a sequence generator is <fo:inline font-family="monospace">sequence-generator
</fo:inline>. Its attributes mirror the above annotation's properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e10000"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10001"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10007"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">sequence-name</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10013"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">initial-value</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10019"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">allocation-size</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To use a sequence generator, set your <fo:inline font-family="monospace">GeneratedValue</fo:inline>
annotation's <fo:inline font-family="monospace">strategy</fo:inline> property to <fo:inline font-family="monospace">
GenerationType.SEQUENCE</fo:inline>, and its <fo:inline font-family="monospace">generator</fo:inline> property
to the sequence generator's declared name. Or equivalently, set your <fo:inline font-family="monospace">
generated-value</fo:inline> XML element's <fo:inline font-family="monospace">strategy</fo:inline> attribute to
<fo:inline font-family="monospace">SEQUENCE</fo:inline> and its <fo:inline font-family="monospace">generator</fo:inline> attribute to
the generator name.
</fo:block></fo:block><fo:block id="jpa_overview_mapping_sequence_tablegen"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
TableGenerator
</fo:marker><fo:block font-size="17.28pt">12.5.2. 
TableGenerator
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e10054"><!--
generators
,
TableGenerator
--></fo:wrapper><fo:wrapper id="d0e10059"><!--
TableGenerator
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A <fo:inline font-family="monospace">TableGenerator</fo:inline> refers to a database table used to store
increasing sequence values for one or more entities. As with <fo:inline font-family="monospace">
SequenceGenerator</fo:inline>, you can place the <fo:inline font-family="monospace">TableGenerator
</fo:inline> annotation on any package, entity class, persistent field
declaration (if your entity uses field access), or getter method for a
persistent property (if your entity uses property access). <fo:inline font-family="monospace">
TableGenerator</fo:inline> has the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e10076"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10077"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e10080"><!--
TableGenerator
,
name property
--></fo:wrapper>
<fo:inline font-family="monospace">String name</fo:inline>: The generator name. This property is required.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10089"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e10092"><!--
TableGenerator
,
table property
--></fo:wrapper>
<fo:inline font-family="monospace">String table</fo:inline>: The name of the generator table. If left
unspecified, your vendor will choose a default table.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10101"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e10104"><!--
TableGenerator
,
schema property
--></fo:wrapper>
<fo:inline font-family="monospace">String schema</fo:inline>: The named table's schema.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10113"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e10116"><!--
TableGenerator
,
catalog property
--></fo:wrapper>
<fo:inline font-family="monospace">String catalog</fo:inline>: The named table's catalog.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10125"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e10128"><!--
TableGenerator
,
pkColumnName property
--></fo:wrapper>
<fo:inline font-family="monospace">String pkColumnName</fo:inline>: The name of the primary key column in
the generator table. If unspecified, your implementation will choose a default.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10137"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e10140"><!--
TableGenerator
,
valueColumnName property
--></fo:wrapper>
<fo:inline font-family="monospace">String valueColumnName</fo:inline>: The name of the column that holds
the sequence value. If unspecified, your implementation will choose a default.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10149"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e10152"><!--
TableGenerator
,
pkColumnValue property
--></fo:wrapper>
<fo:inline font-family="monospace">String pkColumnValue</fo:inline>: The primary key column value of the
row in the generator table holding this sequence value. You can use the same
generator table for multiple logical sequences by supplying different <fo:inline font-family="monospace">
pkColumnValue</fo:inline> s. If you do not specify a value, the implementation
will supply a default.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10164"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e10167"><!--
TableGenerator
,
initialValue property
--></fo:wrapper>
<fo:inline font-family="monospace">int initialValue</fo:inline>: The value of the generator's first issued
number.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10176"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e10179"><!--
TableGenerator
,
allocationSize property
--></fo:wrapper>
<fo:inline font-family="monospace">int allocationSize</fo:inline>: The number of values to allocate in
memory for each trip to the database. Allocating values in memory allows the JPA
runtime to avoid accessing the database for every sequence request.
This number also specifies the amount that the sequence value is incremented
each time the generator table is updated. Defaults to 50.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The XML equivalent is the <fo:inline font-family="monospace">table-generator</fo:inline> element. This
element's attributes correspond exactly to the above annotation's properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e10193"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10194"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10200"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">table</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10206"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">schema</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10212"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">catalog</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10218"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">pk-column-name</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10224"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">value-column-name</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10230"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">pk-column-value</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10236"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">initial-value</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10242"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">allocation-size</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To use a table generator, set your <fo:inline font-family="monospace">GeneratedValue</fo:inline>
annotation's <fo:inline font-family="monospace">strategy</fo:inline> property to <fo:inline font-family="monospace">
GenerationType.TABLE</fo:inline>, and its <fo:inline font-family="monospace">generator</fo:inline> property to
the table generator's declared name. Or equivalently, set your <fo:inline font-family="monospace">
generated-value</fo:inline> XML element's <fo:inline font-family="monospace">strategy</fo:inline> attribute to
<fo:inline font-family="monospace">TABLE</fo:inline> and its <fo:inline font-family="monospace">generator</fo:inline> attribute to the
generator name.
</fo:block></fo:block><fo:block id="jpa_overview_mapping_sequence_genex"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Example
</fo:marker><fo:block font-size="17.28pt">12.5.3. 
Example
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Let's take advantage of generators in our entity model. Here are our updated
mappings.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_mapping_sequenceex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.4. 
Generator Mapping
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e10282">
package org.mag;
@Entity
@IdClass(Magazine.MagazineId.class)
@Table(name="MAG")
public class Magazine {
@Column(length=9)
@Id private String isbn;
@Id private String title;
...
public static class MagazineId {
...
}
}
@Entity
@Table(name="ART", uniqueConstraints=@Unique(columnNames="TITLE"))
@SequenceGenerator(name="ArticleSeq", sequenceName="ART_SEQ")
public class Article {
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ArticleSeq")
private long id;
...
}
package org.mag.pub;
@Entity
@Table(name="COMP")
public class Company {
@Column(name="CID")
@Id private long id;
...
}
@Entity
@Table(name="AUTH")
public class Author {
@Id
@GeneratedValue(strategy=GenerationType.TABLE, generator="AuthorGen")
@TableGenerator(name="AuthorGen", table="AUTH_GEN", pkColumnName="PK",
valueColumnName="AID")
@Column(name="AID", columnDefinition="INTEGER64")
private long id;
...
}
@Embeddable
public class Address {
...
}
package org.mag.subscribe;
@MappedSuperclass
public abstract class Document {
@Id
@GeneratedValue(generate=GenerationType.IDENTITY)
private long id;
...
}
@Entity
@Table(schema="CNTRCT")
public class Contract
extends Document {
...
}
@Entity
@Table(name="SUB", schema="CNTRCT")
public class Subscription {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private long id;
...
@Entity
@Table(name="LINE_ITEM", schema="CNTRCT")
public static class LineItem
extends Contract {
...
}
}
@Entity(name="Lifetime")
public class LifetimeSubscription
extends Subscription {
...
}
@Entity(name="Trial")
public class TrialSubscription
extends Subscription {
...
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The same metadata for <fo:inline font-family="monospace">Article</fo:inline> and <fo:inline font-family="monospace">Author</fo:inline>
expressed in XML form:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e10292">
&lt;entity class="org.mag.Article"&gt;
&lt;table name="ART"&gt;
&lt;unique-constraint&gt;
&lt;column-name&gt;TITLE&lt;/column-name&gt;
&lt;/unique-constraint&gt;
&lt;/table&gt;
&lt;sequence-generator name="ArticleSeq" sequence-name="ART_SEQ"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;generated-value strategy="SEQUENCE" generator="ArticleSeq"/&gt;
&lt;/id&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.pub.Author"&gt;
&lt;table name="AUTH"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;column name="AID" column-definition="INTEGER64"/&gt;
&lt;generated-value strategy="TABLE" generator="AuthorGen"/&gt;
&lt;table-generator name="AuthorGen" table="AUTH_GEN"
pk-column-name="PK" value-column-name="AID"/&gt;
&lt;/id&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_mapping_inher"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Inheritance
</fo:marker><fo:block font-size="20.735999999999997pt">12.6. 
Inheritance
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e10297"><!--
mapping metadata
,
inheritance
--></fo:wrapper><fo:wrapper id="d0e10304"><!--
inheritance
,
mapping
--></fo:wrapper><fo:wrapper id="d0e10309"><!--
entities
,
inheritance
--></fo:wrapper><fo:wrapper id="d0e10316"><!--
impedance mismatch
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In the 1990's programmers coined the term <fo:inline font-style="italic">impedance mismatch
</fo:inline> to describe the difficulties in bridging the object and relational
worlds. Perhaps no feature of object modeling highlights the impedance mismatch
better than inheritance. There is no natural, efficient way to represent an
inheritance relationship in a relational database.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e10326"><!--
mapping metadata
,
inheritance
,
strategy attribute
--></fo:wrapper>
Luckily, JPA gives you a choice of inheritance strategies, making
the best of a bad situation. The base entity class defines the inheritance
strategy for the hierarchy with the <fo:inline font-family="monospace">Inheritance</fo:inline>
annotation. <fo:inline font-family="monospace">Inheritance</fo:inline> has the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e10340"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10341"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">InheritanceType strategy</fo:inline>: Enum value declaring the
inheritance strategy for the hierarchy. Defaults to <fo:inline font-family="monospace">
InheritanceType.SINGLE_TABLE</fo:inline>. We detail each of the available
strategies below.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The corresponding XML element is <fo:inline font-family="monospace">inheritance</fo:inline>, which has a
single attribute:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e10355"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10356"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">strategy</fo:inline>: One of <fo:inline font-family="monospace">SINGLE_TABLE</fo:inline>, <fo:inline font-family="monospace">
JOINED</fo:inline>, or <fo:inline font-family="monospace">TABLE_PER_CLASS</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following sections describe JPA's standard inheritance strategies.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e10373"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA allows you to vary your inheritance strategy for each class, rather than
forcing a single strategy per inheritance hierarchy. See
<fo:basic-link internal-destination="ref_guide_mapping_jpa"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.7, “
Additional JPA Mappings
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_jpa"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_jpa"/>]</fo:inline></fo:basic-link> in the Reference Guide for
details.
</fo:block></fo:block></fo:block><fo:block id="jpa_overview_mapping_inher_single"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Single Table
</fo:marker><fo:block font-size="17.28pt">12.6.1. 
Single Table
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e10381"><!--
mapping metadata
,
inheritance
,
SINGLE_TABLE strategy
--></fo:wrapper><fo:wrapper id="d0e10388"><!--
inheritance
,
SINGLE_TABLE strategy
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">InheritanceType.SINGLE_TABLE</fo:inline> strategy maps all classes in
the hierarchy to the base class' table.
</fo:block><fo:block id="d0e10398"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/inher-superclass-table.png" width="177px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In our model, <fo:inline font-family="monospace">Subscription</fo:inline> is mapped to the <fo:inline font-family="monospace">
CNTRCT.SUB</fo:inline> table. <fo:inline font-family="monospace"> LifetimeSubscription</fo:inline>, which
extends <fo:inline font-family="monospace"> Subscription</fo:inline>, adds its field data to this table
as well.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_mapping_inher_singleex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.5. 
Single Table Mapping
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e10419">
@Entity
@Table(name="SUB", schema="CNTRCT")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
public class Subscription {
...
}
@Entity(name="Lifetime")
public class LifetimeSubscription
extends Subscription {
...
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The same metadata expressed in XML form:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e10423">
&lt;entity class="org.mag.subcribe.Subscription"&gt;
&lt;table name="SUB" schema="CNTRCT"/&gt;
&lt;inheritance strategy="SINGLE_TABLE"/&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.LifetimeSubscription"&gt;
...
&lt;/entity&gt;
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Single table inheritance is the default strategy. Thus, we could omit the
<fo:inline font-family="monospace">@Inheritance</fo:inline> annotation in the example above and get the same
result.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e10430"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e10433"><!--
inheritance
,
flat
--></fo:wrapper>
<fo:wrapper id="d0e10439"><!--
flat
--></fo:wrapper>
Mapping subclass state to the superclass table is often called <fo:inline font-style="italic">flat
</fo:inline> inheritance mapping.
</fo:block></fo:block></fo:block><fo:block id="jpa_overview_mapping_inher_single_adv"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">12.6.1.1. 
Advantages
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e10451"><!--
inheritance
,
SINGLE_TABLE strategy
,
advantages
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Single table inheritance mapping is the fastest of all inheritance models, since
it never requires a join to retrieve a persistent instance from the database.
Similarly, persisting or updating a persistent instance requires only a single
<fo:inline font-family="monospace">INSERT</fo:inline> or <fo:inline font-family="monospace">UPDATE</fo:inline> statement. Finally,
relations to any class within a single table inheritance hierarchy are just as
efficient as relations to a base class.
</fo:block></fo:block><fo:block id="jpa_overview_mapping_inher_single_disadv"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">12.6.1.2. 
Disadvantages
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e10469"><!--
inheritance
,
SINGLE_TABLE strategy
,
disadvantages
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The larger the inheritance model gets, the "wider" the mapped table gets, in
that for every field in the entire inheritance hierarchy, a column must exist in
the mapped table. This may have undesirable consequence on the database size,
since a wide or deep inheritance hierarchy will result in tables with many
mostly-empty columns.
</fo:block></fo:block></fo:block><fo:block id="jpa_overview_mapping_inher_joined"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Joined
</fo:marker><fo:block font-size="17.28pt">12.6.2. 
Joined
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e10481"><!--
mapping metadata
,
inheritance
,
JOINED strategy
--></fo:wrapper><fo:wrapper id="d0e10488"><!--
inheritance
,
JOINED strategy
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">InheritanceType.JOINED</fo:inline> strategy uses a different table
for each class in the hierarchy. Each table only includes state declared in its
class. Thus to load a subclass instance, the JPA implementation must
read from the subclass table as well as the table of each ancestor class, up to
the base entity class.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e10498"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e10501"><!--
inheritance
,
vertical
--></fo:wrapper>
<fo:wrapper id="d0e10507"><!--
vertical
--></fo:wrapper>
Using joined subclass tables is also called <fo:inline font-style="italic">vertical</fo:inline>
inheritance mapping.
</fo:block></fo:block></fo:block><fo:block id="d0e10516"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/jpa-inher-joined.png" width="171px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-family="monospace">PrimaryKeyJoinColumn</fo:inline> annotations tell the JPA
implementation how to join each subclass table record to the corresponding
record in its direct superclass table. In our model, the <fo:inline font-family="monospace">LINE_ITEM.ID
</fo:inline> column joins to the <fo:inline font-family="monospace">CONTRACT.ID</fo:inline> column. The
<fo:inline font-family="monospace">PrimaryKeyJoinColumn</fo:inline> annotation has the following
properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e10534"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10535"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String name</fo:inline>: The name of the subclass table column. When
there is a single identity field, defaults to that field's column name.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10541"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String referencedColumnName</fo:inline>: The name of the superclass
table column this subclass table column joins to. When there is a single
identity field, defaults to that field's column name.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10547"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String columnDefinition</fo:inline>: This property has the same meaning
as the <fo:inline font-family="monospace">columnDefinition</fo:inline> property on the <fo:inline font-family="monospace">Column
</fo:inline> annotation, described in
<fo:basic-link internal-destination="jpa_overview_mapping_column"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.3, “
Column
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_column"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_column"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The XML equivalent is the <fo:inline font-family="monospace">primary-key-join-column</fo:inline> element.
Its attributes mirror the annotation properties described above:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e10566"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10567"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10573"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">referenced-column-name</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10579"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">column-definition</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The example below shows how we use <fo:inline font-family="monospace">InheritanceTable.JOINED</fo:inline>
and a primary key join column to map our sample model according to the diagram
above. Note that a primary key join column is not strictly needed, because there
is only one identity column, and the subclass table column has the same name as
the superclass table column. In this situation, the defaults suffice. However,
we include the primary key join column for illustrative purposes.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_mapping_inher_joinedex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.6. 
Joined Subclass Tables
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e10593">
@Entity
@Table(schema="CNTRCT")
@Inheritance(strategy=InheritanceType.JOINED)
public class Contract
extends Document {
...
}
public class Subscription {
...
@Entity
@Table(name="LINE_ITEM", schema="CNTRCT")
@PrimaryKeyJoinColumn(name="ID", referencedColumnName="ID")
public static class LineItem
extends Contract {
...
}
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The same metadata expressed in XML form:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e10597">
&lt;entity class="org.mag.subcribe.Contract"&gt;
&lt;table schema="CNTRCT"/&gt;
&lt;inheritance strategy="JOINED"/&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.Subscription.LineItem"&gt;
&lt;table name="LINE_ITEM" schema="CNTRCT"/&gt;
&lt;primary-key-join-column name="ID" referenced-column-name="PK"/&gt;
...
&lt;/entity&gt;
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When there are multiple identity columns, you must define multiple <fo:inline font-family="monospace">
PrimaryKeyJoinColumn</fo:inline>s using the aptly-named <fo:inline font-family="monospace">
PrimaryKeyJoinColumns</fo:inline> annotation. This annotation's value is an
array of <fo:inline font-family="monospace"> PrimaryKeyJoinColumn</fo:inline> s. We could rewrite
<fo:inline font-family="monospace">LineItem</fo:inline>'s mapping as:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e10613">
@Entity
@Table(name="LINE_ITEM", schema="CNTRCT")
@PrimaryKeyJoinColumns({
@PrimaryKeyJoinColumn(name="ID", referencedColumnName="ID")
})
public static class LineItem
extends Contract {
...
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In XML, simply list as many <fo:inline font-family="monospace"> primary-key-join-column</fo:inline> elements
as necessary.
</fo:block><fo:block id="jpa_overview_mapping_inher_joined_adv"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">12.6.2.1. 
Advantages
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e10623"><!--
inheritance
,
JOINED strategy
,
advantages
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The joined strategy has the following advantages:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.2em" id="d0e10632"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10633"><fo:list-item-label end-indent="label-end()"><fo:block>1.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e10636"><!--
normalized
--></fo:wrapper>
Using joined subclass tables results in the most <fo:inline font-style="italic">normalized</fo:inline>
database schema, meaning the schema with the least spurious or redundant data.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10643"><fo:list-item-label end-indent="label-end()"><fo:block>2.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
As more subclasses are added to the data model over time, the only schema
modification that needs to be made is the addition of corresponding subclass
tables in the database (rather than having to change the structure of existing
tables).
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10646"><fo:list-item-label end-indent="label-end()"><fo:block>3.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Relations to a base class using this strategy can be loaded through standard
joins and can use standard foreign keys, as opposed to the machinations required
to load polymorphic relations to table-per-class base types, described below.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="jpa_overview_mapping_inher_joined_disadv"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">12.6.2.2. 
Disadvantages
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e10652"><!--
inheritance
,
JOINED strategy
,
disadvantages
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Aside from certain uses of the table-per-class strategy described below, the
joined strategy is often the slowest of the inheritance models. Retrieving any
subclass requires one or more database joins, and storing subclasses requires
multiple <fo:inline font-family="monospace">INSERT</fo:inline> or <fo:inline font-family="monospace">UPDATE</fo:inline> statements. This
is only the case when persistence operations are performed on subclasses; if
most operations are performed on the least-derived persistent superclass, then
this mapping is very fast.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e10667"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When executing a select against a hierarchy that uses joined subclass table
inheritance, you must consider how to load subclass state.
<fo:basic-link internal-destination="ref_guide_perfpack_eager"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.7, “
Eager Fetching
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_perfpack_eager"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_perfpack_eager"/>]</fo:inline></fo:basic-link> in the Reference Guide
describes OpenJPA's options for efficient data loading.
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_mapping_inher_tpc"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Table Per Class
</fo:marker><fo:block font-size="17.28pt">12.6.3. 
Table Per Class
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e10675"><!--
mapping metadata
,
inheritance
,
TABLE_PER_CLASS strategy
--></fo:wrapper><fo:wrapper id="d0e10682"><!--
inheritance
,
TABLE_PER_CLASS strategy
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Like the <fo:inline font-family="monospace">JOINED</fo:inline> strategy, the <fo:inline font-family="monospace">
InheritanceType.TABLE_PER_CLASS</fo:inline> strategy uses a different table for
each class in the hierarchy. Unlike the <fo:inline font-family="monospace">JOINED</fo:inline> strategy,
however, each table includes all state for an instance of the corresponding
class. Thus to load a subclass instance, the JPA implementation must
only read from the subclass table; it does not need to join to superclass
tables.
</fo:block><fo:block id="d0e10698"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/inher-tpc.png" width="189px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Suppose that our sample model's <fo:inline font-family="monospace">Magazine</fo:inline> class has a
subclass <fo:inline font-family="monospace">Tabloid</fo:inline>. The classes are mapped using the
table-per-class strategy, as in the diagram above. In a table-per-class mapping,
<fo:inline font-family="monospace"> Magazine</fo:inline>'s table <fo:inline font-family="monospace">MAG</fo:inline> contains all
state declared in the base <fo:inline font-family="monospace">Magazine</fo:inline> class. <fo:inline font-family="monospace">
Tabloid</fo:inline> maps to a separate table, <fo:inline font-family="monospace"> TABLOID</fo:inline>. This
table contains not only the state declared in the <fo:inline font-family="monospace">Tabloid</fo:inline>
subclass, but all the base class state from <fo:inline font-family="monospace">Magazine</fo:inline> as
well. Thus the <fo:inline font-family="monospace">TABLOID</fo:inline> table would contain columns for
<fo:inline font-family="monospace">isbn</fo:inline>, <fo:inline font-family="monospace">title</fo:inline>, and other <fo:inline font-family="monospace">
Magazine</fo:inline> fields. These columns would default to the names used in
<fo:inline font-family="monospace">Magazine</fo:inline>'s mapping metadata.
<fo:basic-link internal-destination="jpa_overview_mapping_embed"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.8.3, “
Embedded Mapping
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_embed"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_embed"/>]</fo:inline></fo:basic-link> will show you how to use
<fo:inline font-family="monospace">AttributeOverride</fo:inline>s and <fo:inline font-family="monospace">AssociationOverride</fo:inline>
s to override superclass field mappings.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_mapping_inher_tpcex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.7. 
Table Per Class Mapping
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e10757">
@Entity
@Table(name="MAG")
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public class Magazine {
...
}
@Entity
@Table(name="TABLOID")
public class Tabloid
extends Magazine {
...
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
And the same classes in XML:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e10761">
&lt;entity class="org.mag.Magazine"&gt;
&lt;table name="MAG"/&gt;
&lt;inheritance strategy="TABLE_PER_CLASS"/&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.Tabloid"&gt;
&lt;table name="TABLOID"/&gt;
...
&lt;/entity&gt;
</fo:block></fo:block></fo:block><fo:block id="jpa_overview_mapping_inher_tpc_adv"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">12.6.3.1. 
Advantages
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e10766"><!--
inheritance
,
TABLE_PER_CLASS strategy
,
advantages
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The table-per-class strategy is very efficient when operating on instances of a
known class. Under these conditions, the strategy never requires joining to
superclass or subclass tables. Reads, joins, inserts, updates, and deletes are
all efficient in the absence of polymorphic behavior. Also, as in the joined
strategy, adding additional classes to the hierarchy does not require modifying
existing class tables.
</fo:block></fo:block><fo:block id="jpa_overview_mapping_inher_tpc_disadv"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">12.6.3.2. 
Disadvantages
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e10778"><!--
inheritance
,
TABLE_PER_CLASS strategy
,
disadvantages
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Polymorphic relations to non-leaf classes in a table-per-class hierarchy have
many limitations. When the concrete subclass is not known, the related object
could be in any of the subclass tables, making joins through the relation
impossible. This ambiguity also affects identity lookups and queries; these
operations require multiple SQL <fo:inline font-family="monospace">SELECT</fo:inline>s (one for each
possible subclass), or a complex <fo:inline font-family="monospace">UNION</fo:inline>.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e10793"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:basic-link internal-destination="ref_guide_mapping_limits_tpc"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.8.1, “
Table Per Class
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_limits_tpc"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_limits_tpc"/>]</fo:inline></fo:basic-link> in the Reference Guide
describes the limitations OpenJPA places on table-per-class mapping.
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_mapping_inher_together"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Putting it All Together
</fo:marker><fo:block font-size="17.28pt">12.6.4. 
Putting it All Together
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Now that we have covered JPA's inheritance strategies, we can update our mapping
document with inheritance information. Here is the complete model:
</fo:block><fo:block id="d0e10803"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/jpa-inher-all.png" width="341px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
And here is the corresponding mapping metadata:
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_mapping_inher_togetherex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.8. 
Inheritance Mapping
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e10812">
package org.mag;
@Entity
@IdClass(Magazine.MagazineId.class)
@Table(name="MAG")
public class Magazine {
@Column(length=9)
@Id private String isbn;
@Id private String title;
...
public static class MagazineId {
...
}
}
@Entity
@Table(name="ART", uniqueConstraints=@Unique(columnNames="TITLE"))
@SequenceGenerator(name="ArticleSeq", sequenceName="ART_SEQ")
public class Article {
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ArticleSeq")
private long id;
...
}
package org.mag.pub;
@Entity
@Table(name="COMP")
public class Company {
@Column(name="CID")
@Id private long id;
...
}
@Entity
@Table(name="AUTH")
public class Author {
@Id
@GeneratedValue(strategy=GenerationType.TABLE, generator="AuthorGen")
@TableGenerator(name="AuthorGen", table="AUTH_GEN", pkColumnName="PK",
valueColumnName="AID")
@Column(name="AID", columnDefinition="INTEGER64")
private long id;
...
}
@Embeddable
public class Address {
...
}
package org.mag.subscribe;
@MappedSuperclass
public abstract class Document {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private long id;
...
}
@Entity
@Table(schema="CNTRCT")
@Inheritance(strategy=InheritanceType.JOINED)
public class Contract
extends Document {
...
}
@Entity
@Table(name="SUB", schema="CNTRCT")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
public class Subscription {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private long id;
...
@Entity
@Table(name="LINE_ITEM", schema="CNTRCT")
@PrimaryKeyJoinColumn(name="ID", referencedColumnName="ID")
public static class LineItem
extends Contract {
...
}
}
@Entity(name="Lifetime")
public class LifetimeSubscription
extends Subscription {
...
}
@Entity(name="Trial")
public class TrialSubscription
extends Subscription {
...
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The same metadata expressed in XML form:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e10816">
&lt;entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
version="1.0"&gt;
&lt;mapped-superclass class="org.mag.subscribe.Document"&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;generated-value strategy="IDENTITY"/&gt;
&lt;/id&gt;
...
&lt;/attributes&gt;
&lt;/mapped-superclass&gt;
&lt;entity class="org.mag.Magazine"&gt;
&lt;table name="MAG"/&gt;
&lt;id-class="org.mag.Magazine.MagazineId"/&gt;
&lt;attributes&gt;
&lt;id name="isbn"&gt;
&lt;column length="9"/&gt;
&lt;/id&gt;
&lt;id name="title"/&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.Article"&gt;
&lt;table name="ART"&gt;
&lt;unique-constraint&gt;
&lt;column-name&gt;TITLE&lt;/column-name&gt;
&lt;/unique-constraint&gt;
&lt;/table&gt;
&lt;sequence-generator name="ArticleSeq" sequence-name="ART_SEQ"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;generated-value strategy="SEQUENCE" generator="ArticleSeq"/&gt;
&lt;/id&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.pub.Company"&gt;
&lt;table name="COMP"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;column name="CID"/&gt;
&lt;/id&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.pub.Author"&gt;
&lt;table name="AUTH"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;column name="AID" column-definition="INTEGER64"/&gt;
&lt;generated-value strategy="TABLE" generator="AuthorGen"/&gt;
&lt;table-generator name="AuthorGen" table="AUTH_GEN"
pk-column-name="PK" value-column-name="AID"/&gt;
&lt;/id&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subcribe.Contract"&gt;
&lt;table schema="CNTRCT"/&gt;
&lt;inheritance strategy="JOINED"/&gt;
&lt;attributes&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subcribe.Subscription"&gt;
&lt;table name="SUB" schema="CNTRCT"/&gt;
&lt;inheritance strategy="SINGLE_TABLE"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;generated-value strategy="IDENTITY"/&gt;
&lt;/id&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.Subscription.LineItem"&gt;
&lt;table name="LINE_ITEM" schema="CNTRCT"/&gt;
&lt;primary-key-join-column name="ID" referenced-column-name="PK"/&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.LifetimeSubscription" name="Lifetime"&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.TrialSubscription" name="Trial"&gt;
...
&lt;/entity&gt;
&lt;/entity-mappings&gt;
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_mapping_discrim"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Discriminator
</fo:marker><fo:block font-size="20.735999999999997pt">12.7. 
Discriminator
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e10821"><!--
discriminator
--></fo:wrapper><fo:wrapper id="d0e10824"><!--
mapping metadata
,
discriminator
--></fo:wrapper><fo:wrapper id="d0e10831"><!--
inheritance
,
discriminator
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:basic-link internal-destination="jpa_overview_mapping_inher_single"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">single table</fo:inline></fo:basic-link>
inheritance strategy results in a single table containing records for two or
more different classes in an inheritance hierarchy. Similarly, using the
<fo:basic-link internal-destination="jpa_overview_mapping_inher_joined"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"> joined</fo:inline></fo:basic-link> strategy
results in the superclass table holding records for superclass instances as well
as for the superclass state of subclass instances. When selecting data, JPA
needs a way to differentiate a row representing an object of one class from a
row representing an object of another. That is the job of the <fo:inline font-style="italic">
discriminator</fo:inline> column.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The discriminator column is always in the table of the base entity. It holds a
different value for records of each class, allowing the JPA runtime
to determine what class of object each row represents.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">DiscriminatorColumn</fo:inline> annotation represents a
discriminator column. It has these properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e10856"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10857"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String name</fo:inline>: The column name. Defaults to <fo:inline font-family="monospace">DTYPE
</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10866"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">length</fo:inline>: For string discriminator values, the length of the
column. Defaults to 31.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10872"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String columnDefinition</fo:inline>: This property has the same meaning
as the <fo:inline font-family="monospace">columnDefinition</fo:inline> property on the <fo:inline font-family="monospace">Column
</fo:inline> annotation, described in
<fo:basic-link internal-destination="jpa_overview_mapping_column"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.3, “
Column
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_column"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_column"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10886"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">DiscriminatorType discriminatorType</fo:inline>: Enum value declaring
the discriminator strategy of the hierarchy.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The corresponding XML element is <fo:inline font-family="monospace"> discriminator-column</fo:inline>. Its
attribues mirror the annotation properties above:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e10897"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10898"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10904"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">length</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10910"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">column-definition</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10916"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">discriminator-type</fo:inline>: One of <fo:inline font-family="monospace">STRING</fo:inline>,
<fo:inline font-family="monospace">CHAR</fo:inline>, or <fo:inline font-family="monospace">INTEGER</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">DiscriminatorValue</fo:inline> annotation specifies the
discriminator value for each class. Though this annotation's value is always a
string, the implementation will parse it according to the <fo:inline font-family="monospace">
DiscriminatorColumn</fo:inline>'s <fo:inline font-family="monospace">discriminatorType</fo:inline> property
above. The type defaults to <fo:inline font-family="monospace">DiscriminatorType.STRING</fo:inline>, but
may be <fo:inline font-family="monospace"> DiscriminatorType.CHAR</fo:inline> or <fo:inline font-family="monospace">
DiscriminatorType.INTEGER</fo:inline>. If you do not specify a <fo:inline font-family="monospace">
DiscriminatorValue</fo:inline>, the provider will choose an appropriate
default.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The corresponding XML element is <fo:inline font-family="monospace">discriminator-value</fo:inline>. The
text within this element is parsed as the discriminator value.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e10959"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA assumes your model employs a discriminator column if any of the
following are true:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.2em" id="d0e10962"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10963"><fo:list-item-label end-indent="label-end()"><fo:block>1.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The base entity explicitly declares an inheritance type of <fo:inline font-family="monospace">
SINGLE_TABLE</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10969"><fo:list-item-label end-indent="label-end()"><fo:block>2.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The base entity sets a discriminator value.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e10972"><fo:list-item-label end-indent="label-end()"><fo:block>3.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The base entity declares a discriminator column.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Only <fo:inline font-family="monospace">SINGLE_TABLE</fo:inline> inheritance hierarchies require a
discriminator column and values. <fo:inline font-family="monospace"> JOINED</fo:inline> hierarchies can use
a discriminator to make some operations more efficient, but do not require one.
<fo:inline font-family="monospace">TABLE_PER_CLASS</fo:inline> hierarchies have no use for a discriminator.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA defines additional discriminator strategies; see
<fo:basic-link internal-destination="ref_guide_mapping_jpa"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.7, “
Additional JPA Mappings
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_jpa"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_jpa"/>]</fo:inline></fo:basic-link> in the Reference Guide for
details. OpenJPA also supports final entity classes. OpenJPA does not use a
discriminator on final classes.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
We can now translate our newfound knowledge of JPA discriminators into concrete
JPA mappings. We first extend our diagram with discriminator columns:
</fo:block><fo:block id="d0e10992"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/jpa-discrim-all.png" width="341px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Next, we present the updated mapping document. Notice that in this version, we
have removed explicit inheritance annotations when the defaults sufficed. Also,
notice that entities using the default <fo:inline font-family="monospace">DTYPE</fo:inline> discriminator
column mapping do not need an explicit <fo:inline font-family="monospace">DiscriminatorColumn
</fo:inline> annotation.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_mapping_discrimex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.9. 
Discriminator Mapping
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e11007">
package org.mag;
@Entity
@IdClass(Magazine.MagazineId.class)
@Table(name="MAG")
@DiscriminatorValue("Mag")
public class Magazine {
@Column(length=9)
@Id private String isbn;
@Id private String title;
...
public static class MagazineId {
...
}
}
@Entity
@Table(name="ART", uniqueConstraints=@Unique(columnNames="TITLE"))
@SequenceGenerator(name="ArticleSeq", sequenceName="ART_SEQ")
public class Article {
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ArticleSeq")
private long id;
...
}
package org.mag.pub;
@Entity
@Table(name="COMP")
public class Company {
@Column(name="CID")
@Id private long id;
...
}
@Entity
@Table(name="AUTH")
public class Author {
@Id
@GeneratedValue(strategy=GenerationType.TABLE, generator="AuthorGen")
@TableGenerator(name="AuthorGen", table="AUTH_GEN", pkColumnName="PK",
valueColumnName="AID")
@Column(name="AID", columnDefinition="INTEGER64")
private long id;
...
}
@Embeddable
public class Address {
...
}
package org.mag.subscribe;
@MappedSuperclass
public abstract class Document {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private long id;
...
}
@Entity
@Table(schema="CNTRCT")
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name="CTYPE")
public class Contract
extends Document {
...
}
@Entity
@Table(name="SUB", schema="CNTRCT")
@DiscriminatorColumn(name="KIND", discriminatorType=DiscriminatorType.INTEGER)
@DiscriminatorValue("1")
public class Subscription {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private long id;
...
@Entity
@Table(name="LINE_ITEM", schema="CNTRCT")
public static class LineItem
extends Contract {
...
}
}
@Entity(name="Lifetime")
@DiscriminatorValue("2")
public class LifetimeSubscription
extends Subscription {
...
}
@Entity(name="Trial")
@DiscriminatorValue("3")
public class TrialSubscription
extends Subscription {
...
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The same metadata expressed in XML:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e11011">
&lt;entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
version="1.0"&gt;
&lt;mapped-superclass class="org.mag.subscribe.Document"&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;generated-value strategy="IDENTITY"/&gt;
&lt;/id&gt;
...
&lt;/attributes&gt;
&lt;/mapped-superclass&gt;
&lt;entity class="org.mag.Magazine"&gt;
&lt;table name="MAG"/&gt;
&lt;id-class="org.mag.Magazine.MagazineId"/&gt;
&lt;discriminator-value&gt;Mag&lt;/discriminator-value&gt;
&lt;attributes&gt;
&lt;id name="isbn"&gt;
&lt;column length="9"/&gt;
&lt;/id&gt;
&lt;id name="title"/&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.Article"&gt;
&lt;table name="ART"&gt;
&lt;unique-constraint&gt;
&lt;column-name&gt;TITLE&lt;/column-name&gt;
&lt;/unique-constraint&gt;
&lt;/table&gt;
&lt;sequence-generator name="ArticleSeq" sequence-name="ART_SEQ"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;generated-value strategy="SEQUENCE" generator="ArticleSeq"/&gt;
&lt;/id&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.pub.Company"&gt;
&lt;table name="COMP"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;column name="CID"/&gt;
&lt;/id&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.pub.Author"&gt;
&lt;table name="AUTH"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;column name="AID" column-definition="INTEGER64"/&gt;
&lt;generated-value strategy="TABLE" generator="AuthorGen"/&gt;
&lt;table-generator name="AuthorGen" table="AUTH_GEN"
pk-column-name="PK" value-column-name="AID"/&gt;
&lt;/id&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subcribe.Contract"&gt;
&lt;table schema="CNTRCT"/&gt;
&lt;inheritance strategy="JOINED"/&gt;
&lt;discriminator-column name="CTYPE"/&gt;
&lt;attributes&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subcribe.Subscription"&gt;
&lt;table name="SUB" schema="CNTRCT"/&gt;
&lt;inheritance strategy="SINGLE_TABLE"/&gt;
&lt;discriminator-value&gt;1&lt;/discriminator-value&gt;
&lt;discriminator-column name="KIND" discriminator-type="INTEGER"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;generated-value strategy="IDENTITY"/&gt;
&lt;/id&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.Subscription.LineItem"&gt;
&lt;table name="LINE_ITEM" schema="CNTRCT"/&gt;
&lt;primary-key-join-column name="ID" referenced-column-name="PK"/&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.LifetimeSubscription" name="Lifetime"&gt;
&lt;discriminator-value&gt;2&lt;/discriminator-value&gt;
...
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.TrialSubscription" name="Trial"&gt;
&lt;discriminator-value&gt;3&lt;/discriminator-value&gt;
...
&lt;/entity&gt;
&lt;/entity-mappings&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_mapping_field"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Field Mapping
</fo:marker><fo:block font-size="20.735999999999997pt">12.8. 
Field Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e11016"><!--
mapping metadata
,
field mapping
--></fo:wrapper><fo:wrapper id="d0e11023"><!--
persistent fields
,
mapping metadata
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following sections enumerate the myriad of field mappings JPA
supports. JPA augments the persistence metadata covered in
<fo:basic-link internal-destination="jpa_overview_meta"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 5, <fo:inline font-style="italic">
Metadata
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta"/>]</fo:inline></fo:basic-link> with many new object-relational
annotations. As we explore the library of standard mappings, we introduce each
of these enhancements in context.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e11032"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA supports many additional field types, and allows you to create custom
mappings for unsupported field types or database schemas. See the Reference
Guide's <fo:basic-link internal-destination="ref_guide_mapping"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 7, <fo:inline font-style="italic">
Mapping
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping"/>]</fo:inline></fo:basic-link> for complete coverage of
OpenJPA's mapping capabilities.
</fo:block></fo:block></fo:block><fo:block id="jpa_overview_mapping_basic"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Basic Mapping
</fo:marker><fo:block font-size="17.28pt">12.8.1. 
Basic Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e11040"><!--
mapping metadata
,
basic fields
--></fo:wrapper><fo:wrapper id="d0e11047"><!--
persistent fields
,
basic
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A <fo:inline font-style="italic">basic</fo:inline> field mapping stores the field value directly into
a database column. The following field metadata types use basic mapping. These
types were defined in <fo:basic-link internal-destination="jpa_overview_meta_field"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2, “
Field and Property Metadata
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_field"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_field"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e11059"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11060"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link internal-destination="jpa_overview_meta_id"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">Id</fo:inline></fo:inline></fo:basic-link> fields.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11067"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link internal-destination="jpa_overview_meta_version"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace"> Version</fo:inline></fo:inline></fo:basic-link>
fields.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11074"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link internal-destination="jpa_overview_meta_basic"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">Basic</fo:inline></fo:inline></fo:basic-link>
fields.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In fact, you have already seen examples of basic field mappings in this chapter
- the mapping of all identity fields in
<fo:basic-link internal-destination="jpa_overview_mapping_identityex"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Example 12.3, “
Identity Mapping
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_identityex"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_identityex"/>]</fo:inline></fo:basic-link>. As you saw in that
section, to write a basic field mapping you use the <fo:inline font-family="monospace">Column
</fo:inline> annotation to describe the column the field value is stored in. We
discussed the <fo:inline font-family="monospace">Column</fo:inline> annotation in
<fo:basic-link internal-destination="jpa_overview_mapping_column"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.3, “
Column
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_column"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_column"/>]</fo:inline></fo:basic-link>. Recall that the name of
the column defaults to the field name, and the type of the column defaults to an
appropriate type for the field type. These defaults allow you to sometimes omit
the annotation altogether.
</fo:block><fo:block id="jpa_overview_mapping_lob"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">12.8.1.1. 
LOBs
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e11096"><!--
LOB
--></fo:wrapper><fo:wrapper id="d0e11099"><!--
mapping metadata
,
LOB types
--></fo:wrapper><fo:wrapper id="d0e11104"><!--
annotations
,
Lob
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Adding the <fo:inline font-family="monospace">Lob</fo:inline> marker annotation to a basic field signals
that the data is to be stored as a LOB (Large OBject). If the field holds string
or character data, it will map to a <fo:inline font-family="monospace">CLOB</fo:inline> (Character Large
OBject) database column. If the field holds any other data type, it will be
stored as binary data in a <fo:inline font-family="monospace">BLOB</fo:inline> (Binary Large OBject) column.
The implementation will serialize the Java value if needed.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The equivalent XML element is <fo:inline font-family="monospace">lob</fo:inline>, which has no children or
attributes.
</fo:block></fo:block><fo:block id="jpa_overview_mapping_enum"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">12.8.1.2. 
Enumerated
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e11128"><!--
Enumerated
--></fo:wrapper><fo:wrapper id="d0e11131"><!--
mapping metadata
,
enums
--></fo:wrapper><fo:wrapper id="d0e11136"><!--
annotations
,
Enumerated
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can apply the <fo:inline font-family="monospace">Enumerated</fo:inline> annotation to your
<fo:inline font-family="monospace">Enum</fo:inline> fields to control how they map to the database. The
<fo:inline font-family="monospace">Enumerated</fo:inline> annotation's value one of the following
constants from the <fo:inline font-family="monospace">EnumType</fo:inline> enum:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e11155"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11156"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">EnumType.ORDINAL</fo:inline>: The default. The persistence
implementation places the ordinal value of the enum in a numeric column. This is
an efficient mapping, but may break if you rearrange the Java enum declaration.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11162"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">EnumType.STRING</fo:inline>: Store the name of the enum value rather
than the ordinal. This mapping uses a <fo:inline font-family="monospace">VARCHAR</fo:inline> column rather
than a numeric one.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">Enumerated</fo:inline> annotation is optional. Any un-annotated
enumeration field defaults to <fo:inline font-family="monospace">ORDINAL</fo:inline> mapping.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The corresponding XML element is <fo:inline font-family="monospace">enumerated</fo:inline>. Its embedded
text must be one of <fo:inline font-family="monospace">STRING</fo:inline> or <fo:inline font-family="monospace">ORIDINAL</fo:inline>.
</fo:block></fo:block><fo:block id="jpa_overview_mapping_temporal"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">12.8.1.3. 
Temporal Types
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e11193"><!--
mapping metadata
,
temporal types
--></fo:wrapper><fo:wrapper id="d0e11198"><!--
persistent fields
,
temporal
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">Temporal</fo:inline> annotation determines how the implementation
handles your basic <fo:inline font-family="monospace"> java.util.Date</fo:inline> and <fo:inline font-family="monospace">
java.util.Calendar</fo:inline> fields at the JDBC level. The <fo:inline font-family="monospace">
Temporal</fo:inline> annotation's value is a constant from the <fo:inline font-family="monospace">
TemporalType</fo:inline> enum. Available values are:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e11220"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11221"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">TemporalType.TIMESTAMP</fo:inline>: The default. Use JDBC's timestamp
APIs to manipulate the column data.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11227"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">TemporalType.DATE</fo:inline>: Use JDBC's SQL date APIs to manipulate
the column data.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11233"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">TemporalType.TIME</fo:inline>: Use JDBC's time APIs to manipulate the
column data.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If the <fo:inline font-family="monospace">Temporal</fo:inline> annotation is omitted, the implementation
will treat the data as a timestamp.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The corresponding XML element is <fo:inline font-family="monospace">temporal</fo:inline>, whose text value
must be one of: <fo:inline font-family="monospace">TIME</fo:inline>, <fo:inline font-family="monospace">DATE</fo:inline>, or <fo:inline font-family="monospace">
TIMESTAMP</fo:inline>.
</fo:block></fo:block><fo:block id="jpa_overview_mapping_basic_example"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">12.8.1.4. 
The Updated Mappings
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Below we present an updated diagram of our model and its associated database
schema, followed by the corresponding mapping metadata. Note that the mapping
metadata relies on defaults where possible. Also note that as a mapped
superclass, <fo:inline font-family="monospace">Document</fo:inline> can define mappings that will
automatically transfer to its subclass' tables. In
<fo:basic-link internal-destination="jpa_overview_mapping_embed"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.8.3, “
Embedded Mapping
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_embed"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_embed"/>]</fo:inline></fo:basic-link>, you will see how a subclass
can override its mapped superclass' mappings.
</fo:block><fo:block id="d0e11268"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/jpa-basic-field.png" width="387px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_mapping_basicex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.10. 
Basic Field Mapping
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e11275">
package org.mag;
@Entity
@IdClass(Magazine.MagazineId.class)
@Table(name="MAG")
@DiscriminatorValue("Mag")
public class Magazine {
@Column(length=9)
@Id private String isbn;
@Id private String title;
@Column(name="VERS")
@Version private int version;
private String name;
private double price;
@Column(name="COPIES")
private int copiesSold;
...
public static class MagazineId {
...
}
}
@Entity
@Table(name="ART", uniqueConstraints=@Unique(columnNames="TITLE"))
@SequenceGenerator(name="ArticleSeq", sequenceName="ART_SEQ")
public class Article {
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ArticleSeq")
private long id;
@Column(name="VERS")
@Version private int version;
private String title;
private byte[] content;
...
}
package org.mag.pub;
@Entity
@Table(name="COMP")
public class Company {
@Column(name="CID")
@Id private long id;
@Column(name="VERS")
@Version private int version;
private String name;
@Column(name="REV")
private double revenue;
...
}
@Entity
@Table(name="AUTH")
public class Author {
@Id
@GeneratedValue(strategy=GenerationType.TABLE, generator="AuthorGen")
@TableGenerator(name="AuthorGen", table="AUTH_GEN", pkColumnName="PK",
valueColumnName="AID")
@Column(name="AID", columnDefinition="INTEGER64")
private long id;
@Column(name="VERS")
@Version private int version;
@Column(name="FNAME")
private String firstName;
@Column(name="LNAME")
private String lastName;
...
}
@Embeddable
public class Address {
...
}
package org.mag.subscribe;
@MappedSuperclass
public abstract class Document {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private long id;
@Column(name="VERS")
@Version private int version;
...
}
@Entity
@Table(schema="CNTRCT")
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name="CTYPE")
public class Contract
extends Document {
@Lob
private String terms;
...
}
@Entity
@Table(name="SUB", schema="CNTRCT")
@DiscriminatorColumn(name="KIND", discriminatorType=DiscriminatorType.INTEGER)
@DiscriminatorValue("1")
public class Subscription {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private long id;
@Column(name="VERS")
@Version private int version;
@Column(name="START")
private Date startDate;
@Column(name="PAY")
private double payment;
...
@Entity
@Table(name="LINE_ITEM", schema="CNTRCT")
public static class LineItem
extends Contract {
@Column(name="COMM")
private String comments;
private double price;
private long num;
...
}
}
@Entity(name="Lifetime")
@DiscriminatorValue("2")
public class LifetimeSubscription
extends Subscription {
@Basic(fetch=FetchType.LAZY)
@Column(name="ELITE")
private boolean getEliteClub () { ... }
public void setEliteClub (boolean elite) { ... }
...
}
@Entity(name="Trial")
@DiscriminatorValue("3")
public class TrialSubscription
extends Subscription {
@Column(name="END")
public Date getEndDate () { ... }
public void setEndDate (Date end) { ... }
...
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The same metadata expressed in XML:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e11279">
&lt;entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
version="1.0"&gt;
&lt;mapped-superclass class="org.mag.subscribe.Document"&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;generated-value strategy="IDENTITY"/&gt;
&lt;/id&gt;
&lt;version name="version"&gt;
&lt;column name="VERS"/&gt;
&lt;/version&gt;
...
&lt;/attributes&gt;
&lt;/mapped-superclass&gt;
&lt;entity class="org.mag.Magazine"&gt;
&lt;table name="MAG"/&gt;
&lt;id-class="org.mag.Magazine.MagazineId"/&gt;
&lt;discriminator-value&gt;Mag&lt;/discriminator-value&gt;
&lt;attributes&gt;
&lt;id name="isbn"&gt;
&lt;column length="9"/&gt;
&lt;/id&gt;
&lt;id name="title"/&gt;
&lt;basic name="name"/&gt;
&lt;basic name="price"/&gt;
&lt;basic name="copiesSold"&gt;
&lt;column name="COPIES"/&gt;
&lt;/basic&gt;
&lt;version name="version"&gt;
&lt;column name="VERS"/&gt;
&lt;/version&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.Article"&gt;
&lt;table name="ART"&gt;
&lt;unique-constraint&gt;
&lt;column-name&gt;TITLE&lt;/column-name&gt;
&lt;/unique-constraint&gt;
&lt;/table&gt;
&lt;sequence-generator name="ArticleSeq", sequenceName="ART_SEQ"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;generated-value strategy="SEQUENCE" generator="ArticleSeq"/&gt;
&lt;/id&gt;
&lt;basic name="title"/&gt;
&lt;basic name="content"/&gt;
&lt;version name="version"&gt;
&lt;column name="VERS"/&gt;
&lt;/version&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.pub.Company"&gt;
&lt;table name="COMP"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;column name="CID"/&gt;
&lt;/id&gt;
&lt;basic name="name"/&gt;
&lt;basic name="revenue"&gt;
&lt;column name="REV"/&gt;
&lt;/basic&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.pub.Author"&gt;
&lt;table name="AUTH"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;column name="AID" column-definition="INTEGER64"/&gt;
&lt;generated-value strategy="TABLE" generator="AuthorGen"/&gt;
&lt;table-generator name="AuthorGen" table="AUTH_GEN"
pk-column-name="PK" value-column-name="AID"/&gt;
&lt;/id&gt;
&lt;basic name="firstName"&gt;
&lt;column name="FNAME"/&gt;
&lt;/basic&gt;
&lt;basic name="lastName"&gt;
&lt;column name="LNAME"/&gt;
&lt;/basic&gt;
&lt;version name="version"&gt;
&lt;column name="VERS"/&gt;
&lt;/version&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subcribe.Contract"&gt;
&lt;table schema="CNTRCT"/&gt;
&lt;inheritance strategy="JOINED"/&gt;
&lt;discriminator-column name="CTYPE"/&gt;
&lt;attributes&gt;
&lt;basic name="terms"&gt;
&lt;lob/&gt;
&lt;/basic&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subcribe.Subscription"&gt;
&lt;table name="SUB" schema="CNTRCT"/&gt;
&lt;inheritance strategy="SINGLE_TABLE"/&gt;
&lt;discriminator-value&gt;1&lt;/discriminator-value&gt;
&lt;discriminator-column name="KIND" discriminator-type="INTEGER"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;generated-value strategy="IDENTITY"/&gt;
&lt;/id&gt;
&lt;basic name="payment"&gt;
&lt;column name="PAY"/&gt;
&lt;/basic&gt;
&lt;basic name="startDate"&gt;
&lt;column name="START"/&gt;
&lt;/basic&gt;
&lt;version name="version"&gt;
&lt;column name="VERS"/&gt;
&lt;/version&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.Subscription.LineItem"&gt;
&lt;table name="LINE_ITEM" schema="CNTRCT"/&gt;
&lt;primary-key-join-column name="ID" referenced-column-name="PK"/&gt;
&lt;attributes&gt;
&lt;basic name="comments"&gt;
&lt;column name="COMM"/&gt;
&lt;/basic&gt;
&lt;basic name="price"/&gt;
&lt;basic name="num"/&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.LifetimeSubscription" name="Lifetime"&gt;
&lt;discriminator-value&gt;2&lt;/discriminator-value&gt;
&lt;attributes&gt;
&lt;basic name="eliteClub" fetch="LAZY"&gt;
&lt;column name="ELITE"/&gt;
&lt;/basic&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.TrialSubscription" name="Trial"&gt;
&lt;discriminator-value&gt;3&lt;/discriminator-value&gt;
&lt;attributes&gt;
&lt;basic name="endDate"&gt;
&lt;column name="END"/&gt;
&lt;/basic&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;/entity-mappings&gt;
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_mapping_secondary"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Secondary Tables
</fo:marker><fo:block font-size="17.28pt">12.8.2. 
Secondary Tables
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e11284"><!--
mapping metadata
,
secondary table fields
--></fo:wrapper><fo:wrapper id="d0e11291"><!--
persistent fields
,
in secondary tables
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Sometimes a a logical record is spread over multiple database tables. JPA
calls a class' declared table the <fo:inline font-style="italic">primary</fo:inline>
table, and calls other tables that make up a logical record <fo:inline font-style="italic">secondary
</fo:inline> tables. You can map any persistent field to a secondary table. Just
write the standard field mapping, then perform these two additional steps:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.2em" id="d0e11304"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11305"><fo:list-item-label end-indent="label-end()"><fo:block>1.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Set the <fo:inline font-family="monospace">table</fo:inline> attribute of each of the field's columns or
join columns to the name of the secondary table.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11311"><fo:list-item-label end-indent="label-end()"><fo:block>2.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Define the secondary table on the entity class declaration.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You define secondary tables with the <fo:inline font-family="monospace">SecondaryTable</fo:inline>
annotation. This annotation has all the properties of the <fo:inline font-family="monospace">Table
</fo:inline> annotation covered in <fo:basic-link internal-destination="jpa_overview_mapping_table"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.1, “
Table
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_table"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_table"/>]</fo:inline></fo:basic-link>
, plus a <fo:inline font-family="monospace"> pkJoinColumns</fo:inline> property.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">pkJoinColumns</fo:inline> property is an array of <fo:inline font-family="monospace">
PrimaryKeyJoinColumn</fo:inline>s dictating how to join secondary table records
to their owning primary table records. Each <fo:inline font-family="monospace">PrimaryKeyJoinColumn
</fo:inline> joins a secondary table column to a primary key column in the
primary table. See <fo:basic-link internal-destination="jpa_overview_mapping_inher_joined"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.6.2, “
Joined
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_inher_joined"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_inher_joined"/>]</fo:inline></fo:basic-link>
above for coverage of <fo:inline font-family="monospace">PrimaryKeyJoinColumn</fo:inline>'s properties.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The corresponding XML element is <fo:inline font-family="monospace">secondary-table</fo:inline>. This
element has all the attributes of the <fo:inline font-family="monospace">table</fo:inline> element, but also
accepts nested <fo:inline font-family="monospace">primary-key-join-column</fo:inline> elements.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In the following example, we move the <fo:inline font-family="monospace">Article.content</fo:inline> field
we mapped in <fo:basic-link internal-destination="jpa_overview_mapping_basic"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.8.1, “
Basic Mapping
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_basic"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_basic"/>]</fo:inline></fo:basic-link> into a joined
secondary table, like so:
</fo:block><fo:block id="d0e11361"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/secondary-table.png" width="189px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_mapping_secondaryex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.11. 
Secondary Table Field Mapping
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e11368">
package org.mag;
@Entity
@Table(name="ART")
@SecondaryTable(name="ART_DATA",
pkJoinColumns=@PrimaryKeyJoinColumn(name="ART_ID", referencedColumnName="ID"))
public class Article {
@Id private long id;
@Column(table="ART_DATA")
private byte[] content;
...
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
And in XML:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e11372">
&lt;entity class="org.mag.Article"&gt;
&lt;table name="ART"&gt;
&lt;secondary-table name="ART_DATA"&gt;
&lt;primary-key-join-column name="ART_ID" referenced-column-name="ID"/&gt;
&lt;/secondary-table&gt;
&lt;attributes&gt;
&lt;id name="id"/&gt;
&lt;basic name="content"&gt;
&lt;column table="ART_DATA"/&gt;
&lt;/basic&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_mapping_embed"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Embedded Mapping
</fo:marker><fo:block font-size="17.28pt">12.8.3. 
Embedded Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e11377"><!--
mapping metadata
,
embedded fields
--></fo:wrapper><fo:wrapper id="d0e11384"><!--
embedded
,
mapping embedded fields
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:basic-link internal-destination="jpa_overview_meta"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 5, <fo:inline font-style="italic">
Metadata
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta"/>]</fo:inline></fo:basic-link> describes JPA's concept of <fo:inline font-style="italic">
embeddable</fo:inline> objects. The field values of embedded objects are stored
as part of the owning record, rather than as a separate database record. Thus,
instead of mapping a relation to an embeddable object as a foreign key, you map
all the fields of the embeddable instance to columns in the owning field's
table.
</fo:block><fo:block id="d0e11396"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/jpa-embedded.png" width="309px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA defaults the embedded column names and descriptions to those of
the embeddable class' field mappings. The <fo:inline font-family="monospace"> AttributeOverride
</fo:inline> annotation overrides a basic embedded mapping. This annotation has
the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e11405"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11406"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String name</fo:inline>: The name of the embedded class' field being
mapped to this class' table.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11412"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Column column</fo:inline>: The column defining the mapping of the
embedded class' field to this class' table.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The corresponding XML element is <fo:inline font-family="monospace"> attribute-override</fo:inline>. It has
a single <fo:inline font-family="monospace">name</fo:inline> attribute to name the field being overridden,
and a single <fo:inline font-family="monospace">column</fo:inline> child element.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To declare multiple overrides, use the <fo:inline font-family="monospace">AttributeOverrides</fo:inline>
annotation, whose value is an array of <fo:inline font-family="monospace">AttributeOverride</fo:inline>
s. In XML, simply list multiple <fo:inline font-family="monospace">attribute-override</fo:inline> elements
in succession.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To override a many to one or one to one relationship, use the <fo:inline font-family="monospace">
AssociationOverride</fo:inline> annotation in place of <fo:inline font-family="monospace">
AttributeOverride</fo:inline>. <fo:inline font-family="monospace"> AssociationOverride</fo:inline> has
the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e11451"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11452"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String name</fo:inline>: The name of the embedded class' field being
mapped to this class' table.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11458"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">JoinColumn[] joinColumns</fo:inline>: The foreign key columns joining to
the related record.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The corresponding XML element is <fo:inline font-family="monospace"> association-override</fo:inline>. It
has a single <fo:inline font-family="monospace">name</fo:inline> attribute to name the field being
overridden, and one or more <fo:inline font-family="monospace">join-column</fo:inline> child elements.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To declare multiple relation overrides, use the <fo:inline font-family="monospace"> AssociationOverrides
</fo:inline> annotation, whose value is an array of <fo:inline font-family="monospace">
AssociationOverride</fo:inline> s. In XML, simply list multiple <fo:inline font-family="monospace">
association-override</fo:inline> elements in succession.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_mapping_embedex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.12. 
Embedded Field Mapping
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In this example, <fo:inline font-family="monospace">Company</fo:inline> overrides the default mapping of
<fo:inline font-family="monospace">Address.street</fo:inline> and <fo:inline font-family="monospace">Address.city</fo:inline>. All
other embedded mappings are taken from the <fo:inline font-family="monospace">Address</fo:inline>
embeddable class.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e11503">
package org.mag.pub;
@Entity
@Table(name="COMP")
public class Company {
@Embedded
@AttributeOverrides({
@AttributeOverride(name="street", column=@Column(name="STRT")),
@AttributeOverride(name="city", column=@Column(name="ACITY"))
})
private Address address;
...
}
@Entity
@Table(name="AUTH")
public class Author {
// use all defaults from Address class mappings
private Address address;
...
}
@Embeddable
public class Address {
private String street;
private String city;
@Column(columnDefinition="CHAR(2)")
private String state;
private String zip;
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The same metadata expressed in XML:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e11507">
&lt;entity class="org.mag.pub.Company"&gt;
&lt;table name="COMP"/&gt;
&lt;attributes&gt;
...
&lt;embedded name="address"&gt;
&lt;attribute-override name="street"&gt;
&lt;column name="STRT"/&gt;
&lt;/attribute-override&gt;
&lt;attribute-override name="city"&gt;
&lt;column name="ACITY"/&gt;
&lt;/attribute-override&gt;
&lt;/embedded&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.pub.Author"&gt;
&lt;table name="AUTH"/&gt;
&lt;attributes&gt;
&lt;embedded name="address"&gt;
&lt;!-- use all defaults from Address --&gt;
&lt;/embedded&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;embeddable class="org.mag.pub.Address"&gt;
&lt;attributes&gt;
&lt;basic name="street"/&gt;
&lt;basic name="city"/&gt;
&lt;basic name="state"&gt;
&lt;column column-definition="CHAR(2)"/&gt;
&lt;/basic&gt;
&lt;basic name="zip"/&gt;
&lt;/attributes&gt;
&lt;/embeddable&gt;
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can also use attribute overrides on an entity class to override mappings
defined by its mapped superclass or table-per-class superclass. The example
below re-maps the <fo:inline font-family="monospace">Document.version</fo:inline> field to the <fo:inline font-family="monospace">
Contract</fo:inline> table's <fo:inline font-family="monospace">CVERSION</fo:inline> column.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_mapping_joined_overex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.13. 
Mapping Mapped Superclass Field
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e11523">
@MappedSuperclass
public abstract class Document {
@Column(name="VERS")
@Version private int version;
...
}
@Entity
@Table(schema="CNTRCT")
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name="CTYPE")
@AttributeOverride(name="version", column=@Column(name="CVERSION"))
public class Contract
extends Document {
...
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The same metadata expressed in XML form:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e11527">
&lt;mapped-superclass class="org.mag.subcribe.Document"&gt;
&lt;attributes&gt;
&lt;version name="version"&gt;
&lt;column name="VERS"&gt;
&lt;/version&gt;
...
&lt;/attributes&gt;
&lt;/mapped-superclass&gt;
&lt;entity class="org.mag.subcribe.Contract"&gt;
&lt;table schema="CNTRCT"/&gt;
&lt;inheritance strategy="JOINED"/&gt;
&lt;discriminator-column name="CTYPE"/&gt;
&lt;attribute-override name="version"&gt;
&lt;column name="CVERSION"/&gt;
&lt;/attribute-override&gt;
&lt;attributes&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_mapping_rel"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Direct Relations
</fo:marker><fo:block font-size="17.28pt">12.8.4. 
Direct Relations
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e11532"><!--
mapping metadata
,
direct relation fields
--></fo:wrapper><fo:wrapper id="d0e11539"><!--
persistent fields
,
direct relations
--></fo:wrapper><fo:wrapper id="d0e11544"><!--
one-one
--></fo:wrapper><fo:wrapper id="d0e11549"><!--
many-one
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A direct relation is a non-embedded persistent field that holds a reference to
another entity. <fo:basic-link internal-destination="jpa_overview_meta_manytoone"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">many to one</fo:inline></fo:basic-link>
and <fo:basic-link internal-destination="jpa_overview_meta_onetoone"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">one to one</fo:inline></fo:basic-link> metadata field
types are mapped as direct relations. Our model has three direct relations:
<fo:inline font-family="monospace">Magazine</fo:inline>'s <fo:inline font-family="monospace">publisher</fo:inline> field is a direct
relation to a <fo:inline font-family="monospace">Company</fo:inline>, <fo:inline font-family="monospace">Magazine</fo:inline>'s
<fo:inline font-family="monospace">coverArticle</fo:inline> field is a direct relation to <fo:inline font-family="monospace">
Article</fo:inline>, and the <fo:inline font-family="monospace">LineItem.magazine</fo:inline> field is a
direct relation to a <fo:inline font-family="monospace">Magazine</fo:inline>. Direct relations are
represented in the database by foreign key columns:
</fo:block><fo:block id="d0e11586"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/jpa-direct-relation.png" width="249px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You typically map a direct relation with <fo:inline font-family="monospace">JoinColumn</fo:inline>
annotations describing how the local foreign key columns join to the primary key
columns of the related record. The <fo:inline font-family="monospace">JoinColumn</fo:inline> annotation
exposes the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e11598"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11599"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String name</fo:inline>: The name of the foreign key column. Defaults to
the relation field name, plus an underscore, plus the name of the referenced
primary key column.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11605"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String referencedColumnName</fo:inline>: The name of the primary key
column being joined to. If there is only one identity field in the related
entity class, the join column name defaults to the name of the identity field's
column.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11611"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean unique</fo:inline>: Whether this column is guaranteed to hold
unique values for all rows. Defaults to false.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-family="monospace">JoinColumn</fo:inline> also has the same <fo:inline font-family="monospace"> nullable</fo:inline>
, <fo:inline font-family="monospace">insertable</fo:inline>, <fo:inline font-family="monospace"> updatable</fo:inline>, <fo:inline font-family="monospace">
columnDefinition</fo:inline>, and <fo:inline font-family="monospace">table</fo:inline> properties as the
<fo:inline font-family="monospace"> Column</fo:inline> annotation. See
<fo:basic-link internal-destination="jpa_overview_mapping_column"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.3, “
Column
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_column"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_column"/>]</fo:inline></fo:basic-link> for details on these
properties.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">join-column</fo:inline> element represents a join column in XML. Its
attributes mirror the above annotation's properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e11647"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11648"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">name</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11654"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">referenced-column-name</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11660"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">unique</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11666"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">nullable</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11672"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">insertable</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11678"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">updatable</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11684"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">column-definition</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11690"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">table</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When there are multiple columns involved in the join, as when a <fo:inline font-family="monospace">
LineItem</fo:inline> references a <fo:inline font-family="monospace">Magazine</fo:inline> in our model,
the <fo:inline font-family="monospace">JoinColumns</fo:inline> annotation allows you to specify an array
of <fo:inline font-family="monospace">JoinColumn</fo:inline> values. In XML, simply list multiple
<fo:inline font-family="monospace">join-column</fo:inline> elements.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e11713"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA supports many non-standard joins. See
<fo:basic-link internal-destination="ref_guide_mapping_notes_nonstdjoins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.6, “
Non-Standard Joins
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_notes_nonstdjoins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_notes_nonstdjoins"/>]</fo:inline></fo:basic-link> in the Reference
Guide for details.
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_mapping_relex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.14. 
Direct Relation Field Mapping
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e11721">
package org.mag;
@Table(name="AUTH")
public class Magazine {
@Column(length=9)
@Id private String isbn;
@Id private String title;
@OneToOne
@JoinColumn(name="COVER_ID" referencedColumnName="ID")
private Article coverArticle;
@ManyToOne
@JoinColumn(name="PUB_ID" referencedColumnName="CID")
private Company publisher;
...
}
@Table(name="ART")
public class Article {
@Id private long id;
...
}
package org.mag.pub;
@Table(name="COMP")
public class Company {
@Column(name="CID")
@Id private long id;
...
}
package org.mag.subscribe;
public class Subscription {
...
@Table(name="LINE_ITEM", schema="CNTRCT")
public static class LineItem
extends Contract {
@ManyToOne
@JoinColumns({
@JoinColumn(name="MAG_ISBN" referencedColumnName="ISBN"),
@JoinColumn(name="MAG_TITLE" referencedColumnName="TITLE")
})
private Magazine magazine;
...
}
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The same metadata expressed in XML form:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e11725">
&lt;entity class="org.mag.Magazine"&gt;
&lt;table name="MAG"/&gt;
&lt;id-class="org.mag.Magazine.MagazineId"/&gt;
&lt;attributes&gt;
&lt;id name="isbn"&gt;
&lt;column length="9"/&gt;
&lt;/id&gt;
&lt;id name="title"/&gt;
&lt;one-to-one name="coverArticle"&gt;
&lt;join-column name="COVER_ID" referenced-column-name="ID"/&gt;
&lt;/one-to-one&gt;
&lt;many-to-one name="publisher"&gt;
&lt;join-column name="PUB_IC" referenced-column-name="CID"/&gt;
&lt;/many-to-one&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.Article"&gt;
&lt;table name="ART"/&gt;
&lt;attributes&gt;
&lt;id name="id"/&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.pub.Company"&gt;
&lt;table name="COMP"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;column name="CID"/&gt;
&lt;/id&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.Subscription.LineItem"&gt;
&lt;table name="LINE_ITEM" schema="CNTRCT"/&gt;
&lt;primary-key-join-column name="ID" referenced-column-name="PK"/&gt;
&lt;attributes&gt;
&lt;many-to-one name="magazine"&gt;
&lt;join-column name="MAG_ISBN" referenced-column-name="ISBN"/&gt;
&lt;join-column name="MAG_TITLE" referenced-column-name="TITLE"/&gt;
&lt;/many-to-one&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When the entities in a one to one relation join on shared primary key values
rather than separate foreign key columns, use the <fo:inline font-family="monospace">
PrimaryKeyJoinColumn(s)</fo:inline> annotation or <fo:inline font-family="monospace">
primary-key-join-column</fo:inline> elements in place of <fo:inline font-family="monospace">JoinColumn(s)
</fo:inline> / <fo:inline font-family="monospace"> join-column</fo:inline> elements.
</fo:block></fo:block><fo:block id="jpa_overview_mapping_assoccoll"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Join Table
</fo:marker><fo:block font-size="17.28pt">12.8.5. 
Join Table
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e11744"><!--
mapping metadata
,
association table collection fields
--></fo:wrapper><fo:wrapper id="d0e11751"><!--
persistent fields
,
join table collections
--></fo:wrapper><fo:wrapper id="d0e11756"><!--
join table
--></fo:wrapper><fo:wrapper id="d0e11759"><!--
one-many
--></fo:wrapper><fo:wrapper id="d0e11764"><!--
many-many
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A <fo:inline font-style="italic">join table</fo:inline> consists of two foreign keys. Each row of a
join table associates two objects together. JPA uses join tables to
represent collections of entity objects: one foreign key refers back to the
collection's owner, and the other refers to a collection element.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:basic-link internal-destination="jpa_overview_meta_onetomany"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">one to many</fo:inline></fo:basic-link> and
<fo:basic-link internal-destination="jpa_overview_meta_manytomany"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">many to many</fo:inline></fo:basic-link> metadata field
types can map to join tables. Several fields in our model use join table
mappings, including <fo:inline font-family="monospace">Magazine.articles</fo:inline> and <fo:inline font-family="monospace">
Article.authors</fo:inline>.
</fo:block><fo:block id="d0e11788"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/jpa-assoc-table.png" width="261px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You define join tables with the <fo:inline font-family="monospace">JoinTable</fo:inline> annotation.
This annotation has the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e11797"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11798"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String name</fo:inline>: Table name. If not given, the name of the table
defaults to the name of the owning entity's table, plus an underscore, plus the
name of the related entity's table.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11804"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String catalog</fo:inline>: Table catalog.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11810"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String schema</fo:inline>: Table schema.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11816"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">JoinColumn[] joinColumns</fo:inline>: Array of <fo:inline font-family="monospace">JoinColumn
</fo:inline> sshowing how to associate join table records with the owning row in
the primary table. This property mirrors the <fo:inline font-family="monospace">pkJoinColumns</fo:inline>
property of the <fo:inline font-family="monospace"> SecondaryTable</fo:inline> annotation in
functionality. See <fo:basic-link internal-destination="jpa_overview_mapping_secondary"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.8.2, “
Secondary Tables
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_secondary"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_secondary"/>]</fo:inline></fo:basic-link> to
refresh your memory on secondary tables.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If this is a bidirectional relation (see
<fo:basic-link internal-destination="jpa_overview_meta_mappedby"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.9.1, “
Bidirectional Relations
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_mappedby"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_mappedby"/>]</fo:inline></fo:basic-link> ), the name of a join column
defaults to the inverse field name, plus an underscore, plus the referenced
primary key column name. Otherwise, the join column name defaults to the field's
owning entity name, plus an underscore, plus the referenced primary key column
name.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11837"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">JoinColumn[] inverseJoinColumns</fo:inline>: Array of <fo:inline font-family="monospace">
JoinColumns</fo:inline> showing how to associate join table records with the
records that form the elements of the collection. These join columns are used
just like the join columns for direct relations, and they have the same naming
defaults. Read <fo:basic-link internal-destination="jpa_overview_mapping_rel"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.8.4, “
Direct Relations
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_rel"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_rel"/>]</fo:inline></fo:basic-link> for a review of
direct relation mapping.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-family="monospace">join-table</fo:inline> is the corresponding XML element. It has the same
attributes as the <fo:inline font-family="monospace">table</fo:inline> element, but includes the ability to
nest <fo:inline font-family="monospace">join-column</fo:inline> and <fo:inline font-family="monospace">inverse-join-column</fo:inline>
elements as children. We have seen <fo:inline font-family="monospace">join-column</fo:inline> elements
already; <fo:inline font-family="monospace">inverse-join-column</fo:inline> elements have the same
attributes.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Here are the join table mappings for the diagram above.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_mapping_assoccollex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.15. 
Join Table Mapping
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e11873">
package org.mag;
@Entity
@Table(name="MAG")
public class Magazine {
@Column(length=9)
@Id private String isbn;
@Id private String title;
@OneToMany(...)
@OrderBy
@JoinTable(name="MAG_ARTS",
joinColumns={
@JoinColumn(name="MAG_ISBN", referencedColumnName="ISBN"),
@JoinColumn(name="MAG_TITLE", referencedColumnName="TITLE")
},
inverseJoinColumns=@JoinColumn(name="ART_ID", referencedColumnName="ID"))
private Collection&lt;Article&gt; articles;
...
}
@Entity
@Table(name="ART")
public class Article {
@Id private long id;
@ManyToMany(cascade=CascadeType.PERSIST)
@OrderBy("lastName, firstName")
@JoinTable(name="ART_AUTHS",
joinColumns=@JoinColumn(name="ART_ID", referencedColumnName="ID"),
inverseJoinColumns=@JoinColumn(name="AUTH_ID", referencedColumnName="AID"))
private Collection&lt;Author&gt; authors;
...
}
package org.mag.pub;
@Entity
@Table(name="AUTH")
public class Author {
@Column(name="AID", columnDefinition="INTEGER64")
@Id private long id;
...
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The same metadata expressed in XML:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e11877">
&lt;entity class="org.mag.Magazine"&gt;
&lt;table name="MAG"/&gt;
&lt;attributes&gt;
&lt;id name="isbn"&gt;
&lt;column length="9"/&gt;
&lt;/id&gt;
&lt;id name="title"/&gt;
&lt;one-to-many name="articles"&gt;
&lt;order-by/&gt;
&lt;join-table name="MAG_ARTS"&gt;
&lt;join-column name="MAG_ISBN" referenced-column-name="ISBN"/&gt;
&lt;join-column name="MAG_TITLE" referenced-column-name="TITLE"/&gt;
&lt;/join-table&gt;
&lt;/one-to-many&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.Article"&gt;
&lt;table name="ART"/&gt;
&lt;attributes&gt;
&lt;id name="id"/&gt;
&lt;many-to-many name="articles"&gt;
&lt;order-by&gt;lastName, firstName&lt;/order-by&gt;
&lt;join-table name="ART_AUTHS"&gt;
&lt;join-column name="ART_ID" referenced-column-name="ID"/&gt;
&lt;inverse-join-column name="AUTH_ID" referenced-column-name="AID"/&gt;
&lt;/join-table&gt;
&lt;/many-to-many&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.pub.Author"&gt;
&lt;table name="AUTH"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;column name="AID" column-definition="INTEGER64"/&gt;
&lt;/id&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_mapping_bidi"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Bidirectional Mapping
</fo:marker><fo:block font-size="17.28pt">12.8.6. 
Bidirectional Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e11882"><!--
bidirectional relations
,
mapping
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:basic-link internal-destination="jpa_overview_meta_mappedby"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.9.1, “
Bidirectional Relations
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_mappedby"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_mappedby"/>]</fo:inline></fo:basic-link> introduced bidirectional
relations. To map a bidirectional relation, you map one field normally using the
annotations we have covered throughout this chapter. Then you use the <fo:inline font-family="monospace">
mappedBy</fo:inline> property of the other field's metadata annotation or the
corresponding <fo:inline font-family="monospace">mapped-by</fo:inline> XML attribute to refer to the mapped
field. Look for this pattern in these bidirectional relations as you peruse the
complete mappings below:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e11897"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11898"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Magazine.publisher</fo:inline> and <fo:inline font-family="monospace">Company.ags</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e11907"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Article.authors</fo:inline> and <fo:inline font-family="monospace">Author.articles</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="jpa_overview_mapping_map"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Map Mapping
</fo:marker><fo:block font-size="17.28pt">12.8.7. 
Map Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e11919"><!--
mapping metadata
,
map fields
--></fo:wrapper><fo:wrapper id="d0e11924"><!--
persistent fields
,
maps
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
All map fields in JPA are modeled on either one to many or many to
many associations. The map key is always derived from an associated entity's
field. Thus map fields use the same mappings as any one to many or many to many
fields, namely dedicated <fo:basic-link internal-destination="jpa_overview_mapping_assoccoll"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">join
tables</fo:inline></fo:basic-link> or <fo:basic-link internal-destination="jpa_overview_mapping_bidi"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">bidirectional
relations</fo:inline></fo:basic-link>. The only additions are the <fo:inline font-family="monospace">MapKey</fo:inline>
annotation and <fo:inline font-family="monospace">map-key</fo:inline> element to declare the key field. We
covered these additions in in <fo:basic-link internal-destination="jpa_overview_meta_mapkey"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.13, “
Map Key
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_mapkey"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_mapkey"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block id="d0e11945"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/jpa-map.png" width="255px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The example below maps <fo:inline font-family="monospace">Subscription</fo:inline>'s map of <fo:inline font-family="monospace">
LineItem</fo:inline>s to the <fo:inline font-family="monospace">SUB_ITEMS</fo:inline> join table. The key
for each map entry is the <fo:inline font-family="monospace"> LineItem</fo:inline>'s <fo:inline font-family="monospace">num
</fo:inline> field value.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_mapping_mapex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.16. 
Join Table Map Mapping
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e11969">
package org.mag.subscribe;
@Entity
@Table(name="SUB", schema="CNTRCT")
public class Subscription {
@OneToMany(cascade={CascadeType.PERSIST,CascadeType.REMOVE})
@MapKey(name="num")
@JoinTable(name="SUB_ITEMS", schema="CNTRCT",
joinColumns=@JoinColumn(name="SUB_ID"),
inverseJoinColumns=@JoinColumn(name="ITEM_ID"))
private Map&lt;Long,LineItem&gt; items;
...
@Entity
@Table(name="LINE_ITEM", schema="CNTRCT")
public static class LineItem
extends Contract {
private long num;
...
}
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The same metadata expressed in XML:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e11973">
&lt;entity class="org.mag.subscribe.Subscription"&gt;
&lt;table name="SUB" schema="CNTRCT"/&gt;
&lt;attributes&gt;
...
&lt;one-to-many name="items"&gt;
&lt;map-key name="num"&gt;
&lt;join-table name="MAG_ARTS"&gt;
&lt;join-column name="MAG_ISBN" referenced-column-name="ISBN"/&gt;
&lt;join-column name="MAG_TITLE" referenced-column-name="TITLE"/&gt;
&lt;/join-table&gt;
&lt;cascade&gt;
&lt;cascade-persist/&gt;
&lt;cascade-remove/&gt;
&lt;/cascade&gt;
&lt;/one-to-many&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.Subscription.LineItem"&gt;
&lt;table name="LINE_ITEM" schema="CNTRCT"/&gt;
&lt;attributes&gt;
...
&lt;basic name="num"/&gt;
...
&lt;/attributes&gt;
&lt;/entity&gt;
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="jpa_overview_mapping_full"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
The Complete Mappings
</fo:marker><fo:block font-size="20.735999999999997pt">12.9. 
The Complete Mappings
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
We began this chapter with the goal of mapping the following object model:
</fo:block><fo:block id="d0e11980"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/jpa-meta-model.png" width="369px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
That goal has now been met. In the course of explaining JPA's object-relational
mapping metadata, we slowly built the requisite schema and mappings for the
complete model. First, the database schema:
</fo:block><fo:block id="d0e11986"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/jpa-data-model.png" width="326px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
And finally, the complete entity mappings. We have trimmed the mappings to take
advantage of JPA defaults where possible.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="jpa_overview_mapping_fullex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.17. 
Full Entity Mappings
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e11995">
package org.mag;
@Entity
@IdClass(Magazine.MagazineId.class)
@Table(name="MAG")
@DiscriminatorValue("Mag")
public class Magazine {
@Column(length=9)
@Id private String isbn;
@Id private String title;
@Column(name="VERS")
@Version private int version;
private String name;
private double price;
@Column(name="COPIES")
private int copiesSold;
@OneToOne(fetch=FetchType.LAZY,
cascade={CascadeType.PERSIST,CascadeType.REMOVE})
@JoinColumn(name="COVER_ID")
private Article coverArticle;
@OneToMany(cascade={CascadeType.PERSIST,CascadeType.REMOVE})
@OrderBy
@JoinTable(name="MAG_ARTS",
joinColumns={
@JoinColumn(name="MAG_ISBN", referencedColumnName="ISBN"),
@JoinColumn(name="MAG_TITLE", referencedColumnName="TITLE")
},
inverseJoinColumns=@JoinColumn(name="ART_ID"))
private Collection&lt;Article&gt; articles;
@ManyToOne(fetch=FetchType.LAZY, cascade=CascadeType.PERSIST)
@JoinColumn(name="PUB_ID")
private Company publisher;
@Transient private byte[] data;
...
public static class MagazineId {
...
}
}
@Entity
@Table(name="ART", uniqueConstraints=@Unique(columnNames="TITLE"))
@SequenceGenerator(name="ArticleSeq", sequenceName="ART_SEQ")
public class Article {
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ArticleSeq")
private long id;
@Column(name="VERS")
@Version private int version;
private String title;
private byte[] content;
@ManyToMany(cascade=CascadeType.PERSIST)
@OrderBy("lastName, firstName")
@JoinTable(name="ART_AUTHS",
joinColumns=@JoinColumn(name="ART_ID"),
inverseJoinColumns=@JoinColumn(name="AUTH_ID"))
private Collection&lt;Author&gt; authors;
...
}
package org.mag.pub;
@Entity
@Table(name="COMP")
public class Company {
@Column(name="CID")
@Id private long id;
@Column(name="VERS")
@Version private int version;
private String name;
@Column(name="REV")
private double revenue;
@Embedded
@AttributeOverrides({
@AttributeOverride(name="street", column=@Column(name="STRT")),
@AttributeOverride(name="city", column=@Column(name="ACITY"))
})
private Address address;
@OneToMany(mappedBy="publisher", cascade=CascadeType.PERSIST)
private Collection&lt;Magazine&gt; mags;
@OneToMany(cascade=CascadeType.PERSIST,CascadeType.REMOVE)
@JoinTable(name="COMP_SUBS",
joinColumns=@JoinColumn(name="COMP_ID"),
inverseJoinColumns=@JoinColumn(name="SUB_ID"))
private Collection&lt;Subscription&gt; subscriptions;
...
}
@Entity
@Table(name="AUTH")
public class Author {
@Id
@GeneratedValue(strategy=GenerationType.TABLE, generator="AuthorGen")
@TableGenerator(name="AuthorGen", tableName="AUTH_GEN", pkColumnName="PK",
valueColumnName="AID")
@Column(name="AID", columnDefinition="INTEGER64")
private long id;
@Column(name="VERS")
@Version private int version;
@Column(name="FNAME")
private String firstName;
@Column(name="LNAME")
private String lastName;
private Address address;
@ManyToMany(mappedBy="authors", cascade=CascadeType.PERSIST)
private Collection&lt;Article&gt; arts;
...
}
@Embeddable
public class Address {
private String street;
private String city;
@Column(columnDefinition="CHAR(2)")
private String state;
private String zip;
}
package org.mag.subscribe;
@MappedSuperclass
public abstract class Document {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private long id;
@Column(name="VERS")
@Version private int version;
...
}
@Entity
@Table(schema="CNTRCT")
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name="CTYPE")
public class Contract
extends Document {
@Lob
private String terms;
...
}
@Entity
@Table(name="SUB", schema="CNTRCT")
@DiscriminatorColumn(name="KIND", discriminatorType=DiscriminatorType.INTEGER)
@DiscriminatorValue("1")
public class Subscription {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private long id;
@Column(name="VERS")
@Version private int version;
@Column(name="START")
private Date startDate;
@Column(name="PAY")
private double payment;
@OneToMany(cascade={CascadeType.PERSIST,CascadeType.REMOVE})
@MapKey(name="num")
@JoinTable(name="SUB_ITEMS", schema="CNTRCT",
joinColumns=@JoinColumn(name="SUB_ID"),
inverseJoinColumns=@JoinColumn(name="ITEM_ID"))
private Map&lt;Long,LineItem&gt; items;
...
@Entity
@Table(name="LINE_ITEM", schema="CNTRCT")
public static class LineItem
extends Contract {
@Column(name="COMM")
private String comments;
private double price;
private long num;
@ManyToOne
@JoinColumns({
@JoinColumn(name="MAG_ISBN", referencedColumnName="ISBN"),
@JoinColumn(name="MAG_TITLE", referencedColumnName="TITLE")
})
private Magazine magazine;
...
}
}
@Entity(name="Lifetime")
@DiscriminatorValue("2")
public class LifetimeSubscription
extends Subscription {
@Basic(fetch=FetchType.LAZY)
@Column(name="ELITE")
private boolean getEliteClub () { ... }
public void setEliteClub (boolean elite) { ... }
...
}
@Entity(name="Trial")
@DiscriminatorValue("3")
public class TrialSubscription
extends Subscription {
@Column(name="END")
public Date getEndDate () { ... }
public void setEndDate (Date end) { ... }
...
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The same metadata expressed in XML form:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e11999">
&lt;entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
version="1.0"&gt;
&lt;mapped-superclass class="org.mag.subscribe.Document"&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;generated-value strategy="IDENTITY"/&gt;
&lt;/id&gt;
&lt;version name="version"&gt;
&lt;column name="VERS"/&gt;
&lt;/version&gt;
&lt;/attributes&gt;
&lt;/mapped-superclass&gt;
&lt;entity class="org.mag.Magazine"&gt;
&lt;table name="MAG"/&gt;
&lt;id-class="org.mag.Magazine.MagazineId"/&gt;
&lt;discriminator-value&gt;Mag&lt;/discriminator-value&gt;
&lt;attributes&gt;
&lt;id name="isbn"&gt;
&lt;column length="9"/&gt;
&lt;/id&gt;
&lt;id name="title"/&gt;
&lt;basic name="name"/&gt;
&lt;basic name="price"/&gt;
&lt;basic name="copiesSold"&gt;
&lt;column name="COPIES"/&gt;
&lt;/basic&gt;
&lt;version name="version"&gt;
&lt;column name="VERS"/&gt;
&lt;/version&gt;
&lt;many-to-one name="publisher" fetch="LAZY"&gt;
&lt;join-column name="PUB_ID"/&gt;
&lt;cascade&gt;
&lt;cascade-persist/&gt;
&lt;/cascade&gt;
&lt;/many-to-one&gt;
&lt;one-to-many name="articles"&gt;
&lt;order-by/&gt;
&lt;join-table name="MAG_ARTS"&gt;
&lt;join-column name="MAG_ISBN" referenced-column-name="ISBN"/&gt;
&lt;join-column name="MAG_TITLE" referenced-column-name="TITLE"/&gt;
&lt;inverse-join-column name="ART_ID"/&gt;
&lt;/join-table&gt;
&lt;cascade&gt;
&lt;cascade-persist/&gt;
&lt;cascade-remove/&gt;
&lt;/cascade&gt;
&lt;/one-to-many&gt;
&lt;one-to-one name="coverArticle" fetch="LAZY"&gt;
&lt;join-column name="COVER_ID"/&gt;
&lt;cascade&gt;
&lt;cascade-persist/&gt;
&lt;cascade-remove/&gt;
&lt;/cascade&gt;
&lt;/one-to-one&gt;
&lt;transient name="data"/&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.Article"&gt;
&lt;table name="ART"&gt;
&lt;unique-constraint&gt;
&lt;column-name&gt;TITLE&lt;/column-name&gt;
&lt;/unique-constraint&gt;
&lt;/table&gt;
&lt;sequence-generator name="ArticleSeq", sequenceName="ART_SEQ"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;generated-value strategy="SEQUENCE" generator="ArticleSeq"/&gt;
&lt;/id&gt;
&lt;basic name="title"/&gt;
&lt;basic name="content"/&gt;
&lt;version name="version"&gt;
&lt;column name="VERS"/&gt;
&lt;/version&gt;
&lt;many-to-many name="articles"&gt;
&lt;order-by&gt;lastName, firstName&lt;/order-by&gt;
&lt;join-table name="ART_AUTHS"&gt;
&lt;join-column name="ART_ID" referenced-column-name="ID"/&gt;
&lt;inverse-join-column name="AUTH_ID" referenced-column-name="AID"/&gt;
&lt;/join-table&gt;
&lt;/many-to-many&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.pub.Company"&gt;
&lt;table name="COMP"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;column name="CID"/&gt;
&lt;/id&gt;
&lt;basic name="name"/&gt;
&lt;basic name="revenue"&gt;
&lt;column name="REV"/&gt;
&lt;/basic&gt;
&lt;version name="version"&gt;
&lt;column name="VERS"/&gt;
&lt;/version&gt;
&lt;one-to-many name="mags" mapped-by="publisher"&gt;
&lt;cascade&gt;
&lt;cascade-persist/&gt;
&lt;/cascade&gt;
&lt;/one-to-many&gt;
&lt;one-to-many name="subscriptions"&gt;
&lt;join-table name="COMP_SUBS"&gt;
&lt;join-column name="COMP_ID"/&gt;
&lt;inverse-join-column name="SUB_ID"/&gt;
&lt;/join-table&gt;
&lt;cascade&gt;
&lt;cascade-persist/&gt;
&lt;cascade-remove/&gt;
&lt;/cascade&gt;
&lt;/one-to-many&gt;
&lt;embedded name="address"&gt;
&lt;attribute-override name="street"&gt;
&lt;column name="STRT"/&gt;
&lt;/attribute-override&gt;
&lt;attribute-override name="city"&gt;
&lt;column name="ACITY"/&gt;
&lt;/attribute-override&gt;
&lt;/embedded&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.pub.Author"&gt;
&lt;table name="AUTH"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;column name="AID" column-definition="INTEGER64"/&gt;
&lt;generated-value strategy="TABLE" generator="AuthorGen"/&gt;
&lt;table-generator name="AuthorGen" table="AUTH_GEN"
pk-column-name="PK" value-column-name="AID"/&gt;
&lt;/id&gt;
&lt;basic name="firstName"&gt;
&lt;column name="FNAME"/&gt;
&lt;/basic&gt;
&lt;basic name="lastName"&gt;
&lt;column name="LNAME"/&gt;
&lt;/basic&gt;
&lt;version name="version"&gt;
&lt;column name="VERS"/&gt;
&lt;/version&gt;
&lt;many-to-many name="arts" mapped-by="authors"&gt;
&lt;cascade&gt;
&lt;cascade-persist/&gt;
&lt;/cascade&gt;
&lt;/many-to-many&gt;
&lt;embedded name="address"/&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subcribe.Contract"&gt;
&lt;table schema="CNTRCT"/&gt;
&lt;inheritance strategy="JOINED"/&gt;
&lt;discriminator-column name="CTYPE"/&gt;
&lt;attributes&gt;
&lt;basic name="terms"&gt;
&lt;lob/&gt;
&lt;/basic&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subcribe.Subscription"&gt;
&lt;table name="SUB" schema="CNTRCT"/&gt;
&lt;inheritance strategy="SINGLE_TABLE"/&gt;
&lt;discriminator-value&gt;1&lt;/discriminator-value&gt;
&lt;discriminator-column name="KIND" discriminator-type="INTEGER"/&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;generated-value strategy="IDENTITY"/&gt;
&lt;/id&gt;
&lt;basic name="payment"&gt;
&lt;column name="PAY"/&gt;
&lt;/basic&gt;
&lt;basic name="startDate"&gt;
&lt;column name="START"/&gt;
&lt;/basic&gt;
&lt;version name="version"&gt;
&lt;column name="VERS"/&gt;
&lt;/version&gt;
&lt;one-to-many name="items"&gt;
&lt;map-key name="num"&gt;
&lt;join-table name="SUB_ITEMS" schema="CNTRCT"&gt;
&lt;join-column name="SUB_ID"/&gt;
&lt;inverse-join-column name="ITEM_ID"/&gt;
&lt;/join-table&gt;
&lt;cascade&gt;
&lt;cascade-persist/&gt;
&lt;cascade-remove/&gt;
&lt;/cascade&gt;
&lt;/one-to-many&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.Subscription.LineItem"&gt;
&lt;table name="LINE_ITEM" schema="CNTRCT"/&gt;
&lt;attributes&gt;
&lt;basic name="comments"&gt;
&lt;column name="COMM"/&gt;
&lt;/basic&gt;
&lt;basic name="price"/&gt;
&lt;basic name="num"/&gt;
&lt;many-to-one name="magazine"&gt;
&lt;join-column name="MAG_ISBN" referenced-column-name="ISBN"/&gt;
&lt;join-column name="MAG_TITLE" referenced-column-name="TITLE"/&gt;
&lt;/many-to-one&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.LifetimeSubscription" name="Lifetime"&gt;
&lt;discriminator-value&gt;2&lt;/discriminator-value&gt;
&lt;attributes&gt;
&lt;basic name="eliteClub" fetch="LAZY"&gt;
&lt;column name="ELITE"/&gt;
&lt;/basic&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;entity class="org.mag.subscribe.TrialSubscription" name="Trial"&gt;
&lt;discriminator-value&gt;3&lt;/discriminator-value&gt;
&lt;attributes&gt;
&lt;basic name="endDate"&gt;
&lt;column name="END"/&gt;
&lt;/basic&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;embeddable class="org.mag.pub.Address"&gt;
&lt;attributes&gt;
&lt;basic name="street"/&gt;
&lt;basic name="city"/&gt;
&lt;basic name="state"&gt;
&lt;column column-definition="CHAR(2)"/&gt;
&lt;/basic&gt;
&lt;basic name="zip"/&gt;
&lt;/attributes&gt;
&lt;/embeddable&gt;
&lt;/entity-mappings&gt;
</fo:block></fo:block></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Conclusion
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Conclusion
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="jpa_overview_conclusion"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 13. 
Conclusion
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This concludes our overview of the JPA specification.
The <fo:basic-link internal-destination="ref_guide_intro"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">OpenJPA Reference Guide</fo:inline></fo:basic-link>
contains detailed documentation on all aspects of the OpenJPA implementation
and core development tools.
</fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="titlepage" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="ref_guide"><fo:block><fo:block><fo:block text-align="center" font-size="24.8832pt" space-before="18.6624pt" font-weight="bold" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always" hyphenate="false">Part 3. Reference Guide</fo:block></fo:block></fo:block></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="lot" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>Reference Guide</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>Reference Guide</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" id="toc...ref_guide"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_intro">1.
Introduction
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_intro"><fo:page-number-citation ref-id="ref_guide_intro"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_intro" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_intro_audience">1.1.
Intended Audience
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_intro_audience"><fo:page-number-citation ref-id="ref_guide_intro_audience"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_conf">2.
Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_conf"><fo:page-number-citation ref-id="ref_guide_conf"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_conf" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_conf_intro">2.1.
Introduction
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_conf_intro"><fo:page-number-citation ref-id="ref_guide_conf_intro"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_conf_specify">2.2.
Runtime Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_conf_specify"><fo:page-number-citation ref-id="ref_guide_conf_specify"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_conf_devtools">2.3.
Command Line Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_conf_devtools"><fo:page-number-citation ref-id="ref_guide_conf_devtools"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_conf_devtools" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_conf_devtools_format">2.3.1.
Code Formatting
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_conf_devtools_format"><fo:page-number-citation ref-id="ref_guide_conf_devtools_format"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_conf_plugins">2.4.
Plugin Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:page-number-citation ref-id="ref_guide_conf_plugins"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_conf_openjpa">2.5.
OpenJPA Properties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_conf_openjpa"><fo:page-number-citation ref-id="ref_guide_conf_openjpa"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_conf_openjpa" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.AutoClear">2.5.1.
openjpa.AutoClear
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.AutoClear"><fo:page-number-citation ref-id="openjpa.AutoClear"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.AutoDetach">2.5.2.
openjpa.AutoDetach
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.AutoDetach"><fo:page-number-citation ref-id="openjpa.AutoDetach"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.BrokerFactory">2.5.3.
openjpa.BrokerFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.BrokerFactory"><fo:page-number-citation ref-id="openjpa.BrokerFactory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.BrokerImpl">2.5.4.
openjpa.BrokerImpl
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.BrokerImpl"><fo:page-number-citation ref-id="openjpa.BrokerImpl"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ClassResolver">2.5.5.
openjpa.ClassResolver
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ClassResolver"><fo:page-number-citation ref-id="openjpa.ClassResolver"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Compatibility">2.5.6.
openjpa.Compatibility
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Compatibility"><fo:page-number-citation ref-id="openjpa.Compatibility"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionDriverName">2.5.7.
openjpa.ConnectionDriverName
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionDriverName"><fo:page-number-citation ref-id="openjpa.ConnectionDriverName"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Connection2DriverName">2.5.8.
openjpa.Connection2DriverName
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Connection2DriverName"><fo:page-number-citation ref-id="openjpa.Connection2DriverName"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionFactory">2.5.9.
openjpa.ConnectionFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionFactory"><fo:page-number-citation ref-id="openjpa.ConnectionFactory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionFactory2">2.5.10.
openjpa.ConnectionFactory2
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionFactory2"><fo:page-number-citation ref-id="openjpa.ConnectionFactory2"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionFactoryName">2.5.11.
openjpa.ConnectionFactoryName
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionFactoryName"><fo:page-number-citation ref-id="openjpa.ConnectionFactoryName"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionFactory2Name">2.5.12.
openjpa.ConnectionFactory2Name
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionFactory2Name"><fo:page-number-citation ref-id="openjpa.ConnectionFactory2Name"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionFactoryMode">2.5.13.
openjpa.ConnectionFactoryMode
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionFactoryMode"><fo:page-number-citation ref-id="openjpa.ConnectionFactoryMode"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionFactoryProperties">2.5.14.
openjpa.ConnectionFactoryProperties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionFactoryProperties"><fo:page-number-citation ref-id="openjpa.ConnectionFactoryProperties"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionFactory2Properties">2.5.15.
openjpa.ConnectionFactory2Properties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionFactory2Properties"><fo:page-number-citation ref-id="openjpa.ConnectionFactory2Properties"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionPassword">2.5.16.
openjpa.ConnectionPassword
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionPassword"><fo:page-number-citation ref-id="openjpa.ConnectionPassword"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Connection2Password">2.5.17.
openjpa.Connection2Password
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Connection2Password"><fo:page-number-citation ref-id="openjpa.Connection2Password"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionProperties">2.5.18.
openjpa.ConnectionProperties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionProperties"><fo:page-number-citation ref-id="openjpa.ConnectionProperties"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Connection2Properties">2.5.19.
openjpa.Connection2Properties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Connection2Properties"><fo:page-number-citation ref-id="openjpa.Connection2Properties"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionURL">2.5.20.
openjpa.ConnectionURL
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionURL"><fo:page-number-citation ref-id="openjpa.ConnectionURL"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Connection2URL">2.5.21.
openjpa.Connection2URL
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Connection2URL"><fo:page-number-citation ref-id="openjpa.Connection2URL"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionUserName">2.5.22.
openjpa.ConnectionUserName
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionUserName"><fo:page-number-citation ref-id="openjpa.ConnectionUserName"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Connection2UserName">2.5.23.
openjpa.Connection2UserName
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Connection2UserName"><fo:page-number-citation ref-id="openjpa.Connection2UserName"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ConnectionRetainMode">2.5.24.
openjpa.ConnectionRetainMode
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ConnectionRetainMode"><fo:page-number-citation ref-id="openjpa.ConnectionRetainMode"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.DataCache">2.5.25.
openjpa.DataCache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.DataCache"><fo:page-number-citation ref-id="openjpa.DataCache"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.DataCacheManager">2.5.26.
openjpa.DataCacheManager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.DataCacheManager"><fo:page-number-citation ref-id="openjpa.DataCacheManager"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.DataCacheTimeout">2.5.27.
openjpa.DataCacheTimeout
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.DataCacheTimeout"><fo:page-number-citation ref-id="openjpa.DataCacheTimeout"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.DetachState">2.5.28.
openjpa.DetachState
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.DetachState"><fo:page-number-citation ref-id="openjpa.DetachState"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.DynamicDataStructs">2.5.29.
openjpa.DynamicDataStructs
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.DynamicDataStructs"><fo:page-number-citation ref-id="openjpa.DynamicDataStructs"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.FetchBatchSize">2.5.30.
openjpa.FetchBatchSize
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.FetchBatchSize"><fo:page-number-citation ref-id="openjpa.FetchBatchSize"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.FetchGroups">2.5.31.
openjpa.FetchGroups
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.FetchGroups"><fo:page-number-citation ref-id="openjpa.FetchGroups"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.FlushBeforeQueries">2.5.32.
openjpa.FlushBeforeQueries
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.FlushBeforeQueries"><fo:page-number-citation ref-id="openjpa.FlushBeforeQueries"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.IgnoreChanges">2.5.33.
openjpa.IgnoreChanges
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.IgnoreChanges"><fo:page-number-citation ref-id="openjpa.IgnoreChanges"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Id">2.5.34. openjpa.Id</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Id"><fo:page-number-citation ref-id="openjpa.Id"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.InverseManager">2.5.35.
openjpa.InverseManager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.InverseManager"><fo:page-number-citation ref-id="openjpa.InverseManager"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.LockManager">2.5.36.
openjpa.LockManager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.LockManager"><fo:page-number-citation ref-id="openjpa.LockManager"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.LockTimeout">2.5.37.
openjpa.LockTimeout
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.LockTimeout"><fo:page-number-citation ref-id="openjpa.LockTimeout"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Log">2.5.38.
openjpa.Log
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Log"><fo:page-number-citation ref-id="openjpa.Log"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ManagedRuntime">2.5.39.
openjpa.ManagedRuntime
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ManagedRuntime"><fo:page-number-citation ref-id="openjpa.ManagedRuntime"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Mapping">2.5.40.
openjpa.Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Mapping"><fo:page-number-citation ref-id="openjpa.Mapping"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.MaxFetchDepth">2.5.41.
openjpa.MaxFetchDepth
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.MaxFetchDepth"><fo:page-number-citation ref-id="openjpa.MaxFetchDepth"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.MetaDataFactory">2.5.42.
openjpa.MetaDataFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.MetaDataFactory"><fo:page-number-citation ref-id="openjpa.MetaDataFactory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Multithreaded">2.5.43.
openjpa.Multithreaded
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Multithreaded"><fo:page-number-citation ref-id="openjpa.Multithreaded"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Optimistic">2.5.44.
openjpa.Optimistic
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Optimistic"><fo:page-number-citation ref-id="openjpa.Optimistic"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.OrphanedKeyAction">2.5.45.
openjpa.OrphanedKeyAction
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.OrphanedKeyAction"><fo:page-number-citation ref-id="openjpa.OrphanedKeyAction"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.NontransactionalRead">2.5.46.
openjpa.NontransactionalRead
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.NontransactionalRead"><fo:page-number-citation ref-id="openjpa.NontransactionalRead"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.NontransactionalWrite">2.5.47.
openjpa.NontransactionalWrite
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.NontransactionalWrite"><fo:page-number-citation ref-id="openjpa.NontransactionalWrite"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ProxyManager">2.5.48.
openjpa.ProxyManager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ProxyManager"><fo:page-number-citation ref-id="openjpa.ProxyManager"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.QueryCache">2.5.49.
openjpa.QueryCache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.QueryCache"><fo:page-number-citation ref-id="openjpa.QueryCache"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.QueryCompilationCache">2.5.50.
openjpa.QueryCompilationCache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.QueryCompilationCache"><fo:page-number-citation ref-id="openjpa.QueryCompilationCache"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.ReadLockLevel">2.5.51.
openjpa.ReadLockLevel
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.ReadLockLevel"><fo:page-number-citation ref-id="openjpa.ReadLockLevel"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.RemoteCommitProvider">2.5.52.
openjpa.RemoteCommitProvider
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.RemoteCommitProvider"><fo:page-number-citation ref-id="openjpa.RemoteCommitProvider"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.RestoreState">2.5.53.
openjpa.RestoreState
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.RestoreState"><fo:page-number-citation ref-id="openjpa.RestoreState"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.RetainState">2.5.54.
openjpa.RetainState
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.RetainState"><fo:page-number-citation ref-id="openjpa.RetainState"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.RetryClassRegistration">2.5.55.
openjpa.RetryClassRegistration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.RetryClassRegistration"><fo:page-number-citation ref-id="openjpa.RetryClassRegistration"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.SavepointManager">2.5.56.
openjpa.SavepointManager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.SavepointManager"><fo:page-number-citation ref-id="openjpa.SavepointManager"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.Sequence">2.5.57.
openjpa.Sequence
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.Sequence"><fo:page-number-citation ref-id="openjpa.Sequence"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.TransactionMode">2.5.58.
openjpa.TransactionMode
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.TransactionMode"><fo:page-number-citation ref-id="openjpa.TransactionMode"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.WriteLockLevel">2.5.59.
openjpa.WriteLockLevel
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.WriteLockLevel"><fo:page-number-citation ref-id="openjpa.WriteLockLevel"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_conf_jdbc">2.6.
OpenJPA JDBC Properties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_conf_jdbc"><fo:page-number-citation ref-id="ref_guide_conf_jdbc"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_conf_jdbc" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.ConnectionDecorators">2.6.1.
openjpa.jdbc.ConnectionDecorators
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.ConnectionDecorators"><fo:page-number-citation ref-id="openjpa.jdbc.ConnectionDecorators"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.DBDictionary">2.6.2.
openjpa.jdbc.DBDictionary
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.DBDictionary"><fo:page-number-citation ref-id="openjpa.jdbc.DBDictionary"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.DriverDataSource">2.6.3.
openjpa.jdbc.DriverDataSource
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.DriverDataSource"><fo:page-number-citation ref-id="openjpa.jdbc.DriverDataSource"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.EagerFetchMode">2.6.4.
openjpa.jdbc.EagerFetchMode
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.EagerFetchMode"><fo:page-number-citation ref-id="openjpa.jdbc.EagerFetchMode"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.FetchDirection">2.6.5.
openjpa.jdbc.FetchDirection
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.FetchDirection"><fo:page-number-citation ref-id="openjpa.jdbc.FetchDirection"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.JDBCListeners">2.6.6.
openjpa.jdbc.JDBCListeners
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.JDBCListeners"><fo:page-number-citation ref-id="openjpa.jdbc.JDBCListeners"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.LRSSize">2.6.7.
openjpa.jdbc.LRSSize
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.LRSSize"><fo:page-number-citation ref-id="openjpa.jdbc.LRSSize"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.MappingDefaults">2.6.8.
openjpa.jdbc.MappingDefaults
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.MappingDefaults"><fo:page-number-citation ref-id="openjpa.jdbc.MappingDefaults"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.MappingFactory">2.6.9.
openjpa.jdbc.MappingFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.MappingFactory"><fo:page-number-citation ref-id="openjpa.jdbc.MappingFactory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.ResultSetType">2.6.10.
openjpa.jdbc.ResultSetType
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.ResultSetType"><fo:page-number-citation ref-id="openjpa.jdbc.ResultSetType"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.Schema">2.6.11.
openjpa.jdbc.Schema
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.Schema"><fo:page-number-citation ref-id="openjpa.jdbc.Schema"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.SchemaFactory">2.6.12.
openjpa.jdbc.SchemaFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.SchemaFactory"><fo:page-number-citation ref-id="openjpa.jdbc.SchemaFactory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.Schemas">2.6.13.
openjpa.jdbc.Schemas
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.Schemas"><fo:page-number-citation ref-id="openjpa.jdbc.Schemas"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.SQLFactory">2.6.14.
openjpa.jdbc.SQLFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.SQLFactory"><fo:page-number-citation ref-id="openjpa.jdbc.SQLFactory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.SubclassFetchMode">2.6.15.
openjpa.jdbc.SubclassFetchMode
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.SubclassFetchMode"><fo:page-number-citation ref-id="openjpa.jdbc.SubclassFetchMode"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.SynchronizeMappings">2.6.16.
openjpa.jdbc.SynchronizeMappings
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.SynchronizeMappings"><fo:page-number-citation ref-id="openjpa.jdbc.SynchronizeMappings"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.TransactionIsolation">2.6.17.
openjpa.jdbc.TransactionIsolation
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.TransactionIsolation"><fo:page-number-citation ref-id="openjpa.jdbc.TransactionIsolation"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="openjpa.jdbc.UpdateManager">2.6.18.
openjpa.jdbc.UpdateManager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="openjpa.jdbc.UpdateManager"><fo:page-number-citation ref-id="openjpa.jdbc.UpdateManager"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging">3.
Logging
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging"><fo:page-number-citation ref-id="ref_guide_logging"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_logging" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_channels">3.1.
Logging Channels
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_channels"><fo:page-number-citation ref-id="ref_guide_logging_channels"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_openjpa">3.2.
OpenJPA Logging
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_openjpa"><fo:page-number-citation ref-id="ref_guide_logging_openjpa"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_noop">3.3.
Disabling Logging
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_noop"><fo:page-number-citation ref-id="ref_guide_logging_noop"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_log4j">3.4.
Log4J
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_log4j"><fo:page-number-citation ref-id="ref_guide_logging_log4j"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_commons">3.5.
Apache Commons Logging
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_commons"><fo:page-number-citation ref-id="ref_guide_logging_commons"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_logging_commons" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_jdk14">3.5.1.
JDK 1.4 java.util.logging
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_jdk14"><fo:page-number-citation ref-id="ref_guide_logging_jdk14"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_logging_custom">3.6.
Custom Log
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_logging_custom"><fo:page-number-citation ref-id="ref_guide_logging_custom"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup">4.
JDBC
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup"><fo:page-number-citation ref-id="ref_guide_dbsetup"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_dbsetup" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_builtin">4.1.
Using the OpenJPA DataSource
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_builtin"><fo:page-number-citation ref-id="ref_guide_dbsetup_builtin"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_thirdparty">4.2.
Using a Third-Party DataSource
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_thirdparty"><fo:page-number-citation ref-id="ref_guide_dbsetup_thirdparty"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_dbsetup_thirdparty" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_thirdparty_enlist">4.2.1.
Managed and XA DataSources
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_thirdparty_enlist"><fo:page-number-citation ref-id="ref_guide_dbsetup_thirdparty_enlist"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_sqlconn">4.3.
Runtime Access to DataSource
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_sqlconn"><fo:page-number-citation ref-id="ref_guide_dbsetup_sqlconn"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_dbsupport">4.4.
Database Support
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_dbsupport"><fo:page-number-citation ref-id="ref_guide_dbsetup_dbsupport"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_dbsetup_dbsupport" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_dbdictprops">4.4.1.
DBDictionary Properties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_dbdictprops"><fo:page-number-citation ref-id="ref_guide_dbsetup_dbdictprops"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_dbsupport_mysql">4.4.2.
MySQLDictionary Properties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_dbsupport_mysql"><fo:page-number-citation ref-id="ref_guide_dbsetup_dbsupport_mysql"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_dbsupport_oracle">4.4.3.
OracleDictionary Properties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_dbsupport_oracle"><fo:page-number-citation ref-id="ref_guide_dbsetup_dbsupport_oracle"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_isolation">4.5.
Setting the Transaction Isolation
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_isolation"><fo:page-number-citation ref-id="ref_guide_dbsetup_isolation"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_sql92">4.6.
Setting the SQL Join Syntax
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_sql92"><fo:page-number-citation ref-id="ref_guide_dbsetup_sql92"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_multidb">4.7.
Accessing Multiple Databases
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_multidb"><fo:page-number-citation ref-id="ref_guide_dbsetup_multidb"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_retain">4.8.
Configuring the Use of JDBC Connections
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_retain"><fo:page-number-citation ref-id="ref_guide_dbsetup_retain"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_dbsetup_lrs">4.9.
Large Result Sets
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_dbsetup_lrs"><fo:page-number-citation ref-id="ref_guide_dbsetup_lrs"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_schema_def">4.10.
Default Schema
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_schema_def"><fo:page-number-citation ref-id="ref_guide_schema_def"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_schema_info">4.11.
Schema Reflection
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_schema_info"><fo:page-number-citation ref-id="ref_guide_schema_info"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_schema_info" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_schema_info_list">4.11.1.
Schemas List
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_schema_info_list"><fo:page-number-citation ref-id="ref_guide_schema_info_list"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_schema_info_factory">4.11.2.
Schema Factory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_schema_info_factory"><fo:page-number-citation ref-id="ref_guide_schema_info_factory"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_schema_schematool">4.12.
Schema Tool
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_schema_schematool"><fo:page-number-citation ref-id="ref_guide_schema_schematool"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_schema_xml">4.13.
XML Schema Format
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_schema_xml"><fo:page-number-citation ref-id="ref_guide_schema_xml"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc">5.
Persistent Classes
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc"><fo:page-number-citation ref-id="ref_guide_pc"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_pc" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_pcclasses">5.1.
Persistent Class List
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_pcclasses"><fo:page-number-citation ref-id="ref_guide_pc_pcclasses"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_enhance">5.2.
Enhancement
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_enhance"><fo:page-number-citation ref-id="ref_guide_pc_enhance"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_pc_enhance" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_enhance_build">5.2.1.
Enhancing at Build Time
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_enhance_build"><fo:page-number-citation ref-id="ref_guide_pc_enhance_build"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_enhance_runtime_container">5.2.2.
Enhancing JPA Entities on Deployment
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_enhance_runtime_container"><fo:page-number-citation ref-id="ref_guide_pc_enhance_runtime_container"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_enhance_runtime">5.2.3.
Enhancing at Runtime
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_enhance_runtime"><fo:page-number-citation ref-id="ref_guide_pc_enhance_runtime"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_enhance_unenhanced_types">5.2.4.
Omitting the OpenJPA enhancer
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_enhance_unenhanced_types"><fo:page-number-citation ref-id="ref_guide_pc_enhance_unenhanced_types"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_oid">5.3.
Object Identity
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_oid"><fo:page-number-citation ref-id="ref_guide_pc_oid"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_pc_oid" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_oid_datastore">5.3.1.
Datastore Identity
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_oid_datastore"><fo:page-number-citation ref-id="ref_guide_pc_oid_datastore"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_oid_entitypk">5.3.2.
Entities as Identity Fields
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_oid_entitypk"><fo:page-number-citation ref-id="ref_guide_pc_oid_entitypk"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_oid_application">5.3.3.
Application Identity Tool
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_oid_application"><fo:page-number-citation ref-id="ref_guide_pc_oid_application"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_oid_pkgen_autoinc">5.3.4.
Autoassign / Identity Strategy Caveats
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_oid_pkgen_autoinc"><fo:page-number-citation ref-id="ref_guide_pc_oid_pkgen_autoinc"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_inverses">5.4.
Managed Inverses
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_inverses"><fo:page-number-citation ref-id="ref_guide_inverses"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_scos">5.5.
Persistent Fields
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_scos"><fo:page-number-citation ref-id="ref_guide_pc_scos"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_pc_scos" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_scos_restore">5.5.1.
Restoring State
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_scos_restore"><fo:page-number-citation ref-id="ref_guide_pc_scos_restore"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_scos_order">5.5.2.
Typing and Ordering
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_scos_order"><fo:page-number-citation ref-id="ref_guide_pc_scos_order"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_calendar_timezone">5.5.3.
Calendar Fields and TimeZones
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_calendar_timezone"><fo:page-number-citation ref-id="ref_guide_pc_calendar_timezone"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_scos_proxy">5.5.4.
Proxies
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_scos_proxy"><fo:page-number-citation ref-id="ref_guide_pc_scos_proxy"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_pc_scos_proxy" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_scos_proxy_smart">5.5.4.1.
Smart Proxies
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_scos_proxy_smart"><fo:page-number-citation ref-id="ref_guide_pc_scos_proxy_smart"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_scos_proxy_lrs">5.5.4.2.
Large Result Set Proxies
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_scos_proxy_lrs"><fo:page-number-citation ref-id="ref_guide_pc_scos_proxy_lrs"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_scos_proxy_custom">5.5.4.3.
Custom Proxies
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_scos_proxy_custom"><fo:page-number-citation ref-id="ref_guide_pc_scos_proxy_custom"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_extern">5.5.5.
Externalization
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_extern"><fo:page-number-citation ref-id="ref_guide_pc_extern"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_pc_extern" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_extern_values">5.5.5.1.
External Values
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_extern_values"><fo:page-number-citation ref-id="ref_guide_pc_extern_values"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_fetch">5.6.
Fetch Groups
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_fetch"><fo:page-number-citation ref-id="ref_guide_fetch"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_fetch" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_fetch_custom">5.6.1.
Custom Fetch Groups
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_fetch_custom"><fo:page-number-citation ref-id="ref_guide_fetch_custom"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_fetch_conf">5.6.2.
Custom Fetch Group Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_fetch_conf"><fo:page-number-citation ref-id="ref_guide_fetch_conf"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_fetch_single_field">5.6.3.
Per-field Fetch Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_fetch_single_field"><fo:page-number-citation ref-id="ref_guide_fetch_single_field"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_fetch_impl">5.6.4.
Implementation Notes
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_fetch_impl"><fo:page-number-citation ref-id="ref_guide_fetch_impl"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_perfpack_eager">5.7.
Eager Fetching
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_perfpack_eager"><fo:page-number-citation ref-id="ref_guide_perfpack_eager"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_perfpack_eager" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_perfpack_eager_conf">5.7.1.
Configuring Eager Fetching
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_perfpack_eager_conf"><fo:page-number-citation ref-id="ref_guide_perfpack_eager_conf"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_perfpack_eager_consider">5.7.2.
Eager Fetching Considerations and Limitations
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_perfpack_eager_consider"><fo:page-number-citation ref-id="ref_guide_perfpack_eager_consider"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta">6.
Metadata
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta"><fo:page-number-citation ref-id="ref_guide_meta"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_meta" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_factory">6.1.
Metadata Factory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_factory"><fo:page-number-citation ref-id="ref_guide_meta_factory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_jpa">6.2.
Additional JPA Metadata
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_jpa"><fo:page-number-citation ref-id="ref_guide_meta_jpa"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_meta_jpa" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_jpa_datastoreid">6.2.1.
Datastore Identity
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_jpa_datastoreid"><fo:page-number-citation ref-id="ref_guide_meta_jpa_datastoreid"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_jpa_version">6.2.2.
Surrogate Version
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_jpa_version"><fo:page-number-citation ref-id="ref_guide_meta_jpa_version"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_jpa_persistent">6.2.3.
Persistent Field Values
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_jpa_persistent"><fo:page-number-citation ref-id="ref_guide_meta_jpa_persistent"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_jpa_persistent_coll">6.2.4. Persistent Collection Fields</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_jpa_persistent_coll"><fo:page-number-citation ref-id="ref_guide_meta_jpa_persistent_coll"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_jpa_persistent_map">6.2.5. Persistent Map Fields</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_jpa_persistent_map"><fo:page-number-citation ref-id="ref_guide_meta_jpa_persistent_map"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_ext">6.3.
Metadata Extensions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_ext"><fo:page-number-citation ref-id="ref_guide_meta_ext"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_meta_ext" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_class">6.3.1.
Class Extensions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_class"><fo:page-number-citation ref-id="ref_guide_meta_class"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_meta_class" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="fetch-groups">6.3.1.1.
Fetch Groups
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="fetch-groups"><fo:page-number-citation ref-id="fetch-groups"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="data-cache">6.3.1.2.
Data Cache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="data-cache"><fo:page-number-citation ref-id="data-cache"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="detached-state-field">6.3.1.3.
Detached State
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="detached-state-field"><fo:page-number-citation ref-id="detached-state-field"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_field">6.3.2.
Field Extensions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_field"><fo:page-number-citation ref-id="ref_guide_meta_field"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_meta_field" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="dependent">6.3.2.1.
Dependent
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="dependent"><fo:page-number-citation ref-id="dependent"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="load-fetch-group">6.3.2.2.
Load Fetch Group
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="load-fetch-group"><fo:page-number-citation ref-id="load-fetch-group"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="lrs">6.3.2.3.
LRS
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="lrs"><fo:page-number-citation ref-id="lrs"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="inverse-logical">6.3.2.4.
Inverse-Logical
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="inverse-logical"><fo:page-number-citation ref-id="inverse-logical"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="read-only">6.3.2.5.
Read-Only
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="read-only"><fo:page-number-citation ref-id="read-only"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="type">6.3.2.6.
Type
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="type"><fo:page-number-citation ref-id="type"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="externalizer">6.3.2.7.
Externalizer
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="externalizer"><fo:page-number-citation ref-id="externalizer"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="factory">6.3.2.8.
Factory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="factory"><fo:page-number-citation ref-id="factory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="external-values">6.3.2.9.
External Values
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="external-values"><fo:page-number-citation ref-id="external-values"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_meta_example">6.3.3.
Example
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_meta_example"><fo:page-number-citation ref-id="ref_guide_meta_example"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping">7.
Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping"><fo:page-number-citation ref-id="ref_guide_mapping"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_mapping" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_mappingtool">7.1.
Forward Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_mappingtool"><fo:page-number-citation ref-id="ref_guide_mapping_mappingtool"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_mapping_mappingtool" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_mappingtool_examples">7.1.1.
Using the Mapping Tool
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_mappingtool_examples"><fo:page-number-citation ref-id="ref_guide_mapping_mappingtool_examples"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_ddl_examples">7.1.2.
Generating DDL SQL
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_ddl_examples"><fo:page-number-citation ref-id="ref_guide_ddl_examples"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_synch">7.1.3.
Runtime Forward Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_synch"><fo:page-number-citation ref-id="ref_guide_mapping_synch"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_reverse">7.2.
Reverse Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_reverse"><fo:page-number-citation ref-id="ref_guide_pc_reverse"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_pc_reverse" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_pc_reverse_custom">7.2.1.
Customizing Reverse Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_pc_reverse_custom"><fo:page-number-citation ref-id="ref_guide_pc_reverse_custom"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_middle">7.3.
Meet-in-the-Middle Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_middle"><fo:page-number-citation ref-id="ref_guide_mapping_middle"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_defaults">7.4.
Mapping Defaults
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_defaults"><fo:page-number-citation ref-id="ref_guide_mapping_defaults"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_factory">7.5.
Mapping Factory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_factory"><fo:page-number-citation ref-id="ref_guide_mapping_factory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_notes_nonstdjoins">7.6.
Non-Standard Joins
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_notes_nonstdjoins"><fo:page-number-citation ref-id="ref_guide_mapping_notes_nonstdjoins"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa">7.7.
Additional JPA Mappings
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa"><fo:page-number-citation ref-id="ref_guide_mapping_jpa"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_mapping_jpa" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_datastoreid">7.7.1.
Datastore Identity Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_datastoreid"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_datastoreid"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_version">7.7.2.
Surrogate Version Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_version"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_version"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_columns">7.7.3.
Multi-Column Mappings
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_columns"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_columns"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_fieldjoin">7.7.4.
Join Column Attribute Targets
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_fieldjoin"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_fieldjoin"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_embed">7.7.5.
Embedded Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_embed"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_embed"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_coll">7.7.6.
Collections
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_coll"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_coll"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_mapping_jpa_coll" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_coll_table">7.7.6.1.
Container Table
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_coll_table"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_coll_table"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_coll_joincols">7.7.6.2.
Element Join Columns
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_coll_joincols"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_coll_joincols"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_coll_order">7.7.6.3.
Order Column
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_coll_order"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_coll_order"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_onemany">7.7.7.
One-Sided One-Many Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_onemany"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_onemany"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_map">7.7.8.
Maps
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_map"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_map"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_constraints">7.7.9.
Indexes and Constraints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_constraints"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_constraints"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_mapping_jpa_constraints" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_index">7.7.9.1.
Indexes
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_index"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_index"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_fk">7.7.9.2.
Foreign Keys
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_fk"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_fk"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_jpa_unique">7.7.9.3.
Unique Constraints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_jpa_unique"><fo:page-number-citation ref-id="ref_guide_mapping_jpa_unique"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_xmlmapping">7.7.10.
XML Column Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_xmlmapping"><fo:page-number-citation ref-id="ref_guide_xmlmapping"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_limits">7.8.
Mapping Limitations
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_limits"><fo:page-number-citation ref-id="ref_guide_mapping_limits"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_mapping_limits" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_limits_tpc">7.8.1.
Table Per Class
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_limits_tpc"><fo:page-number-citation ref-id="ref_guide_mapping_limits_tpc"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_ext">7.9.
Mapping Extensions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_ext"><fo:page-number-citation ref-id="ref_guide_mapping_ext"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_mapping_ext" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_ext_cls">7.9.1.
Class Extensions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_ext_cls"><fo:page-number-citation ref-id="ref_guide_mapping_ext_cls"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_mapping_ext_cls" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="subclass-fetch-mode">7.9.1.1.
Subclass Fetch Mode
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="subclass-fetch-mode"><fo:page-number-citation ref-id="subclass-fetch-mode"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="class-strategy">7.9.1.2.
Strategy
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="class-strategy"><fo:page-number-citation ref-id="class-strategy"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="discriminator-strategy">7.9.1.3.
Discriminator Strategy
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="discriminator-strategy"><fo:page-number-citation ref-id="discriminator-strategy"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="version-strategy">7.9.1.4.
Version Strategy
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="version-strategy"><fo:page-number-citation ref-id="version-strategy"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_ext_field">7.9.2.
Field Extensions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_ext_field"><fo:page-number-citation ref-id="ref_guide_mapping_ext_field"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_mapping_ext_field" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="eager-fetch-mode">7.9.2.1.
Eager Fetch Mode
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="eager-fetch-mode"><fo:page-number-citation ref-id="eager-fetch-mode"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="nonpolymorphic">7.9.2.2.
Nonpolymorphic
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="nonpolymorphic"><fo:page-number-citation ref-id="nonpolymorphic"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="class-criteria">7.9.2.3.
Class Criteria
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="class-criteria"><fo:page-number-citation ref-id="class-criteria"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="strategy">7.9.2.4.
Strategy
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="strategy"><fo:page-number-citation ref-id="strategy"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_custom">7.10.
Custom Mappings
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_custom"><fo:page-number-citation ref-id="ref_guide_mapping_custom"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_mapping_custom" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_custom_class">7.10.1.
Custom Class Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_custom_class"><fo:page-number-citation ref-id="ref_guide_mapping_custom_class"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_custom_versdiscrim">7.10.2.
Custom Discriminator and Version Strategies
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_custom_versdiscrim"><fo:page-number-citation ref-id="ref_guide_mapping_custom_versdiscrim"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_custom_field">7.10.3.
Custom Field Mapping
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_custom_field"><fo:page-number-citation ref-id="ref_guide_mapping_custom_field"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_mapping_custom_field" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_custom_vhandler">7.10.3.1.
Value Handlers
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_custom_vhandler"><fo:page-number-citation ref-id="ref_guide_mapping_custom_vhandler"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_custom_fieldstrat">7.10.3.2.
Field Strategies
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_custom_fieldstrat"><fo:page-number-citation ref-id="ref_guide_mapping_custom_fieldstrat"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_mapping_custom_field_conf">7.10.3.3.
Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_mapping_custom_field_conf"><fo:page-number-citation ref-id="ref_guide_mapping_custom_field_conf"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_orphan">7.11.
Orphaned Keys
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_orphan"><fo:page-number-citation ref-id="ref_guide_orphan"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_deploy">8.
Deployment
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_deploy"><fo:page-number-citation ref-id="ref_guide_deploy"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_deploy" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_deploy_factory">8.1.
Factory Deployment
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_deploy_factory"><fo:page-number-citation ref-id="ref_guide_deploy_factory"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_deploy_factory" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_deploy_factory_standalone">8.1.1.
Standalone Deployment
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_deploy_factory_standalone"><fo:page-number-citation ref-id="ref_guide_deploy_factory_standalone"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_deploy_inject">8.1.2.
EntityManager Injection
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_deploy_inject"><fo:page-number-citation ref-id="ref_guide_deploy_inject"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_enterprise_trans">8.2.
Integrating with the Transaction Manager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_enterprise_trans"><fo:page-number-citation ref-id="ref_guide_enterprise_trans"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_enterprise_xa">8.3.
XA Transactions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_enterprise_xa"><fo:page-number-citation ref-id="ref_guide_enterprise_xa"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_enterprise_xa" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_enterprise_xa_req">8.3.1.
Using OpenJPA with XA Transactions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_enterprise_xa_req"><fo:page-number-citation ref-id="ref_guide_enterprise_xa_req"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime">9.
Runtime Extensions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime"><fo:page-number-citation ref-id="ref_guide_runtime"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_runtime" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_arch">9.1.
Architecture
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_arch"><fo:page-number-citation ref-id="ref_guide_runtime_arch"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_runtime_arch" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_broker_finalization">9.1.1.
Broker Finalization
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_broker_finalization"><fo:page-number-citation ref-id="ref_guide_runtime_broker_finalization"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_broker_extension">9.1.2.
Broker Customization and Finalization
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_broker_extension"><fo:page-number-citation ref-id="ref_guide_runtime_broker_extension"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_jpa">9.2.
JPA Extensions
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_jpa"><fo:page-number-citation ref-id="ref_guide_runtime_jpa"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_runtime_jpa" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_emfactory">9.2.1.
OpenJPAEntityManagerFactory
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_emfactory"><fo:page-number-citation ref-id="ref_guide_runtime_emfactory"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_em">9.2.2.
OpenJPAEntityManager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_em"><fo:page-number-citation ref-id="ref_guide_runtime_em"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_jpaquery">9.2.3.
OpenJPAQuery
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_jpaquery"><fo:page-number-citation ref-id="ref_guide_runtime_jpaquery"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_jpaextent">9.2.4.
Extent
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_jpaextent"><fo:page-number-citation ref-id="ref_guide_runtime_jpaextent"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_jpacache">9.2.5.
StoreCache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_jpacache"><fo:page-number-citation ref-id="ref_guide_runtime_jpacache"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_jpaquerycache">9.2.6.
QueryResultCache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_jpaquerycache"><fo:page-number-citation ref-id="ref_guide_runtime_jpaquerycache"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_jpafetch">9.2.7.
FetchPlan
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_jpafetch"><fo:page-number-citation ref-id="ref_guide_runtime_jpafetch"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_openjpapersistence">9.2.8.
OpenJPAPersistence
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_openjpapersistence"><fo:page-number-citation ref-id="ref_guide_runtime_openjpapersistence"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_locking">9.3.
Object Locking
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_locking"><fo:page-number-citation ref-id="ref_guide_locking"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_locking" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_locking_default">9.3.1.
Configuring Default Locking
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_locking_default"><fo:page-number-citation ref-id="ref_guide_locking_default"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_locking_runtime">9.3.2.
Configuring Lock Levels at Runtime
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_locking_runtime"><fo:page-number-citation ref-id="ref_guide_locking_runtime"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_locking_apis">9.3.3.
Object Locking APIs
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_locking_apis"><fo:page-number-citation ref-id="ref_guide_locking_apis"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_locking_lockmgr">9.3.4.
Lock Manager
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_locking_lockmgr"><fo:page-number-citation ref-id="ref_guide_locking_lockmgr"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_locking_rules">9.3.5.
Rules for Locking Behavior
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_locking_rules"><fo:page-number-citation ref-id="ref_guide_locking_rules"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_locking_issues">9.3.6.
Known Issues and Limitations
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_locking_issues"><fo:page-number-citation ref-id="ref_guide_locking_issues"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_savepoints">9.4.
Savepoints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_savepoints"><fo:page-number-citation ref-id="ref_guide_savepoints"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_savepoints" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="reg_guide_savepoints_using">9.4.1.
Using Savepoints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="reg_guide_savepoints_using"><fo:page-number-citation ref-id="reg_guide_savepoints_using"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_savepoints_conf">9.4.2.
Configuring Savepoints
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_savepoints_conf"><fo:page-number-citation ref-id="ref_guide_savepoints_conf"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_enterprise_methodql">9.5.
MethodQL
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_enterprise_methodql"><fo:page-number-citation ref-id="ref_guide_enterprise_methodql"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_sequence">9.6.
Generators
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_sequence"><fo:page-number-citation ref-id="ref_guide_sequence"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_sequence" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_sequence_runtime">9.6.1.
Runtime Access
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_sequence_runtime"><fo:page-number-citation ref-id="ref_guide_sequence_runtime"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_runtime_pm_event">9.7.
Transaction Events
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_runtime_pm_event"><fo:page-number-citation ref-id="ref_guide_runtime_pm_event"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_enterprise_abstractstore">9.8.
Non-Relational Stores
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_enterprise_abstractstore"><fo:page-number-citation ref-id="ref_guide_enterprise_abstractstore"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_caching">10.
Caching
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_caching"><fo:page-number-citation ref-id="ref_guide_caching"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_caching" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache">10.1.
Data Cache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache"><fo:page-number-citation ref-id="ref_guide_cache"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_cache" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_conf">10.1.1.
Data Cache Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_conf"><fo:page-number-citation ref-id="ref_guide_cache_conf"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_use">10.1.2.
Data Cache Usage
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_use"><fo:page-number-citation ref-id="ref_guide_cache_use"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_query">10.1.3.
Query Cache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_query"><fo:page-number-citation ref-id="ref_guide_cache_query"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_extension">10.1.4.
Cache Extension
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_extension"><fo:page-number-citation ref-id="ref_guide_cache_extension"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_notes">10.1.5.
Important Notes
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_notes"><fo:page-number-citation ref-id="ref_guide_cache_notes"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="datastore_cache_issues">10.1.6.
Known Issues and Limitations
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="datastore_cache_issues"><fo:page-number-citation ref-id="datastore_cache_issues"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_cache_querycomp">10.2.
Query Compilation Cache
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_cache_querycomp"><fo:page-number-citation ref-id="ref_guide_cache_querycomp"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_remote">11.
Remote and Offline Operation
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_remote"><fo:page-number-citation ref-id="ref_guide_remote"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_remote" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_detach">11.1.
Detach and Attach
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_detach"><fo:page-number-citation ref-id="ref_guide_detach"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_detach" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_detach_behavior">11.1.1.
Detach Behavior
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_detach_behavior"><fo:page-number-citation ref-id="ref_guide_detach_behavior"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_attach_behavior">11.1.2.
Attach Behavior
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_attach_behavior"><fo:page-number-citation ref-id="ref_guide_attach_behavior"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_detach_graph">11.1.3.
Defining the Detached Object Graph
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_detach_graph"><fo:page-number-citation ref-id="ref_guide_detach_graph"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_detach_graph" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_detach_field">11.1.3.1.
Detached State Field
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_detach_field"><fo:page-number-citation ref-id="ref_guide_detach_field"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_event">11.2.
Remote Event Notification Framework
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_event"><fo:page-number-citation ref-id="ref_guide_event"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_event" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_event_conf">11.2.1.
Remote Commit Provider Configuration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_event_conf"><fo:page-number-citation ref-id="ref_guide_event_conf"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_event_conf" margin-left="72pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_event_conf_jms">11.2.1.1.
JMS
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_event_conf_jms"><fo:page-number-citation ref-id="ref_guide_event_conf_jms"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_event_conf_tcp">11.2.1.2.
TCP
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_event_conf_tcp"><fo:page-number-citation ref-id="ref_guide_event_conf_tcp"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_event_conf_common">11.2.1.3.
Common Properties
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_event_conf_common"><fo:page-number-citation ref-id="ref_guide_event_conf_common"/></fo:basic-link></fo:inline></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_event_customization">11.2.2.
Customization
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_event_customization"><fo:page-number-citation ref-id="ref_guide_event_customization"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration">12.
Third Party Integration
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration"><fo:page-number-citation ref-id="ref_guide_integration"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_integration" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_ant">12.1.
Apache Ant
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_ant"><fo:page-number-citation ref-id="ref_guide_integration_ant"/></fo:basic-link></fo:inline></fo:block><fo:block id="toc.ref_guide.ref_guide_integration_ant" margin-left="48pt"><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_conf">12.1.1.
Common Ant Configuration Options
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_conf"><fo:page-number-citation ref-id="ref_guide_integration_conf"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_enhance">12.1.2.
Enhancer Ant Task
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_enhance"><fo:page-number-citation ref-id="ref_guide_integration_enhance"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_appidtool">12.1.3.
Application Identity Tool Ant Task
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_appidtool"><fo:page-number-citation ref-id="ref_guide_integration_appidtool"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_mappingtool">12.1.4.
Mapping Tool Ant Task
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_mappingtool"><fo:page-number-citation ref-id="ref_guide_integration_mappingtool"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_revmappingtool">12.1.5.
Reverse Mapping Tool Ant Task
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_revmappingtool"><fo:page-number-citation ref-id="ref_guide_integration_revmappingtool"/></fo:basic-link></fo:inline></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_integration_schematool">12.1.6.
Schema Tool Ant Task
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_integration_schematool"><fo:page-number-citation ref-id="ref_guide_integration_schematool"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:block><fo:block text-align-last="justify" text-align="start" end-indent="24pt" last-line-end-indent="-24pt"><fo:inline keep-with-next.within-line="always"><fo:basic-link internal-destination="ref_guide_optimization">13.
Optimization Guidelines
</fo:basic-link></fo:inline><fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <fo:basic-link internal-destination="ref_guide_optimization"><fo:page-number-citation ref-id="ref_guide_optimization"/></fo:basic-link></fo:inline></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Introduction
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Introduction
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="ref_guide_intro"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 1. 
Introduction
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA is a JDBC-based implementation of the JPA standard.
This document is a reference for the configuration and use of OpenJPA.
</fo:block><fo:block id="ref_guide_intro_audience"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Intended Audience
</fo:marker><fo:block font-size="20.735999999999997pt">1.1. 
Intended Audience
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This document is intended for OpenJPA developers. It
assumes strong knowledge of Java, familiarity with the eXtensible Markup
Language (XML), and an understanding of JPA. If you are not familiar with JPA,
please read the <fo:basic-link internal-destination="jpa_overview_intro"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">JPA Overview</fo:inline></fo:basic-link> before
proceeding.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Certain sections of this guide cover advanced topics such as custom
object-relational mapping, enterprise integration, and using OpenJPA with
third-party tools. These sections assume prior experience with the relevant
subject.
</fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Configuration
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Configuration
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="ref_guide_conf"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 2. 
Configuration
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e12038"><!--
configuration
--></fo:wrapper><fo:block id="ref_guide_conf_intro"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Introduction
</fo:marker><fo:block font-size="20.735999999999997pt">2.1. 
Introduction
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This chapter describes the OpenJPA configuration framework. It concludes with
descriptions of all the configuration properties recognized by OpenJPA. You may
want to browse these properties now, but it is not necessary. Most of them will
be referenced later in the documentation as we explain the various features they
apply to.
</fo:block></fo:block><fo:block id="ref_guide_conf_specify"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Runtime Configuration
</fo:marker><fo:block font-size="20.735999999999997pt">2.2. 
Runtime Configuration
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e12049"><!--
configuration
,
runtime
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The OpenJPA runtime includes a comprehensive system of configuration defaults
and overrides:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e12056"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e12057"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e12060"><!--
openjpa.xml
--></fo:wrapper>
OpenJPA first looks for an optional <fo:inline font-family="monospace">openjpa.xml</fo:inline> resource.
OpenJPA searches for this resource in each top-level directory of your <fo:inline font-family="monospace">
CLASSPATH</fo:inline>. OpenJPA will also find the resource if you place it within
a <fo:inline font-family="monospace">META-INF</fo:inline> directory in any top-level directory of the
<fo:inline font-family="monospace">CLASSPATH</fo:inline>. The <fo:inline font-family="monospace">openjpa.xml</fo:inline> resource
contains property settings in <fo:basic-link internal-destination="jpa_overview_persistence_xml"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">
JPA's XML format</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e12082"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
You can customize the name or location of the above resource by specifying the
correct resource path in the <fo:inline font-family="monospace">openjpa.properties</fo:inline> System
property.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e12088"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
You can override any value defined in the above resource by setting the System
property of the same name to the desired value.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e12091"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e12094"><!--
Persistence
,
createEntityManagerFactory
--></fo:wrapper>
In JPA, the values in the standard <fo:inline font-family="monospace"> META-INF/persistence.xml
</fo:inline> bootstrapping file used by the
<fo:basic-link internal-destination="jpa_overview_persistence"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">Persistence</fo:inline>
</fo:inline></fo:basic-link> class at runtime override the values in the above resource, as well as
any System property settings. The <fo:inline font-family="monospace">Map</fo:inline> passed to
<fo:inline font-family="monospace">Persistence.createEntityManagerFactory</fo:inline> at runtime also
overrides previous settings, including properties defined in <fo:inline font-family="monospace">
persistence.xml</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e12117"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
When using JCA deployment the <fo:inline font-family="monospace">config-property</fo:inline> values in your
<fo:inline font-family="monospace">ra.xml</fo:inline> file override other settings.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e12126"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
All OpenJPA command-line tools accept flags that allow you to specify the
configuration resource to use, and to override any property.
<fo:basic-link internal-destination="ref_guide_conf_devtools"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.3, “
Command Line Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_devtools"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_devtools"/>]</fo:inline></fo:basic-link> describes these flags.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e12131"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Internally, the OpenJPA runtime environment and development
tools manipulate property settings through a general
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/ResultObjectProvider/lib/conf/Configuration.html">
<fo:inline font-family="monospace">Configuration</fo:inline></fo:basic-link> interface, and in particular its
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html">
<fo:inline font-family="monospace">OpenJPAConfiguration</fo:inline></fo:basic-link> and
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html">
<fo:inline font-family="monospace">JDBCConfiguration</fo:inline></fo:basic-link> subclasses. For advanced
customization, OpenJPA's extended runtime interfaces and its development tools
allow you to access these interfaces directly. See the <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc">
Javadoc</fo:basic-link> for details.
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_conf_devtools"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Command Line Configuration
</fo:marker><fo:block font-size="20.735999999999997pt">2.3. 
Command Line Configuration
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e12155"><!--
configuration
,
command line
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA development tools share the same set of configuration defaults and
overrides as the runtime system. They also allow you to specify property values
on the command line:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e12162"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e12163"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-properties/-p &lt;configuration file or resource&gt;</fo:inline>: Use
the <fo:inline font-family="monospace">-properties</fo:inline> flag, or its shorter <fo:inline font-family="monospace">-p</fo:inline>
form, to specify a configuration file to use. Note that OpenJPA always searches
the default file locations described above, so this flag is only needed when you
do not have a default resource in place, or when you wish to override the
defaults. The given value can be the path to a file, or the resource name of a
file somewhere in the <fo:inline font-family="monospace">CLASSPATH</fo:inline>. OpenJPA will search the
given location as well as the location prefixed by <fo:inline font-family="monospace"> META-INF/
</fo:inline>. Thus, to point a OpenJPA tool at <fo:inline font-family="monospace">
META-INF/my-persistence.xml</fo:inline>, you can use:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e12184">
&lt;tool&gt; -p my-persistence.xml
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e12186"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-&lt;property name&gt; &lt;property value&gt;</fo:inline>: Any
configuration property that you can specify in a configuration file can be
overridden with a command line flag. The flag name is always the last token of
the corresponding property name, with the first letter in either upper or lower
case. For example, to override the <fo:inline font-family="monospace">openjpa.ConnectionUserName</fo:inline>
property, you could pass the <fo:inline font-family="monospace">-connectionUserName &lt;value&gt;
</fo:inline> flag to any tool. Values set this way override both the values in the
configuration file and values set via System properties.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block id="ref_guide_conf_devtools_format"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Code Formatting
</fo:marker><fo:block font-size="17.28pt">2.3.1. 
Code Formatting
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e12201"><!--
code formatting
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Some OpenJPA development tools generate Java code. These tools share a common
set of command-line flags for formatting their output to match your coding
style. All code formatting flags can begin with either the <fo:inline font-family="monospace">codeFormat
</fo:inline> or <fo:inline font-family="monospace">cf</fo:inline> prefix.
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e12212"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e12213"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-codeFormat./-cf.tabSpaces &lt;spaces&gt;</fo:inline>: The number of
spaces that make up a tab, or 0 to use tab characters. Defaults to using tab
characters.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e12219"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-codeFormat./-cf.spaceBeforeParen &lt;true/t | false/f&gt;</fo:inline>:
Whether or not to place a space before opening parentheses on method calls, if
statements, loops, etc. Defaults to <fo:inline font-family="monospace">false</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e12228"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-codeFormat./-cf.spaceInParen &lt;true/t | false/f&gt;</fo:inline>:
Whether or not to place a space within parentheses; i.e. <fo:inline font-family="monospace">method( arg)
</fo:inline>. Defaults to <fo:inline font-family="monospace">false</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e12240"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-codeFormat./-cf.braceOnSameLine &lt;true/t | false/f&gt;</fo:inline>:
Whether or not to place opening braces on the same line as the declaration that
begins the code block, or on the next line. Defaults to <fo:inline font-family="monospace">true</fo:inline>
.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e12249"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-codeFormat./-cf.braceAtSameTabLevel &lt;true/t | false/f&gt;</fo:inline>
: When the <fo:inline font-family="monospace">braceOnSameLine</fo:inline> option is disabled, you can choose
whether to place the brace at the same tab level of the contained code. Defaults
to <fo:inline font-family="monospace">false</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e12261"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-codeFormat./-cf.scoreBeforeFieldName &lt;true/t | false/f&gt;
</fo:inline>: Whether to prefix an underscore to names of private member
variables. Defaults to <fo:inline font-family="monospace">false</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e12270"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-codeFormat./-cf.linesBetweenSections &lt;lines&gt;</fo:inline>: The
number of lines to skip between sections of code. Defaults to 1.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_conf_devtools_format_ex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.1. 
Code Formatting with the Application Id Tool
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e12279">
java org.apache.openjpa.enhance.ApplicationIdTool -cf.spaceBeforeParen true -cf.tabSpaces 4
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_conf_plugins"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Plugin Configuration
</fo:marker><fo:block font-size="20.735999999999997pt">2.4. 
Plugin Configuration
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e12284"><!--
configuration
,
plugins
--></fo:wrapper><fo:wrapper id="d0e12289"><!--
plugins
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Because OpenJPA is a highly customizable environment, many configuration
properties relate to the creation and configuration of system plugins. Plugin
properties have a syntax very similar to that of Java 5 annotations. They allow
you to specify both what class to use for the plugin and how to configure the
public fields or bean properties of the instantiated plugin instance. The
easiest way to describe the plugin syntax is by example:
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA has a pluggable L2 caching mechanism that is controlled by the <fo:inline font-family="monospace">
openjpa.DataCache</fo:inline> configuration property. Suppose that you have
created a new class, <fo:inline font-family="monospace">com.xyz.MyDataCache</fo:inline>, that you want
OpenJPA to use for caching. You've made instances of <fo:inline font-family="monospace">MyDataCache
</fo:inline> configurable via two methods, <fo:inline font-family="monospace">setCacheSize(int size)
</fo:inline> and <fo:inline font-family="monospace">setRemoteHost(String host)</fo:inline>. The
sample below shows how you would tell OpenJPA to use an instance of your custom
plugin with a max size of 1000 and a remote host of <fo:inline font-family="monospace">cacheserver
</fo:inline>.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e12316">
&lt;property name="openjpa.DataCache"
value="com.xyz.MyDataCache(CacheSize=1000, RemoteHost=cacheserver)"/&gt;
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
As you can see, plugin properties take a class name, followed by a
comma-separated list of values for the plugin's public fields or bean properties
in parentheses. OpenJPA will match each named property to a field or setter
method in the instantiated plugin instance, and set the field or invoke the
method with the given value (after converting the value to the right type, of
course). The first letter of the property names can be in either upper or lower
case. The following would also have been valid:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e12320">
com.xyz.MyDataCache(cacheSize=1000, remoteHost=cacheserver)
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If you do not need to pass any property settings to a plugin, you can just name
the class to use:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e12324">
com.xyz.MyDataCache
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Similarly, if the plugin has a default class that you do not want to change, you
can simply specify a list of property settings, without a class name. For
example, OpenJPA's query cache companion to the data cache has a default
implementation suitable to most users, but you still might want to change the
query cache's size. It has a <fo:inline font-family="monospace">CacheSize</fo:inline> property for this
purpose:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e12331">
CacheSize=1000
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Finally, many of OpenJPA's built-in options for plugins have short alias names
that you can use in place of the full class name. The data cache property, for
example, has an available alias of <fo:inline font-family="monospace">true</fo:inline> for the standard
cache implementation. The property value simply becomes:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e12338">
true
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The standard cache implementation class also has a <fo:inline font-family="monospace">CacheSize</fo:inline>
property, so to use the standard implementation and configure the size, specify:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e12345">
true(CacheSize=1000)
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The remainder of this chapter reviews the set of configuration properties
OpenJPA recognizes.
</fo:block></fo:block><fo:block id="ref_guide_conf_openjpa"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
OpenJPA Properties
</fo:marker><fo:block font-size="20.735999999999997pt">2.5. 
OpenJPA Properties
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e12352"><!--
configuration
,
of OpenJPA properties
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA defines many configuration properties. Most of these properties are
provided for advanced users who wish to customize OpenJPA's behavior; the
majority of developers can omit them. The following properties apply to any
OpenJPA back-end, though the given descriptions are tailored to OpenJPA's
default JDBC store.
</fo:block><fo:block id="openjpa.AutoClear"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.AutoClear
</fo:marker><fo:block font-size="17.28pt">2.5.1. 
openjpa.AutoClear
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e12363"><!--
AutoClear
--></fo:wrapper><fo:wrapper id="d0e12366"><!--
transactions
,
AutoClear
,
AutoClear
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.AutoClear
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getAutoClear">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getAutoClear
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
AutoClear</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">datastore</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">datastore</fo:inline>,
<fo:inline font-family="monospace">all</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> When to automatically clear
instance state: on entering a datastore transaction, or on entering any
transaction.
</fo:block></fo:block><fo:block id="openjpa.AutoDetach"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.AutoDetach
</fo:marker><fo:block font-size="17.28pt">2.5.2. 
openjpa.AutoDetach
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e12422"><!--
AutoDetach
--></fo:wrapper><fo:wrapper id="d0e12425"><!--
detach
,
AutoDetach
,
AutoDetach
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.AutoDetach
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getAutoDetach">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getAutoDetach
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
AutoDetach</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">close</fo:inline>,
<fo:inline font-family="monospace">commit</fo:inline>, <fo:inline font-family="monospace">nontx-read</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A comma-separated list of events
when managed instances will be automatically detached.
</fo:block></fo:block><fo:block id="openjpa.BrokerFactory"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.BrokerFactory
</fo:marker><fo:block font-size="17.28pt">2.5.3. 
openjpa.BrokerFactory
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e12482"><!--
BrokerFactory
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.BrokerFactory
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getBrokerFactory">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getBrokerFactory
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
BrokerFactory</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">jdbc</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">jdbc</fo:inline>,
<fo:inline font-family="monospace">abstractstore</fo:inline>, <fo:inline font-family="monospace">remote</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/BrokerFactory.html">
<fo:inline font-family="monospace">org.apache.openjpa.kernel.BrokerFactory</fo:inline></fo:basic-link> type to
use.
</fo:block></fo:block><fo:block id="openjpa.BrokerImpl"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.BrokerImpl
</fo:marker><fo:block font-size="17.28pt">2.5.4. 
openjpa.BrokerImpl
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e12544"><!--
BrokerImpl
--></fo:wrapper><fo:wrapper id="d0e12547"><!--
Broker
,
BrokerImpl
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.BrokerImpl
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getBrokerImpl">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getBrokerImpl
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
BrokerImpl</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">default</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/Broker.html"><fo:inline font-family="monospace">
org.apache.openjpa.kernel.Broker</fo:inline></fo:basic-link> type to use at runtime. See
<fo:basic-link internal-destination="ref_guide_runtime_broker_extension"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 9.1.2, “
Broker Customization and Finalization
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_runtime_broker_extension"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_runtime_broker_extension"/>]</fo:inline></fo:basic-link> on for details.
</fo:block></fo:block><fo:block id="openjpa.ClassResolver"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.ClassResolver
</fo:marker><fo:block font-size="17.28pt">2.5.5. 
openjpa.ClassResolver
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e12599"><!--
ClassResolver
--></fo:wrapper><fo:wrapper id="d0e12602"><!--
class loading
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.ClassResolver
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getClassResolver">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getClassResolver
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
ClassResolver</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">default</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/util/ClassResolver.html"><fo:inline font-family="monospace">
org.apache.openjpa.util.ClassResolver</fo:inline></fo:basic-link> implementation to use
for class name resolution. You may wish to plug in your own resolver if you have
special classloading needs.
</fo:block></fo:block><fo:block id="openjpa.Compatibility"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.Compatibility
</fo:marker><fo:block font-size="17.28pt">2.5.6. 
openjpa.Compatibility
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e12652"><!--
Compatibility
--></fo:wrapper><fo:wrapper id="d0e12655"><!--
backwards compatibility
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.Compatibility
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getCompatibility">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getCompatibility
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
Compatibility</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> Encapsulates options to mimic the
behavior of previous OpenJPA releases.
</fo:block></fo:block><fo:block id="openjpa.ConnectionDriverName"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.ConnectionDriverName
</fo:marker><fo:block font-size="17.28pt">2.5.7. 
openjpa.ConnectionDriverName
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e12695"><!--
ConnectionDriverName
--></fo:wrapper><fo:wrapper id="d0e12698"><!--
connections
,
ConnectionDriverName
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.ConnectionDriverName</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getConnectionDriverName">
<fo:inline font-family="monospace">
org.apache.openjpa.conf.OpenJPAConfiguration.getConnectionDriverName
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
ConnectionDriverName</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The full class name of either the
JDBC <fo:inline font-family="monospace">java.sql.Driver</fo:inline>, or a <fo:inline font-family="monospace">
javax.sql.DataSource</fo:inline> implementation to use to connect to the
database. See <fo:basic-link internal-destination="ref_guide_dbsetup"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 4, <fo:inline font-style="italic">
JDBC
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.Connection2DriverName"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.Connection2DriverName
</fo:marker><fo:block font-size="17.28pt">2.5.8. 
openjpa.Connection2DriverName
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e12748"><!--
Connection2DriverName
--></fo:wrapper><fo:wrapper id="d0e12751"><!--
connections
,
Connection2DriverName
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.Connection2DriverName</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getConnection2DriverName">
<fo:inline font-family="monospace">
org.apache.openjpa.conf.OpenJPAConfiguration.getConnection2DriverName
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
Connection2DriverName</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> This property is equivalent to the
<fo:inline font-family="monospace">openjpa.ConnectionDriverName</fo:inline> property described in
<fo:basic-link internal-destination="openjpa.ConnectionDriverName"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.5.7, “
openjpa.ConnectionDriverName
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="openjpa.ConnectionDriverName"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="openjpa.ConnectionDriverName"/>]</fo:inline></fo:basic-link>, but applies to the
alternate connection factory used for unmanaged connections. See
<fo:basic-link internal-destination="ref_guide_dbsetup_thirdparty_enlist"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.2.1, “
Managed and XA DataSources
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_thirdparty_enlist"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_thirdparty_enlist"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.ConnectionFactory"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.ConnectionFactory
</fo:marker><fo:block font-size="17.28pt">2.5.9. 
openjpa.ConnectionFactory
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e12800"><!--
ConnectionFactory
--></fo:wrapper><fo:wrapper id="d0e12803"><!--
connections
,
ConnectionFactory
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.ConnectionFactory</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getConnectionFactory">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getConnectionFactory
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
ConnectionFactory</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A <fo:inline font-family="monospace">javax.sql.DataSource
</fo:inline> to use to connect to the database. See
<fo:basic-link internal-destination="ref_guide_dbsetup"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 4, <fo:inline font-style="italic">
JDBC
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.ConnectionFactory2"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.ConnectionFactory2
</fo:marker><fo:block font-size="17.28pt">2.5.10. 
openjpa.ConnectionFactory2
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e12850"><!--
ConnectionFactory2
--></fo:wrapper><fo:wrapper id="d0e12853"><!--
connections
,
ConnectionFactory2
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.ConnectionFactory2</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getConnectionFactory2">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getConnectionFactory2
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
ConnectionFactory2</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> An unmanaged <fo:inline font-family="monospace">
javax.sql.DataSource</fo:inline> to use to connect to the database. See
<fo:basic-link internal-destination="ref_guide_dbsetup"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 4, <fo:inline font-style="italic">
JDBC
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.ConnectionFactoryName"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.ConnectionFactoryName
</fo:marker><fo:block font-size="17.28pt">2.5.11. 
openjpa.ConnectionFactoryName
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e12900"><!--
ConnectionFactoryName
--></fo:wrapper><fo:wrapper id="d0e12903"><!--
connections
,
ConnectionFactoryName
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.ConnectionFactoryName</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getConnectionFactoryName">
<fo:inline font-family="monospace">
org.apache.openjpa.conf.OpenJPAConfiguration.getConnectionFactoryName
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
ConnectionFactoryName</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The JNDI location of a <fo:inline font-family="monospace">
javax.sql.DataSource</fo:inline> to use to connect to the database. See
<fo:basic-link internal-destination="ref_guide_dbsetup"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 4, <fo:inline font-style="italic">
JDBC
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.ConnectionFactory2Name"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.ConnectionFactory2Name
</fo:marker><fo:block font-size="17.28pt">2.5.12. 
openjpa.ConnectionFactory2Name
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e12950"><!--
ConnectionFactory2Name
--></fo:wrapper><fo:wrapper id="d0e12953"><!--
connections
,
ConnectionFactory2Name
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.ConnectionFactory2Name</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getConnectionFactory2Name">
<fo:inline font-family="monospace">
org.apache.openjpa.conf.OpenJPAConfiguration.getConnectionFactory2Name
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
ConnectionFactory2Name</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The JNDI location of an unmanaged
<fo:inline font-family="monospace">javax.sql.DataSource</fo:inline> to use to connect to the database.
See <fo:basic-link internal-destination="ref_guide_enterprise_xa"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 8.3, “
XA Transactions
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_enterprise_xa"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_enterprise_xa"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.ConnectionFactoryMode"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.ConnectionFactoryMode
</fo:marker><fo:block font-size="17.28pt">2.5.13. 
openjpa.ConnectionFactoryMode
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13000"><!--
ConnectionFactoryMode
--></fo:wrapper><fo:wrapper id="d0e13003"><!--
connections
,
ConnectionFactoryMode
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.ConnectionFactoryMode</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getConnectionFactoryMode">
<fo:inline font-family="monospace">
org.apache.openjpa.conf.OpenJPAConfiguration.getConnectionFactoryMode
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
ConnectionFactoryMode</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">local</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">local</fo:inline>,
<fo:inline font-family="monospace">managed</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The connection factory mode to use
when integrating with the application server's managed transactions. See
<fo:basic-link internal-destination="ref_guide_dbsetup_thirdparty_enlist"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.2.1, “
Managed and XA DataSources
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_thirdparty_enlist"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_thirdparty_enlist"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.ConnectionFactoryProperties"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.ConnectionFactoryProperties
</fo:marker><fo:block font-size="17.28pt">2.5.14. 
openjpa.ConnectionFactoryProperties
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13059"><!--
ConnectionFactoryProperties
--></fo:wrapper><fo:wrapper id="d0e13062"><!--
connections
,
ConnectionFactoryProperties
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.ConnectionFactoryProperties</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getConnectionFactoryProperties">
<fo:inline font-family="monospace">
org.apache.openjpa.conf.OpenJPAConfiguration.getConnectionFactoryProperties
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
ConnectionFactoryProperties</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) listing properties for
configuration of the datasource in use. See the
<fo:basic-link internal-destination="ref_guide_dbsetup"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 4, <fo:inline font-style="italic">
JDBC
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.ConnectionFactory2Properties"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.ConnectionFactory2Properties
</fo:marker><fo:block font-size="17.28pt">2.5.15. 
openjpa.ConnectionFactory2Properties
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13108"><!--
ConnectionFactory2Properties
--></fo:wrapper><fo:wrapper id="d0e13111"><!--
connections
,
ConnectionFactory2Properties
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.ConnectionFactory2Properties</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getConnectionFactory2Properties">
<fo:inline font-family="monospace">
org.apache.openjpa.conf.OpenJPAConfiguration.getConnectionFactory2Properties
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
ConnectionFactory2Properties</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> This property is equivalent to the
<fo:inline font-family="monospace">openjpa.ConnectionFactoryProperties</fo:inline> property described in
<fo:basic-link internal-destination="openjpa.ConnectionFactoryProperties"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.5.14, “
openjpa.ConnectionFactoryProperties
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="openjpa.ConnectionFactoryProperties"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="openjpa.ConnectionFactoryProperties"/>]</fo:inline></fo:basic-link>, but applies to the
alternate connection factory used for unmanaged connections. See
<fo:basic-link internal-destination="ref_guide_dbsetup_thirdparty_enlist"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.2.1, “
Managed and XA DataSources
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_thirdparty_enlist"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_thirdparty_enlist"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.ConnectionPassword"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.ConnectionPassword
</fo:marker><fo:block font-size="17.28pt">2.5.16. 
openjpa.ConnectionPassword
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13160"><!--
ConnectionPassword
--></fo:wrapper><fo:wrapper id="d0e13163"><!--
connections
,
ConnectionPassword
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.ConnectionPassword</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getConnectionPassword">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getConnectionPassword
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
ConnectionPassword</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The password for the user
specified in the <fo:inline font-family="monospace">ConnectionUserName</fo:inline> property. See
<fo:basic-link internal-destination="ref_guide_dbsetup"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 4, <fo:inline font-style="italic">
JDBC
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.Connection2Password"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.Connection2Password
</fo:marker><fo:block font-size="17.28pt">2.5.17. 
openjpa.Connection2Password
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13210"><!--
Connection2Password
--></fo:wrapper><fo:wrapper id="d0e13213"><!--
connections
,
Connection2Password
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.Connection2Password</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getConnection2Password">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getConnection2Password
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
Connection2Password</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> This property is equivalent to the
<fo:inline font-family="monospace">openjpa.ConnectionPassword</fo:inline> property described in
<fo:basic-link internal-destination="openjpa.ConnectionPassword"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.5.16, “
openjpa.ConnectionPassword
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="openjpa.ConnectionPassword"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="openjpa.ConnectionPassword"/>]</fo:inline></fo:basic-link>, but applies to the
alternate connection factory used for unmanaged connections. See
<fo:basic-link internal-destination="ref_guide_dbsetup_thirdparty_enlist"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.2.1, “
Managed and XA DataSources
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_thirdparty_enlist"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_thirdparty_enlist"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.ConnectionProperties"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.ConnectionProperties
</fo:marker><fo:block font-size="17.28pt">2.5.18. 
openjpa.ConnectionProperties
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13262"><!--
ConnectionProperties
--></fo:wrapper><fo:wrapper id="d0e13265"><!--
connections
,
ConnectionProperties
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.ConnectionProperties</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getConnectionProperties">
<fo:inline font-family="monospace">
org.apache.openjpa.conf.OpenJPAConfiguration.getConnectionProperties
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
ConnectionProperties</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) listing properties to configure
the driver listed in the <fo:inline font-family="monospace">ConnectionDriverName</fo:inline> property
described below. See <fo:basic-link internal-destination="ref_guide_dbsetup"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 4, <fo:inline font-style="italic">
JDBC
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.Connection2Properties"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.Connection2Properties
</fo:marker><fo:block font-size="17.28pt">2.5.19. 
openjpa.Connection2Properties
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13314"><!--
Connection2Properties
--></fo:wrapper><fo:wrapper id="d0e13317"><!--
connections
,
Connection2Properties
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.Connection2Properties</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getConnection2Properties">
<fo:inline font-family="monospace">
org.apache.openjpa.conf.OpenJPAConfiguration.getConnection2Properties
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
Connection2Properties</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> This property is equivalent to the
<fo:inline font-family="monospace">openjpa.ConnectionProperties</fo:inline> property described in
<fo:basic-link internal-destination="openjpa.ConnectionProperties"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.5.18, “
openjpa.ConnectionProperties
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="openjpa.ConnectionProperties"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="openjpa.ConnectionProperties"/>]</fo:inline></fo:basic-link>, but applies to the
alternate connection factory used for unmanaged connections. See
<fo:basic-link internal-destination="ref_guide_dbsetup_thirdparty_enlist"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.2.1, “
Managed and XA DataSources
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_thirdparty_enlist"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_thirdparty_enlist"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.ConnectionURL"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.ConnectionURL
</fo:marker><fo:block font-size="17.28pt">2.5.20. 
openjpa.ConnectionURL
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13366"><!--
ConnectionURL
--></fo:wrapper><fo:wrapper id="d0e13369"><!--
connections
,
ConnectionURL
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.ConnectionURL
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getConnectionURL">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getConnectionURL
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
ConnectionURL</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The JDBC URL for the database. See
<fo:basic-link internal-destination="ref_guide_dbsetup"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 4, <fo:inline font-style="italic">
JDBC
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.Connection2URL"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.Connection2URL
</fo:marker><fo:block font-size="17.28pt">2.5.21. 
openjpa.Connection2URL
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13413"><!--
Connection2URL
--></fo:wrapper><fo:wrapper id="d0e13416"><!--
connections
,
Connection2URL
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.Connection2URL
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getConnection2URL">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getConnection2URL
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
Connection2URL</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> This property is equivalent to the
<fo:inline font-family="monospace">openjpa.ConnectionURL</fo:inline> property described in
<fo:basic-link internal-destination="openjpa.ConnectionURL"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.5.20, “
openjpa.ConnectionURL
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="openjpa.ConnectionURL"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="openjpa.ConnectionURL"/>]</fo:inline></fo:basic-link>, but applies to the alternate
connection factory used for unmanaged connections. See
<fo:basic-link internal-destination="ref_guide_dbsetup_thirdparty_enlist"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.2.1, “
Managed and XA DataSources
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_thirdparty_enlist"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_thirdparty_enlist"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.ConnectionUserName"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.ConnectionUserName
</fo:marker><fo:block font-size="17.28pt">2.5.22. 
openjpa.ConnectionUserName
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13465"><!--
ConnectionUserName
--></fo:wrapper><fo:wrapper id="d0e13468"><!--
connections
,
ConnectionUserName
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.ConnectionUserName</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getConnectionUserName">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getConnectionUserName
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
ConnectionUserName</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The user name to use when
connecting to the database. See the <fo:basic-link internal-destination="ref_guide_dbsetup"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 4, <fo:inline font-style="italic">
JDBC
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup"/>]</fo:inline></fo:basic-link>
for details.
</fo:block></fo:block><fo:block id="openjpa.Connection2UserName"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.Connection2UserName
</fo:marker><fo:block font-size="17.28pt">2.5.23. 
openjpa.Connection2UserName
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13512"><!--
Connection2UserName
--></fo:wrapper><fo:wrapper id="d0e13515"><!--
connections
,
Connection2UserName
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.Connection2UserName</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getConnection2UserName">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getConnection2UserName
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
Connection2UserName</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> This property is equivalent to the
<fo:inline font-family="monospace">openjpa.ConnectionUserName</fo:inline> property described in
<fo:basic-link internal-destination="openjpa.ConnectionUserName"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.5.22, “
openjpa.ConnectionUserName
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="openjpa.ConnectionUserName"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="openjpa.ConnectionUserName"/>]</fo:inline></fo:basic-link>, but applies to the
alternate connection factory used for unmanaged connections. See
<fo:basic-link internal-destination="ref_guide_dbsetup_thirdparty_enlist"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.2.1, “
Managed and XA DataSources
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_thirdparty_enlist"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_thirdparty_enlist"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.ConnectionRetainMode"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.ConnectionRetainMode
</fo:marker><fo:block font-size="17.28pt">2.5.24. 
openjpa.ConnectionRetainMode
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13564"><!--
ConnectionRetainMode
--></fo:wrapper><fo:wrapper id="d0e13567"><!--
connections
,
ConnectionRetainMode
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.ConnectionRetainMode</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getConnectionRetainMode">
<fo:inline font-family="monospace">
org.apache.openjpa.conf.OpenJPAConfiguration.getConnectionRetainMode
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
ConnectionRetainMode</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">on-demand</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> Controls how OpenJPA uses
datastore connections. This property can also be specified for individual
sessions. See <fo:basic-link internal-destination="ref_guide_dbsetup_retain"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.8, “
Configuring the Use of JDBC Connections
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_retain"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_retain"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.DataCache"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.DataCache
</fo:marker><fo:block font-size="17.28pt">2.5.25. 
openjpa.DataCache
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13613"><!--
DataCache
--></fo:wrapper><fo:wrapper id="d0e13616"><!--
caching
,
DataCache
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.DataCache
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getDataCache">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getDataCache
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
DataCache</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">false</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin list string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/datacache/DataCache.html"><fo:inline font-family="monospace">
org.apache.openjpa.datacache.DataCache</fo:inline></fo:basic-link>s to use for data
caching. See <fo:basic-link internal-destination="ref_guide_cache_conf"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.1.1, “
Data Cache Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_cache_conf"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_cache_conf"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.DataCacheManager"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.DataCacheManager
</fo:marker><fo:block font-size="17.28pt">2.5.26. 
openjpa.DataCacheManager
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13668"><!--
DataCacheManager
--></fo:wrapper><fo:wrapper id="d0e13671"><!--
caching
,
DataCacheManager
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.DataCacheManager</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getDataCacheManager">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getDataCacheManager
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
DataCacheManager</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">default</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/datacache/DataCacheManager.html">
<fo:inline font-family="monospace">openjpa.datacache.DataCacheManager</fo:inline></fo:basic-link> that manages
the system data caches. See <fo:basic-link internal-destination="ref_guide_cache"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.1, “
Data Cache
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_cache"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_cache"/>]</fo:inline></fo:basic-link> for details
on data caching.
</fo:block></fo:block><fo:block id="openjpa.DataCacheTimeout"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.DataCacheTimeout
</fo:marker><fo:block font-size="17.28pt">2.5.27. 
openjpa.DataCacheTimeout
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13724"><!--
DataCacheTimeout
--></fo:wrapper><fo:wrapper id="d0e13727"><!--
caching
,
DataCacheTimeout
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.DataCacheTimeout</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getDataCacheTimeout">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getDataCacheTimeout
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
DataCacheTimeout</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">-1</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The number of milliseconds that
data in the data cache is valid. Set this to -1 to indicate that data should not
expire from the cache. This property can also be specified for individual
classes. See <fo:basic-link internal-destination="ref_guide_cache_conf"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.1.1, “
Data Cache Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_cache_conf"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_cache_conf"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.DetachState"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.DetachState
</fo:marker><fo:block font-size="17.28pt">2.5.28. 
openjpa.DetachState
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13773"><!--
DetachState
--></fo:wrapper><fo:wrapper id="d0e13776"><!--
detach
,
DetachState
,
DetachState
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.DetachState
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getDetachState">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getDetachState
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
DetachState</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">loaded</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">loaded</fo:inline>,
<fo:inline font-family="monospace">fetch-groups</fo:inline>, <fo:inline font-family="monospace">all</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> Determines which fields are part
of the detached graph and related options. For more details, see
<fo:basic-link internal-destination="ref_guide_detach_graph"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 11.1.3, “
Defining the Detached Object Graph
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_detach_graph"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_detach_graph"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block><fo:block id="openjpa.DynamicDataStructs"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.DynamicDataStructs
</fo:marker><fo:block font-size="17.28pt">2.5.29. 
openjpa.DynamicDataStructs
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13837"><!--
DynamicDataStructs
--></fo:wrapper><fo:wrapper id="d0e13840"><!--
caching
,
DynamicDataStructs
--></fo:wrapper><fo:wrapper id="d0e13845"><!--
remote
,
DynamicDataStructs
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.DynamicDataStructs</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getDynamicDataStructs">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getDynamicDataStructs
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
DynamicDataStructs</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">false</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> Whether to dynamically generate
customized structs to hold persistent data. Both the OpenJPA data cache and the
remote framework rely on data structs to cache and transfer persistent state.
With dynamic structs, OpenJPA can customize data storage for each class,
eliminating the need to generate primitive wrapper objects. This saves memory
and speeds up certain runtime operations. The price is a longer warm-up time for
the application - generating and loading custom classes into the JVM takes time.
Therefore, only set this property to <fo:inline font-family="monospace">true</fo:inline> if you have a
long-running application where the initial cost of class generation is offset by
memory and speed optimization over time.
</fo:block></fo:block><fo:block id="openjpa.FetchBatchSize"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.FetchBatchSize
</fo:marker><fo:block font-size="17.28pt">2.5.30. 
openjpa.FetchBatchSize
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13892"><!--
FetchBatchSize
--></fo:wrapper><fo:wrapper id="d0e13895"><!--
large result sets
,
FetchBatchSize
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.FetchBatchSize
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getFetchBatchSize">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getFetchBatchSize
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
FetchBatchSize</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">-1</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The number of rows to fetch at
once when scrolling through a result set. The fetch size can also be set at
runtime. See <fo:basic-link internal-destination="ref_guide_dbsetup_lrs"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.9, “
Large Result Sets
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_lrs"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_lrs"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.FetchGroups"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.FetchGroups
</fo:marker><fo:block font-size="17.28pt">2.5.31. 
openjpa.FetchGroups
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13941"><!--
fetch groups
,
FetchGroups
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.FetchGroups
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getFetchGroups">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getFetchGroups
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
FetchGroups</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A comma-separated list of fetch
group names that are to be loaded when retrieving objects from the datastore.
Fetch groups can also be set at runtime. See <fo:basic-link internal-destination="ref_guide_fetch"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.6, “
Fetch Groups
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_fetch"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_fetch"/>]</fo:inline></fo:basic-link>
for details.
</fo:block></fo:block><fo:block id="openjpa.FlushBeforeQueries"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.FlushBeforeQueries
</fo:marker><fo:block font-size="17.28pt">2.5.32. 
openjpa.FlushBeforeQueries
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e13986"><!--
FlushBeforeQueries
--></fo:wrapper><fo:wrapper id="d0e13989"><!--
Query
,
FlushBeforeQueries
--></fo:wrapper><fo:wrapper id="d0e13994"><!--
flush
,
FlushBeforeQueries
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.FlushBeforeQueries</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.FlushBeforeQueries</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getFlushBeforeQueries">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getFlushBeforeQueries
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
FlushBeforeQueries</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">true</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> Whether or not to flush any
changes made in the current transaction to the datastore before executing a
query. See <fo:basic-link internal-destination="ref_guide_dbsetup_retain"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.8, “
Configuring the Use of JDBC Connections
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_retain"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_retain"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.IgnoreChanges"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.IgnoreChanges
</fo:marker><fo:block font-size="17.28pt">2.5.33. 
openjpa.IgnoreChanges
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e14047"><!--
IgnoreChanges
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.IgnoreChanges
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getIgnoreChanges">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getIgnoreChanges
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
IgnoreChanges</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">false</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> Whether to consider modifications
to persistent objects made in the current transaction when evaluating queries.
Setting this to <fo:inline font-family="monospace">true</fo:inline> allows OpenJPA to ignore changes and
execute the query directly against the datastore. A value of <fo:inline font-family="monospace">false
</fo:inline> forces OpenJPA to consider whether the changes in the current
transaction affect the query, and if so to either evaluate the query in-memory
or flush before running it against the datastore.
</fo:block></fo:block><fo:block id="openjpa.Id"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">openjpa.Id</fo:marker><fo:block font-size="17.28pt">2.5.34. openjpa.Id</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e14095"><!--Id--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name:</fo:inline>
<fo:inline font-family="monospace">openjpa.Id</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property:</fo:inline>
<fo:inline font-family="monospace">Id</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> none
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> An
environment-specific identifier for this configuration. This
might correspond to a JPA persistence-unit name, or to some other
more-unique value available in the current environment.
</fo:block></fo:block><fo:block id="openjpa.InverseManager"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.InverseManager
</fo:marker><fo:block font-size="17.28pt">2.5.35. 
openjpa.InverseManager
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e14127"><!--
InverseManager
--></fo:wrapper><fo:wrapper id="d0e14130"><!--
bidirectional relation
,
InverseManager
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.InverseManager
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getInverseManager">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getInverseManager
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
InverseManager</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">false</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">false</fo:inline>,
<fo:inline font-family="monospace">true</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing a
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/InverseManager.html">
<fo:inline font-family="monospace">org.apache.openjpa.kernel.InverseManager</fo:inline></fo:basic-link> to use
for managing bidirectional relations upon a flush. See
<fo:basic-link internal-destination="ref_guide_inverses"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.4, “
Managed Inverses
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_inverses"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_inverses"/>]</fo:inline></fo:basic-link> for usage documentation.
</fo:block></fo:block><fo:block id="openjpa.LockManager"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.LockManager
</fo:marker><fo:block font-size="17.28pt">2.5.36. 
openjpa.LockManager
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e14193"><!--
LockManager
--></fo:wrapper><fo:wrapper id="d0e14196"><!--
locking
,
LockManager
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.LockManager
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getLockManager">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getLockManager
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
LockManager</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">version</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">none</fo:inline>,
<fo:inline font-family="monospace">sjvm</fo:inline>, <fo:inline font-family="monospace">pessimistic</fo:inline>,
<fo:inline font-family="monospace">version</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing a
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/LockManager.html"><fo:inline font-family="monospace">
org.apache.openjpa.kernel.LockManager</fo:inline></fo:basic-link> to use for acquiring
locks on persistent instances during transactions. See
<fo:basic-link internal-destination="ref_guide_locking_lockmgr"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 9.3.4, “
Lock Manager
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_locking_lockmgr"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_locking_lockmgr"/>]</fo:inline></fo:basic-link> for more information.
</fo:block></fo:block><fo:block id="openjpa.LockTimeout"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.LockTimeout
</fo:marker><fo:block font-size="17.28pt">2.5.37. 
openjpa.LockTimeout
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e14264"><!--
LockTimeout
--></fo:wrapper><fo:wrapper id="d0e14267"><!--
locking
,
LockTimeout
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.LockTimeout
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getLockTimeout">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getLockTimeout
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
LockTimeout</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">-1</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The number of milliseconds to wait
for an object lock before throwing an exception, or -1 for no limit. See
<fo:basic-link internal-destination="ref_guide_locking"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 9.3, “
Object Locking
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_locking"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_locking"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.Log"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.Log
</fo:marker><fo:block font-size="17.28pt">2.5.38. 
openjpa.Log
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e14313"><!--
Log
--></fo:wrapper><fo:wrapper id="d0e14316"><!--
logging
,
Log
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.Log</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getLog">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getLog</fo:inline>
</fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">Log
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">true</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">openjpa</fo:inline>,
<fo:inline font-family="monospace">commons</fo:inline>, <fo:inline font-family="monospace">log4j</fo:inline>, <fo:inline font-family="monospace">none</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing a
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/lib/log/LogFactory.html"><fo:inline font-family="monospace">
org.apache.openjpa.lib.log.LogFactory</fo:inline></fo:basic-link> to use for logging.
For details on logging, see <fo:basic-link internal-destination="ref_guide_logging"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 3, <fo:inline font-style="italic">
Logging
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_logging"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_logging"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block><fo:block id="openjpa.ManagedRuntime"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.ManagedRuntime
</fo:marker><fo:block font-size="17.28pt">2.5.39. 
openjpa.ManagedRuntime
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e14385"><!--
ManagedRuntime
--></fo:wrapper><fo:wrapper id="d0e14388"><!--
transactions
,
managed
,
ManagedRuntime
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.ManagedRuntime
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getManagedRuntime">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getManagedRuntime
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
ManagedRuntime</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">auto</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/ee/ManagedRuntime.html"><fo:inline font-family="monospace">
org.apache.openjpa.ee.ManagedRuntime</fo:inline></fo:basic-link> implementation to use
for obtaining a reference to the <fo:inline font-family="monospace">TransactionManager</fo:inline> in an
enterprise environment.
</fo:block></fo:block><fo:block id="openjpa.Mapping"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.Mapping
</fo:marker><fo:block font-size="17.28pt">2.5.40. 
openjpa.Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e14443"><!--
Mapping
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.Mapping
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getMapping">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getMapping</fo:inline>
</fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
Mapping</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The symbolic name of the
object-to-datastore mapping to use.
</fo:block></fo:block><fo:block id="openjpa.MaxFetchDepth"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.MaxFetchDepth
</fo:marker><fo:block font-size="17.28pt">2.5.41. 
openjpa.MaxFetchDepth
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e14484"><!--
MaxFetchDepth
--></fo:wrapper><fo:wrapper id="d0e14487"><!--
eager fetching
,
MaxFetchDepth
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.MaxFetchDepth
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getMaxFetchDepth">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getMaxFetchDepth
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
MaxFetchDepth</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">-1</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The maximum depth of relations to
traverse when eager fetching. Use -1 for no limit. Defaults to no limit. See
<fo:basic-link internal-destination="ref_guide_perfpack_eager"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.7, “
Eager Fetching
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_perfpack_eager"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_perfpack_eager"/>]</fo:inline></fo:basic-link> for details on eager fetching.
</fo:block></fo:block><fo:block id="openjpa.MetaDataFactory"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.MetaDataFactory
</fo:marker><fo:block font-size="17.28pt">2.5.42. 
openjpa.MetaDataFactory
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e14533"><!--
MetaDataFactory
--></fo:wrapper><fo:wrapper id="d0e14536"><!--
metadata
,
MetaDataFactory
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.MetaDataFactory
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getMetaDataFactory">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getMetaDataFactory
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
MetaDataFactory</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> <fo:inline font-family="monospace">jpa</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/meta/MetaDataFactory.html">
<fo:inline font-family="monospace">openjpa.meta.MetaDataFactory</fo:inline></fo:basic-link> to use to store and
retrieve metadata for your persistent classes. See
<fo:basic-link internal-destination="ref_guide_meta_factory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 6.1, “
Metadata Factory
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_meta_factory"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_meta_factory"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.Multithreaded"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.Multithreaded
</fo:marker><fo:block font-size="17.28pt">2.5.43. 
openjpa.Multithreaded
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e14590"><!--
Multithreaded
--></fo:wrapper><fo:wrapper id="d0e14593"><!--
threading
,
Multithreaded
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.Multithreaded
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getMultithreaded">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getMultithreaded
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
Multithreaded</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">false</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> Whether persistent instances and
OpenJPA components other than the <fo:inline font-family="monospace">EntityManagerFactory</fo:inline>
will be accessed by multiple threads at once.
</fo:block></fo:block><fo:block id="openjpa.Optimistic"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.Optimistic
</fo:marker><fo:block font-size="17.28pt">2.5.44. 
openjpa.Optimistic
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e14640"><!--
Optimistic
--></fo:wrapper><fo:wrapper id="d0e14643"><!--
transactions
,
optimistic
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.Optimistic
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getOptimistic">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getOptimistic
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
Optimistic</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">true</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> Selects between optimistic and
pessimistic (datastore) transactional modes.
</fo:block></fo:block><fo:block id="openjpa.OrphanedKeyAction"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.OrphanedKeyAction
</fo:marker><fo:block font-size="17.28pt">2.5.45. 
openjpa.OrphanedKeyAction
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e14687"><!--
OrphanedKeyAction
--></fo:wrapper><fo:wrapper id="d0e14690"><!--
foreign keys
,
OrphanedKeyAction
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.OrphanedKeyAction</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getOrphanedKeyAction">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getOrphanedKeyAction
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
OrphanedKeyAction</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">log</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">log</fo:inline>,
<fo:inline font-family="monospace">exception</fo:inline>, <fo:inline font-family="monospace">none</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing a
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/event/OrphanedKeyAction.html">
<fo:inline font-family="monospace">org.apache.openjpa.event.OrphanedKeyAction</fo:inline></fo:basic-link> to
invoke when OpenJPA discovers an orphaned datastore key. See
<fo:basic-link internal-destination="ref_guide_orphan"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.11, “
Orphaned Keys
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_orphan"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_orphan"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.NontransactionalRead"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.NontransactionalRead
</fo:marker><fo:block font-size="17.28pt">2.5.46. 
openjpa.NontransactionalRead
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e14756"><!--
NontransactionalRead
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.NontransactionalRead</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getNontransactionalRead">
<fo:inline font-family="monospace">
org.apache.openjpa.conf.OpenJPAConfiguration.getNontransactionalRead
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
NontransactionalRead</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">true</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> Whether the OpenJPA runtime will
allow you to read data outside of a transaction.
</fo:block></fo:block><fo:block id="openjpa.NontransactionalWrite"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.NontransactionalWrite
</fo:marker><fo:block font-size="17.28pt">2.5.47. 
openjpa.NontransactionalWrite
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e14798"><!--
NontransactionalWrite
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.NontransactionalWrite</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getNontransactionalWrite">
<fo:inline font-family="monospace">
org.apache.openjpa.conf.OpenJPAConfiguration.getNontransactionalWrite
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
NontransactionalWrite</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> <fo:inline font-family="monospace">false</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> Whether you can modify persistent
objects and perform persistence operations outside of a transaction. Changes
will take effect on the next transaction.
</fo:block></fo:block><fo:block id="openjpa.ProxyManager"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.ProxyManager
</fo:marker><fo:block font-size="17.28pt">2.5.48. 
openjpa.ProxyManager
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e14841"><!--
ProxyManager
--></fo:wrapper><fo:wrapper id="d0e14844"><!--
proxies
,
ProxyManager
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.ProxyManager
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getProxyManager">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getProxyManager
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
ProxyManager</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">default</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing a
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/util/ProxyManager.html"><fo:inline font-family="monospace">
org.apache.openjpa.util.ProxyManager</fo:inline></fo:basic-link> to use for proxying
mutable second class objects. See
<fo:basic-link internal-destination="ref_guide_pc_scos_proxy_custom"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.5.4.3, “
Custom Proxies
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_scos_proxy_custom"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_scos_proxy_custom"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.QueryCache"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.QueryCache
</fo:marker><fo:block font-size="17.28pt">2.5.49. 
openjpa.QueryCache
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e14896"><!--
QueryCache
--></fo:wrapper><fo:wrapper id="d0e14899"><!--
caching
,
QueryCache
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.QueryCache
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getQueryCache">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getQueryCache
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
QueryCache</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">true</fo:inline>, when the data
cache (see <fo:basic-link internal-destination="openjpa.DataCache"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.5.25, “
openjpa.DataCache
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="openjpa.DataCache"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="openjpa.DataCache"/>]</fo:inline></fo:basic-link>) is also enabled, <fo:inline font-family="monospace">
false</fo:inline> otherwise.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/datacache/QueryCache.html">
<fo:inline font-family="monospace">org.apache.openjpa.datacache.QueryCache</fo:inline></fo:basic-link>
implementation to use for caching of queries loaded from the data store. See
<fo:basic-link internal-destination="ref_guide_cache_query"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.1.3, “
Query Cache
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_cache_query"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_cache_query"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.QueryCompilationCache"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.QueryCompilationCache
</fo:marker><fo:block font-size="17.28pt">2.5.50. 
openjpa.QueryCompilationCache
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e14957"><!--
QueryCompilationCache
--></fo:wrapper><fo:wrapper id="d0e14960"><!--
caching
,
QueryCompilationCache
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name:</fo:inline>
<fo:inline font-family="monospace">openjpa.QueryCompilationCache</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property:</fo:inline>
<fo:inline font-family="monospace">QueryCompilationCache</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> <fo:inline font-family="monospace">true</fo:inline>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing the
<fo:inline font-family="monospace">java.util.Map</fo:inline> to use for caching of data used during
query compilation. See <fo:basic-link internal-destination="ref_guide_cache_querycomp"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.2, “
Query Compilation Cache
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_cache_querycomp"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_cache_querycomp"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.ReadLockLevel"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.ReadLockLevel
</fo:marker><fo:block font-size="17.28pt">2.5.51. 
openjpa.ReadLockLevel
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e15004"><!--
ReadLockLevel
--></fo:wrapper><fo:wrapper id="d0e15007"><!--
locking
,
ReadLockLevel
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.ReadLockLevel
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getReadLockLevel">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getReadLockLevel
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
ReadLockLevel</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">read</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">none</fo:inline>,
<fo:inline font-family="monospace">read</fo:inline>, <fo:inline font-family="monospace">write</fo:inline>, numeric values for
lock-manager specific lock levels
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The default level at which to lock
objects retrieved during a non-optimistic transaction. Note that for the default
JDBC lock manager, <fo:inline font-family="monospace"> read</fo:inline> and <fo:inline font-family="monospace">write</fo:inline> lock
levels are equivalent.
</fo:block></fo:block><fo:block id="openjpa.RemoteCommitProvider"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.RemoteCommitProvider
</fo:marker><fo:block font-size="17.28pt">2.5.52. 
openjpa.RemoteCommitProvider
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e15070"><!--
RemoteCommitProvider
--></fo:wrapper><fo:wrapper id="d0e15073"><!--
caching
,
RemoteCommitProvider
--></fo:wrapper><fo:wrapper id="d0e15078"><!--
remote
,
RemoteCommitProvider
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.RemoteCommitProvider</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getRemoteCommitProvider">
<fo:inline font-family="monospace">
org.apache.openjpa.conf.OpenJPAConfiguration.getRemoteCommitProvider
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
RemoteCommitProvider</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/event/RemoteCommitProvider.html">
<fo:inline font-family="monospace">org.apache.openjpa.event.RemoteCommitProvider</fo:inline></fo:basic-link>
implementation to use for distributed event notification. See
<fo:basic-link internal-destination="ref_guide_event_conf"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 11.2.1, “
Remote Commit Provider Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_event_conf"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_event_conf"/>]</fo:inline></fo:basic-link> for more information.
</fo:block></fo:block><fo:block id="openjpa.RestoreState"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.RestoreState
</fo:marker><fo:block font-size="17.28pt">2.5.53. 
openjpa.RestoreState
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e15129"><!--
RestoreState
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.RestoreState
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getRestoreState">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getRestoreState
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
RestoreState</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">none</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">none</fo:inline>,
<fo:inline font-family="monospace">immutable</fo:inline>, <fo:inline font-family="monospace">all</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> Whether to restore managed fields
to their pre-transaction values when a rollback occurs.
</fo:block></fo:block><fo:block id="openjpa.RetainState"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.RetainState
</fo:marker><fo:block font-size="17.28pt">2.5.54. 
openjpa.RetainState
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e15184"><!--
RetainState
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.RetainState
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getRetainState">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getRetainState
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
RetainState</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">true</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> Whether persistent fields retain
their values on transaction commit.
</fo:block></fo:block><fo:block id="openjpa.RetryClassRegistration"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.RetryClassRegistration
</fo:marker><fo:block font-size="17.28pt">2.5.55. 
openjpa.RetryClassRegistration
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e15226"><!--
RetryClassRegistration
--></fo:wrapper><fo:wrapper id="d0e15229"><!--
metadata
,
RetryClassRegistration
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.RetryClassRegistration</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getRetryClassRegistration">
<fo:inline font-family="monospace">
org.apache.openjpa.conf.OpenJPAConfiguration.getRetryClassRegistration
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
RetryClassRegistration</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">false</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> Controls whether to log a warning
and defer registration instead of throwing an exception when a persistent class
cannot be fully processed. This property should <fo:inline font-style="italic">only</fo:inline> be
used in complex classloader situations where security is preventing OpenJPA from
reading registered classes. Setting this to true unnecessarily may obscure more
serious problems.
</fo:block></fo:block><fo:block id="openjpa.SavepointManager"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.SavepointManager
</fo:marker><fo:block font-size="17.28pt">2.5.56. 
openjpa.SavepointManager
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.SavepointManager</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getSavepointManager">
org.apache.openjpa.conf.OpenJPAConfiguration.getSavepointManager</fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property:</fo:inline>
SavepointManager
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">in-mem</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">in-mem</fo:inline>,
<fo:inline font-family="monospace">jdbc</fo:inline>, <fo:inline font-family="monospace">oracle</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing a
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/SavepointManager.html">
<fo:inline font-family="monospace">org.apache.openjpa.kernel.SavepointManager</fo:inline></fo:basic-link> to
use for managing transaction savepoints. See
<fo:basic-link internal-destination="ref_guide_savepoints"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 9.4, “
Savepoints
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_savepoints"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_savepoints"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.Sequence"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.Sequence
</fo:marker><fo:block font-size="17.28pt">2.5.57. 
openjpa.Sequence
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e15333"><!--
Sequence
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.Sequence
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getSequence">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getSequence
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
Sequence</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">table</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/Seq.html"><fo:inline font-family="monospace">
org.apache.openjpa.kernel.Seq</fo:inline></fo:basic-link> implementation to use for the
system sequence. See <fo:basic-link internal-destination="ref_guide_sequence"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 9.6, “
Generators
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_sequence"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_sequence"/>]</fo:inline></fo:basic-link> for more
information.
</fo:block></fo:block><fo:block id="openjpa.TransactionMode"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.TransactionMode
</fo:marker><fo:block font-size="17.28pt">2.5.58. 
openjpa.TransactionMode
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e15383"><!--
TransactionMode
--></fo:wrapper><fo:wrapper id="d0e15386"><!--
transactions
,
TransactionMode
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.TransactionMode
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getTransactionMode">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getTransactionMode
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
TransactionMode</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">local</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">local</fo:inline>,
<fo:inline font-family="monospace">managed</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The default transaction mode to
use. You can override this setting per-session.
</fo:block></fo:block><fo:block id="openjpa.WriteLockLevel"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.WriteLockLevel
</fo:marker><fo:block font-size="17.28pt">2.5.59. 
openjpa.WriteLockLevel
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e15440"><!--
WriteLockLevel
--></fo:wrapper><fo:wrapper id="d0e15443"><!--
locking
,
WriteLockLevel
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.WriteLockLevel
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html#getWriteLockLevel">
<fo:inline font-family="monospace">org.apache.openjpa.conf.OpenJPAConfiguration.getWriteLockLevel
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
WriteLockLevel</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">write</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">none</fo:inline>,
<fo:inline font-family="monospace">read</fo:inline>, <fo:inline font-family="monospace">write</fo:inline>, numeric values for
lock-manager specific lock levels
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The default level at which to lock
objects changed during a non-optimistic transaction. Note that for the default
JDBC lock manager, <fo:inline font-family="monospace"> read</fo:inline> and <fo:inline font-family="monospace">write</fo:inline> lock
levels are equivalent.
</fo:block></fo:block></fo:block><fo:block id="ref_guide_conf_jdbc"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
OpenJPA JDBC Properties
</fo:marker><fo:block font-size="20.735999999999997pt">2.6. 
OpenJPA JDBC Properties
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e15506"><!--
configuration
,
of JDBC properties
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following properties apply exclusively to the OpenJPA JDBC back-end.
</fo:block><fo:block id="openjpa.jdbc.ConnectionDecorators"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.jdbc.ConnectionDecorators
</fo:marker><fo:block font-size="17.28pt">2.6.1. 
openjpa.jdbc.ConnectionDecorators
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e15516"><!--
ConnectionDecorators
--></fo:wrapper><fo:wrapper id="d0e15519"><!--
connections
,
ConnectionDecorators
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.jdbc.ConnectionDecorators</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html#getConnectionDecorators">
<fo:inline font-family="monospace">
org.apache.openjpa.jdbc.conf.JDBCConfiguration.getConnectionDecorators
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
ConnectionDecorators</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A comma-separated list of plugin
strings (see <fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/lib/jdbc/ConnectionDecorator.html">
<fo:inline font-family="monospace">org.apache.openjpa.lib.jdbc.ConnectionDecorator</fo:inline></fo:basic-link>
instances to install on the connection factory. These decorators can wrap
connections passed from the underlying <fo:inline font-family="monospace">DataSource</fo:inline> to add
functionality. OpenJPA will pass all connections through the list of decorators
before using them. Note that by default OpenJPA employs all
of the built-in decorators in the <fo:inline font-family="monospace">org.apache.openjpa.lib.jdbc
</fo:inline> package already; you do not need to list them here.
</fo:block></fo:block><fo:block id="openjpa.jdbc.DBDictionary"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.jdbc.DBDictionary
</fo:marker><fo:block font-size="17.28pt">2.6.2. 
openjpa.jdbc.DBDictionary
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e15574"><!--
DBDictionary
--></fo:wrapper><fo:wrapper id="d0e15577"><!--
JDBC
,
DBDictionary
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.jdbc.DBDictionary</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html#getDBDictionary">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.conf.JDBCConfiguration.getDBDictionary
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
DBDictionary</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> Based on the
<fo:basic-link internal-destination="openjpa.ConnectionURL"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">openjpa.ConnectionURL</fo:inline>
</fo:inline></fo:basic-link><fo:basic-link internal-destination="openjpa.ConnectionDriverName"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.ConnectionDriverName</fo:inline></fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/sql/DBDictionary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.sql.DBDictionary</fo:inline></fo:basic-link> to use
for database interaction. OpenJPA typically auto-configures the dictionary based
on the JDBC URL, but you may have to set this property explicitly if you are
using an unrecognized driver, or to plug in your own dictionary for a database
OpenJPA does not support out-of-the-box. See
<fo:basic-link internal-destination="ref_guide_dbsetup_dbsupport"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.4, “
Database Support
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_dbsupport"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_dbsupport"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.jdbc.DriverDataSource"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.jdbc.DriverDataSource
</fo:marker><fo:block font-size="17.28pt">2.6.3. 
openjpa.jdbc.DriverDataSource
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e15636"><!--
DriverDataSource
--></fo:wrapper><fo:wrapper id="d0e15639"><!--
JDBC
,
DriverDataSource
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.jdbc.DriverDataSource</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html#getDriverDataSource">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.conf.JDBCConfiguration.getDriverDataSource
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
DriverDataSource</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">pooling</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The alias or full class name of
the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/schema/DriverDataSource.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.schema.DriverDataSource</fo:inline></fo:basic-link>
implementation to use to wrap JDBC Driver classes with javax.sql.DataSource
instances.
</fo:block></fo:block><fo:block id="openjpa.jdbc.EagerFetchMode"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.jdbc.EagerFetchMode
</fo:marker><fo:block font-size="17.28pt">2.6.4. 
openjpa.jdbc.EagerFetchMode
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e15688"><!--
EagerFetchMode
--></fo:wrapper><fo:wrapper id="d0e15691"><!--
eager fetching
,
EagerFetchMode
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.jdbc.EagerFetchMode</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html#getEagerFetchMode">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.conf.JDBCConfiguration.getEagerFetchMode
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
EagerFetchMode</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">parallel</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">parallel</fo:inline>,
<fo:inline font-family="monospace">join</fo:inline>, <fo:inline font-family="monospace">none</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> Optimizes how OpenJPA loads
persistent relations. This setting can also be varied at runtime. See
<fo:basic-link internal-destination="ref_guide_perfpack_eager"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.7, “
Eager Fetching
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_perfpack_eager"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_perfpack_eager"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.jdbc.FetchDirection"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.jdbc.FetchDirection
</fo:marker><fo:block font-size="17.28pt">2.6.5. 
openjpa.jdbc.FetchDirection
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e15750"><!--
FetchDirection
--></fo:wrapper><fo:wrapper id="d0e15753"><!--
large result sets
,
FetchDirection
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.jdbc.FetchDirection</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html#getFetchDirection">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.conf.JDBCConfiguration.getFetchDirection
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
FetchDirection</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">forward</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">forward</fo:inline>,
<fo:inline font-family="monospace">reverse</fo:inline>, <fo:inline font-family="monospace">unknown</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The expected order in which query
result lists will be accessed. This property can also be varied at runtime. See
<fo:basic-link internal-destination="ref_guide_dbsetup_lrs"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.9, “
Large Result Sets
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_lrs"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_lrs"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.jdbc.JDBCListeners"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.jdbc.JDBCListeners
</fo:marker><fo:block font-size="17.28pt">2.6.6. 
openjpa.jdbc.JDBCListeners
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e15812"><!--
JDBCListeners
--></fo:wrapper><fo:wrapper id="d0e15815"><!--
JDBC
,
JDBCListeners
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.jdbc.JDBCListeners</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html#getJDBCListeners">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.conf.JDBCConfiguration.getJDBCListeners
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
JDBCListeners</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A comma-separated list of plugin
strings (see <fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/lib/jdbc/JDBCListener.html">
<fo:inline font-family="monospace">org.apache.openjpa.lib.jdbc.JDBCListener</fo:inline></fo:basic-link> event
listeners to install. These listeners will be notified on various JDBC-related
events.
</fo:block></fo:block><fo:block id="openjpa.jdbc.LRSSize"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.jdbc.LRSSize
</fo:marker><fo:block font-size="17.28pt">2.6.7. 
openjpa.jdbc.LRSSize
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e15864"><!--
LRSSize
--></fo:wrapper><fo:wrapper id="d0e15867"><!--
large result sets
,
LRSSize
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.jdbc.LRSSize
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html#getLRSSize">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.conf.JDBCConfiguration.getLRSSize
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
LRSSize</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">query</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">query</fo:inline>,
<fo:inline font-family="monospace">last</fo:inline>, <fo:inline font-family="monospace">unknown</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The strategy to use to calculate
the size of a result list. This property can also be varied at runtime. See
<fo:basic-link internal-destination="ref_guide_dbsetup_lrs"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.9, “
Large Result Sets
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_lrs"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_lrs"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.jdbc.MappingDefaults"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.jdbc.MappingDefaults
</fo:marker><fo:block font-size="17.28pt">2.6.8. 
openjpa.jdbc.MappingDefaults
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e15926"><!--
MappingDefaults
--></fo:wrapper><fo:wrapper id="d0e15929"><!--
mapping metadata
,
MappingDefaults
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.jdbc.MappingDefaults</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html#getMappingDefaults">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.conf.JDBCConfiguration.getMappingDefaults
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
MappingDefaults</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> jpa
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/meta/MappingDefaults.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.meta.MappingDefaults</fo:inline></fo:basic-link> to
use to define default column names, table names, and constraints for your
persistent classes. See <fo:basic-link internal-destination="ref_guide_mapping_factory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.5, “
Mapping Factory
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_factory"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_factory"/>]</fo:inline></fo:basic-link> for
details.
</fo:block></fo:block><fo:block id="openjpa.jdbc.MappingFactory"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.jdbc.MappingFactory
</fo:marker><fo:block font-size="17.28pt">2.6.9. 
openjpa.jdbc.MappingFactory
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e15980"><!--
MappingFactory
--></fo:wrapper><fo:wrapper id="d0e15983"><!--
mapping metadata
,
MappingFactory
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.jdbc.MappingFactory</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html#getMappingFactory">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.conf.JDBCConfiguration.getMappingFactory
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
MappingFactory</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/meta/MetaDataFactory.html">
<fo:inline font-family="monospace">org.apache.openjpa.meta.MetaDataFactory</fo:inline></fo:basic-link> to use to
store and retrieve object-relational mapping information for your persistent
classes. See <fo:basic-link internal-destination="ref_guide_mapping_factory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.5, “
Mapping Factory
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_factory"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_factory"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.jdbc.ResultSetType"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.jdbc.ResultSetType
</fo:marker><fo:block font-size="17.28pt">2.6.10. 
openjpa.jdbc.ResultSetType
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e16034"><!--
ResultSetType
--></fo:wrapper><fo:wrapper id="d0e16037"><!--
large result sets
,
ResultSetType
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.jdbc.ResultSetType</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html#getResultSetType">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.conf.JDBCConfiguration.getResultSetType
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
ResultSetType</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">forward-only</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">forward-only</fo:inline>
, <fo:inline font-family="monospace">scroll-sensitive</fo:inline>, <fo:inline font-family="monospace">scroll-insensitive</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The JDBC result set type to use
when fetching result lists. This property can also be varied at runtime. See
<fo:basic-link internal-destination="ref_guide_dbsetup_lrs"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.9, “
Large Result Sets
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_lrs"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_lrs"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.jdbc.Schema"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.jdbc.Schema
</fo:marker><fo:block font-size="17.28pt">2.6.11. 
openjpa.jdbc.Schema
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e16096"><!--
schema
,
Schema
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.jdbc.Schema
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html#getSchema">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.conf.JDBCConfiguration.getSchema
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
Schema</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The default schema name to prepend
to unqualified table names. Also, the schema in which OpenJPA will create new
tables. See <fo:basic-link internal-destination="ref_guide_schema_def"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.10, “
Default Schema
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_schema_def"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_schema_def"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.jdbc.SchemaFactory"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.jdbc.SchemaFactory
</fo:marker><fo:block font-size="17.28pt">2.6.12. 
openjpa.jdbc.SchemaFactory
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e16140"><!--
SchemaFactory
--></fo:wrapper><fo:wrapper id="d0e16143"><!--
schema
,
SchemaFactory
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.jdbc.SchemaFactory</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html#getSchemaFactory">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.conf.JDBCConfiguration.getSchemaFactory
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
SchemaFactory</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">dynamic</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">dynamic</fo:inline>,
<fo:inline font-family="monospace">native</fo:inline>, <fo:inline font-family="monospace">file</fo:inline>, <fo:inline font-family="monospace">table</fo:inline>,
others
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/schema/SchemaFactory.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.schema.SchemaFactory</fo:inline></fo:basic-link> to
use to store and retrieve information about the database schema. See
<fo:basic-link internal-destination="ref_guide_schema_info_factory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.11.2, “
Schema Factory
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_schema_info_factory"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_schema_info_factory"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.jdbc.Schemas"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.jdbc.Schemas
</fo:marker><fo:block font-size="17.28pt">2.6.13. 
openjpa.jdbc.Schemas
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e16212"><!--
schema
,
Schemas
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.jdbc.Schemas
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html#getSchemas">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.conf.JDBCConfiguration.getSchemas
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
Schemas</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A comma-separated list of the
schemas and/or tables used for your persistent data. See
<fo:basic-link internal-destination="ref_guide_schema_info_list"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.11.1, “
Schemas List
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_schema_info_list"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_schema_info_list"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="openjpa.jdbc.SQLFactory"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.jdbc.SQLFactory
</fo:marker><fo:block font-size="17.28pt">2.6.14. 
openjpa.jdbc.SQLFactory
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e16256"><!--
SQLFactory
--></fo:wrapper><fo:wrapper id="d0e16259"><!--
SQL
,
SQLFactory
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">openjpa.jdbc.SQLFactory
</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html#getSQLFactory">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.conf.JDBCConfiguration.getSQLFactory
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
SQLFactory</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">default</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> A plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/sql/SQLFactory.html"><fo:inline font-family="monospace">
org.apache.openjpa.jdbc.sql.SQLFactory</fo:inline></fo:basic-link> to use to abstract
common SQL constructs.
</fo:block></fo:block><fo:block id="openjpa.jdbc.SubclassFetchMode"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.jdbc.SubclassFetchMode
</fo:marker><fo:block font-size="17.28pt">2.6.15. 
openjpa.jdbc.SubclassFetchMode
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e16309"><!--
SubclassFetchMode
--></fo:wrapper><fo:wrapper id="d0e16312"><!--
eager fetching
,
SubclassFetchMode
--></fo:wrapper><fo:wrapper id="d0e16317"><!--
inheritance
,
SubclassFetchMode
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.jdbc.SubclassFetchMode</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html#getSubclassFetchMode">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.conf.JDBCConfiguration.getSubclassFetchMode
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
SubclassFetchMode</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">parallel</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">parallel</fo:inline>,
<fo:inline font-family="monospace">join</fo:inline>, <fo:inline font-family="monospace">none</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> How to select subclass data when
it is in other tables. This setting can also be varied at runtime. See
<fo:basic-link internal-destination="ref_guide_perfpack_eager"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.7, “
Eager Fetching
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_perfpack_eager"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_perfpack_eager"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block><fo:block id="openjpa.jdbc.SynchronizeMappings"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.jdbc.SynchronizeMappings
</fo:marker><fo:block font-size="17.28pt">2.6.16. 
openjpa.jdbc.SynchronizeMappings
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e16376"><!--
SynchronizeMappings
--></fo:wrapper><fo:wrapper id="d0e16379"><!--
mapping metadata
,
SynchronizeMappings
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.jdbc.SynchronizeMappings</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html#getSynchronizeMappings">
<fo:inline font-family="monospace">
org.apache.openjpa.jdbc.conf.JDBCConfiguration.getSynchronizeMappings
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
SynchronizeMappings</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default:</fo:inline> -
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> Controls whether OpenJPA will
attempt to run the mapping tool on all persistent classes to synchronize their
mappings and schema at runtime. Useful for rapid test/debug cycles. See
<fo:basic-link internal-destination="ref_guide_mapping_synch"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.1.3, “
Runtime Forward Mapping
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_synch"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_synch"/>]</fo:inline></fo:basic-link> for more information.
</fo:block></fo:block><fo:block id="openjpa.jdbc.TransactionIsolation"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.jdbc.TransactionIsolation
</fo:marker><fo:block font-size="17.28pt">2.6.17. 
openjpa.jdbc.TransactionIsolation
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e16423"><!--
TransactionIsolation
--></fo:wrapper><fo:wrapper id="d0e16426"><!--
transactions
,
TransactionIsolation
--></fo:wrapper><fo:wrapper id="d0e16431"><!--
JDBC
,
TransactionIsolation
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.jdbc.TransactionIsolation</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html#getTransactionIsolation">
<fo:inline font-family="monospace">
org.apache.openjpa.jdbc.conf.JDBCConfiguration.getTransactionIsolation
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
TransactionIsolation</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">default</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Possible values: </fo:inline><fo:inline font-family="monospace">default</fo:inline>,
<fo:inline font-family="monospace">none</fo:inline>, <fo:inline font-family="monospace">read-committed</fo:inline>, <fo:inline font-family="monospace">
read-uncommitted</fo:inline>, <fo:inline font-family="monospace">repeatable-read</fo:inline>, <fo:inline font-family="monospace">
serializable</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The JDBC transaction isolation
level to use. See <fo:basic-link internal-destination="ref_guide_dbsetup_isolation"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.5, “
Setting the Transaction Isolation
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_isolation"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_isolation"/>]</fo:inline></fo:basic-link> for
details.
</fo:block></fo:block><fo:block id="openjpa.jdbc.UpdateManager"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
openjpa.jdbc.UpdateManager
</fo:marker><fo:block font-size="17.28pt">2.6.18. 
openjpa.jdbc.UpdateManager
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e16499"><!--
UpdateManager
--></fo:wrapper><fo:wrapper id="d0e16502"><!--
JDBC
,
UpdateManager
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Property name: </fo:inline><fo:inline font-family="monospace">
openjpa.jdbc.UpdateManager</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Configuration API:</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html#getUpdateManager">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.conf.JDBCConfiguration.getUpdateManager
</fo:inline></fo:basic-link>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Resource adaptor config-property: </fo:inline><fo:inline font-family="monospace">
UpdateManager</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Default: </fo:inline><fo:inline font-family="monospace">default</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-weight="bold">Description:</fo:inline> The full class name of the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/kernel/UpdateManager.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.kernel.UpdateManager</fo:inline></fo:basic-link> to
use to flush persistent object changes to the datastore. The provided default
implementation is
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/kernel/OperationOrderUpdateManager">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.kernel.OperationOrderUpdateManager</fo:inline>
</fo:basic-link>.
</fo:block></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Logging
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Logging
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="ref_guide_logging"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 3. 
Logging
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e16558"><!--
logging
--></fo:wrapper><fo:wrapper id="d0e16561"><!--
Log
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Logging is an important means of gaining insight into your application's runtime
behavior. OpenJPA provides a flexible logging system that integrates with many
existing runtime systems, such as application servers and servlet runners.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
There are four built-in logging plugins: a
<fo:basic-link internal-destination="ref_guide_logging_openjpa"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">default logging framework</fo:inline></fo:basic-link> that
covers most needs, a <fo:basic-link internal-destination="ref_guide_logging_log4j"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"> Log4J</fo:inline></fo:basic-link>
delegate, an <fo:basic-link internal-destination="ref_guide_logging_commons"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"> Apache Commons Logging
</fo:inline></fo:basic-link> delegate, and a <fo:basic-link internal-destination="ref_guide_logging_noop"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">no-op</fo:inline></fo:basic-link>
implementation for disabling logging.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e16580"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Warning</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Logging can have a negative impact on performance. Disable verbose logging (such
as logging of SQL statements) before running any performance tests. It is
advisable to limit or disable logging for a production system. You can disable
logging altogether by setting the <fo:inline font-family="monospace">openjpa.Log</fo:inline> property to
<fo:inline font-family="monospace">none</fo:inline>.
</fo:block></fo:block></fo:block><fo:block id="ref_guide_logging_channels"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Logging Channels
</fo:marker><fo:block font-size="20.735999999999997pt">3.1. 
Logging Channels
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e16592"><!--
logging
,
channels
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Logging is done over a number of <fo:inline font-style="italic">logging channels</fo:inline>, each of
which has a <fo:inline font-style="italic">logging level</fo:inline> which controls the verbosity of
log messages recorded for the channel. OpenJPA uses the following logging
channels:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e16605"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e16606"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">openjpa.Tool</fo:inline>: Messages issued by the OpenJPA command line
and Ant tools. Most messages are basic statements detailing which classes or
files the tools are running on. Detailed output is only available via the
logging category the tool belongs to, such as <fo:inline font-family="monospace">openjpa.Enhance</fo:inline>
for the enhancer (see <fo:basic-link internal-destination="ref_guide_pc_enhance"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2, “
Enhancement
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_enhance"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_enhance"/>]</fo:inline></fo:basic-link>) or <fo:inline font-family="monospace">
openjpa.MetaData</fo:inline> for the mapping tool (see
<fo:basic-link internal-destination="ref_guide_mapping_mappingtool"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.1, “
Forward Mapping
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_mappingtool"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_mappingtool"/>]</fo:inline></fo:basic-link>). This logging category
is provided so that you can get a general idea of what a tool is doing without
having to manipulate logging settings that might also affect runtime behavior.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e16622"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e16625"><!--
enhancement
,
log messages
--></fo:wrapper>
<fo:inline font-family="monospace">openjpa.Enhance</fo:inline>: Messages pertaining to enhancement and
runtime class generation.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e16634"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e16637"><!--
metadata
,
log messages
--></fo:wrapper>
<fo:inline font-family="monospace">openjpa.MetaData</fo:inline>: Details about the generation of metadata
and object-relational mappings.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e16646"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">openjpa.Runtime</fo:inline>: General OpenJPA runtime messages.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e16652"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e16655"><!--
Query
,
log messages
--></fo:wrapper>
<fo:inline font-family="monospace">openjpa.Query</fo:inline>: Messages about queries. Query strings and any
parameter values, if applicable, will be logged to the <fo:inline font-family="monospace">TRACE</fo:inline>
level at execution time. Information about possible performance concerns will be
logged to the <fo:inline font-family="monospace">INFO</fo:inline> level.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e16670"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e16673"><!--
caching
,
log messages
--></fo:wrapper>
<fo:inline font-family="monospace">openjpa.DataCache</fo:inline>: Messages from the L2 data cache plugins.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e16682"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e16685"><!--
JDBC
,
log messages
--></fo:wrapper>
<fo:inline font-family="monospace">openjpa.jdbc.JDBC</fo:inline>: JDBC connection information. General JDBC
information will be logged to the <fo:inline font-family="monospace">TRACE</fo:inline> level. Information
about possible performance concerns will be logged to the <fo:inline font-family="monospace">INFO
</fo:inline> level.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e16700"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e16703"><!--
SQL
,
log messages
--></fo:wrapper>
<fo:inline font-family="monospace">openjpa.jdbc.SQL</fo:inline>: This is the most common logging channel to
use. Detailed information about the execution of SQL statements will be sent to
the <fo:inline font-family="monospace">TRACE</fo:inline> level. It is useful to enable this channel if you
are curious about the exact SQL that OpenJPA issues to the datastore.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When using the built-in OpenJPA logging facilities, you can enable SQL logging
by adding <fo:inline font-family="monospace">SQL=TRACE</fo:inline> to your <fo:inline font-family="monospace">openjpa.Log</fo:inline>
property.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA can optionally reformat the logged SQL to make it easier to read. To
enable pretty-printing, add <fo:inline font-family="monospace">PrettyPrint=true</fo:inline> to the
<fo:basic-link internal-destination="openjpa.ConnectionFactoryProperties"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.ConnectionFactoryProperties</fo:inline></fo:inline></fo:basic-link> property. You can control
how many columns wide the pretty-printed SQL will be with the <fo:inline font-family="monospace">
PrettyPrintLineLength</fo:inline> property. The default line length is 60 columns.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
While pretty printing makes things easier to read, it can make output harder to
process with tools like grep.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Pretty-printing properties configuration might look like so:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e16739">
&lt;property name="openjpa.Log" value="SQL=TRACE"/&gt;
&lt;property name="openjpa.ConnectionFactoryProperties"
value="PrettyPrint=true, PrettyPrintLineLength=72"/&gt;
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e16741"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e16744"><!--
schema
,
log messages
--></fo:wrapper>
<fo:inline font-family="monospace">openjpa.jdbc.Schema</fo:inline>: Details about operations on the
database schema.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="ref_guide_logging_openjpa"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
OpenJPA Logging
</fo:marker><fo:block font-size="20.735999999999997pt">3.2. 
OpenJPA Logging
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e16756"><!--
logging
,
default
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
By default, OpenJPA uses a basic logging framework with the following output
format:
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-family="monospace">millis</fo:inline>  <fo:inline font-family="monospace">diagnostic context</fo:inline>  <fo:inline font-family="monospace">level</fo:inline>  [<fo:inline font-family="monospace">thread name</fo:inline>]  <fo:inline font-family="monospace">channel</fo:inline> - <fo:inline font-family="monospace">message</fo:inline>
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
For example, when loading an application that uses OpenJPA, a message like the
following will be sent to the <fo:inline font-family="monospace">openjpa.Runtime</fo:inline> channel:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e16788">
2107 INFO [main] openjpa.Runtime - Starting OpenJPA 0.9.7
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The default logging system accepts the following parameters:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e16792"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e16793"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">File</fo:inline>: The name of the file to log to, or <fo:inline font-family="monospace">stdout
</fo:inline> or <fo:inline font-family="monospace">stderr</fo:inline> to send messages to standard out and
standard error, respectively. By default, OpenJPA sends log messages to standard
error.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e16805"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">DefaultLevel</fo:inline>: The default logging level of unconfigured
channels. Recognized values are <fo:inline font-family="monospace"> TRACE, DEBUG, INFO, WARN,</fo:inline>
and <fo:inline font-family="monospace">ERROR</fo:inline>. Defaults to <fo:inline font-family="monospace">INFO</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e16820"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">DiagnosticContext</fo:inline>: A string that will be prepended to all
log messages. If this is not supplied and a <fo:inline font-family="monospace">openjpa.Id</fo:inline>
property value is available, that value will be used.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e16829"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">&lt;channel&gt;</fo:inline>: Using the last token of the
<fo:basic-link internal-destination="ref_guide_logging_channels"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">logging channel</fo:inline></fo:basic-link> name, you can
configure the log level to use for that channel. See the examples below.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_logging_openjpa_std_ex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 3.1. 
Standard OpenJPA Log Configuration
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e16841">
&lt;property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO, Tool=INFO"/&gt;
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_logging_openjpa_sql_ex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 3.2. 
Standard OpenJPA Log Configuration + All SQL Statements
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e16846">
&lt;property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE"/&gt;
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_logging_openjpa_file"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 3.3. 
Logging to a File
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e16851">
&lt;property name="openjpa.Log" value="File=/tmp/org.apache.openjpa.log, DefaultLevel=WARN, Runtime=INFO, Tool=INFO"/&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_logging_noop"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Disabling Logging
</fo:marker><fo:block font-size="20.735999999999997pt">3.3. 
Disabling Logging
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e16856"><!--
logging
,
disabling
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Disabling logging can be useful to analyze performance without any I/O overhead
or to reduce verbosity at the console. To do this, set the <fo:inline font-family="monospace">openjpa.Log
</fo:inline> property to <fo:inline font-family="monospace">none</fo:inline>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Disabling logging permanently, however, will cause all warnings to be consumed.
We recommend using one of the more sophisticated mechanisms described in this
chapter.
</fo:block></fo:block><fo:block id="ref_guide_logging_log4j"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Log4J
</fo:marker><fo:block font-size="20.735999999999997pt">3.4. 
Log4J
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e16874"><!--
logging
,
Log4j
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When <fo:inline font-family="monospace">openjpa.Log</fo:inline> is set to <fo:inline font-family="monospace">log4j</fo:inline>, OpenJPA
will delegate to Log4J for logging. In a standalone application, Log4J logging
levels are controlled by a resource named <fo:inline font-family="monospace">log4j.properties</fo:inline>
, which should be available as a top-level resource (either at the top level of
a jar file, or in the root of one of the <fo:inline font-family="monospace">CLASSPATH</fo:inline>
directories). When deploying to a web or EJB application server, Log4J
configuration is often performed in a <fo:inline font-family="monospace">log4j.xml</fo:inline> file
instead of a properties file. For further details on configuring Log4J, please
see the <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://jakarta.apache.org/log4j/docs/manual.html">Log4J
Manual</fo:basic-link>. We present an example <fo:inline font-family="monospace">log4j.properties</fo:inline> file
below.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_logging_log4j_ex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 3.4. 
Standard Log4J Logging
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e16905">
log4j.rootCategory=WARN, console
log4j.category.openjpa.Tool=INFO
log4j.category.openjpa.Runtime=INFO
log4j.category.openjpa.Remote=WARN
log4j.category.openjpa.DataCache=WARN
log4j.category.openjpa.MetaData=WARN
log4j.category.openjpa.Enhance=WARN
log4j.category.openjpa.Query=WARN
log4j.category.openjpa.jdbc.SQL=WARN
log4j.category.openjpa.jdbc.JDBC=WARN
log4j.category.openjpa.jdbc.Schema=WARN
log4j.appender.console=org.apache.log4j.ConsoleAppender
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_logging_commons"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Apache Commons Logging
</fo:marker><fo:block font-size="20.735999999999997pt">3.5. 
Apache Commons Logging
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e16910"><!--
logging
,
Apache Commons
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Set the <fo:inline font-family="monospace">openjpa.Log</fo:inline> property to <fo:inline font-family="monospace">commons</fo:inline> to
use the <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://jakarta.apache.org/commons/logging.html"> Apache
Jakarta Commons Logging</fo:basic-link> thin library for issuing log messages. The
Commons Logging libraries act as a wrapper around a number of popular logging
APIs, including the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://jakarta.apache.org/log4j/docs/index.html"> Jakarta Log4J
</fo:basic-link> project, and the native
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/package-summary.html">
java.util.logging</fo:basic-link> package in JDK 1.4. If neither of these libraries are
available, then logging will fall back to using simple console logging.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When using the Commons Logging framework in conjunction with Log4J,
configuration will be the same as was discussed in the Log4J section above.
</fo:block><fo:block id="ref_guide_logging_jdk14"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
JDK 1.4 java.util.logging
</fo:marker><fo:block font-size="17.28pt">3.5.1. 
JDK 1.4 java.util.logging
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e16937"><!--
logging
,
JDK 1.4
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When using JDK 1.4 or higher in conjunction with OpenJPA's Commons Logging
support, logging will proceed through Java's built-in logging provided by the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/package-summary.html">
java.util.logging</fo:basic-link> package. For details on configuring the built-in
logging system, please see the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/j2se/1.4/docs/guide/util/logging/overview.html">
Java Logging Overview</fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
By default, JDK 1.4's logging package looks in the <fo:inline font-family="monospace">
JAVA_HOME/lib/logging.properties</fo:inline> file for logging configuration. This
can be overridden with the <fo:inline font-family="monospace"> java.util.logging.config.file</fo:inline>
system property. For example:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e16958">
java -Djava.util.logging.config.file=mylogging.properties com.company.MyClass
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_logging_jdk14_propfile"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 3.5. 
JDK 1.4 Log Properties
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e16963">
# specify the handlers to create in the root logger
# (all loggers are children of the root logger)
# the following creates two handlers
handlers=java.util.logging.ConsoleHandler, java.util.logging.FileHandler
# set the default logging level for the root logger
.level=ALL
# set the default logging level for new ConsoleHandler instances
java.util.logging.ConsoleHandler.level=INFO
# set the default logging level for new FileHandler instances
java.util.logging.FileHandler.level=ALL
# set the default formatter for new ConsoleHandler instances
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
# set the default logging level for all OpenJPA logs
openjpa.Tool.level=INFO
openjpa.Runtime.level=INFO
openjpa.Remote.level=INFO
openjpa.DataCache.level=INFO
openjpa.MetaData.level=INFO
openjpa.Enhance.level=INFO
openjpa.Query.level=INFO
openjpa.jdbc.SQL.level=INFO
openjpa.jdbc.JDBC.level=INFO
openjpa.jdbc.Schema.level=INFO
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_logging_custom"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Custom Log
</fo:marker><fo:block font-size="20.735999999999997pt">3.6. 
Custom Log
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e16968"><!--
logging
,
custom
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If none of available logging systems meet your needs, you can configure the
logging system with a custom logger. You might use custom logging to integrate
with a proprietary logging framework used by some applications servers, or for
logging to a graphical component for GUI applications.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A custom logging framework must include an implementation of the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/lib/log/LogFactory.html"><fo:inline font-family="monospace">
org.apache.openjpa.lib.log.LogFactory</fo:inline></fo:basic-link> interface. We present
a custom <fo:inline font-family="monospace">LogFactory</fo:inline> below.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_logging_custom_ex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 3.6. 
Custom Logging Class
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e16987">
package com.xyz;
import org.apache.openjpa.lib.log.*;
public class CustomLogFactory
implements LogFactory {
private String _prefix = "CUSTOM LOG";
public void setPrefix (String prefix) {
_prefix = prefix;
}
public Log getLog(String channel) {
// Return a simple extension of AbstractLog that will log
// everything to the System.err stream. Note that this is
// roughly equivalent to OpenJPA's default logging behavior.
return new AbstractLog() {
protected boolean isEnabled(short logLevel) {
// log all levels
return true;
}
protected void log (short type, String message, Throwable t) {
// just send everything to System.err
System.err.println(_prefix + ": " + type + ": "
+ message + ": " + t);
}
};
}
}
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To make OpenJPA use your custom log factory, set the
<fo:basic-link internal-destination="openjpa.Log"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">openjpa.Log</fo:inline></fo:inline></fo:basic-link> configuration
property to your factory's full class name. Because this property is a plugin
property (see <fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link> ), you can also
pass parameters to your factory. For example, to use the example factory above
and set its prefix to "LOG MSG", you would set the <fo:inline font-family="monospace">openjpa.Log
</fo:inline> property to the following string:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e17000">
com.xyz.CustomLogFactory(Prefix="LOG MSG")
</fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
JDBC
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
JDBC
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="ref_guide_dbsetup"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 4. 
JDBC
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e17006"><!--
JDBC
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA uses a relational database for object persistence.
It communicates with the database using the Java DataBase Connectivity (JDBC)
APIs. This chapter describes how to configure OpenJPA to work with the JDBC
driver for your database, and how to access JDBC functionality at runtime.
</fo:block><fo:block id="ref_guide_dbsetup_builtin"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Using the OpenJPA DataSource
</fo:marker><fo:block font-size="20.735999999999997pt">4.1. 
Using the OpenJPA DataSource
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e17014"><!--
DataSource
,
OpenJPA
--></fo:wrapper><fo:wrapper id="d0e17019"><!--
connections
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA includes its own simple <fo:inline font-family="monospace">javax.sql.DataSource</fo:inline>
implementation. If you choose to use OpenJPA's <fo:inline font-family="monospace">DataSource
</fo:inline>, then you must specify the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e17032"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17033"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17036"><!--
ConnectionUserName
--></fo:wrapper>
<fo:inline font-family="monospace">openjpa.ConnectionUserName</fo:inline>: The JDBC user name for
connecting to the database.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17043"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17046"><!--
ConnectionPassword
--></fo:wrapper>
<fo:inline font-family="monospace">openjpa.ConnectionPassword</fo:inline>: The JDBC password for the above
user.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17053"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17056"><!--
ConnectionURL
--></fo:wrapper>
<fo:inline font-family="monospace">openjpa.ConnectionURL</fo:inline>: The JDBC URL for the database.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17063"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17066"><!--
ConnectionDriverName
--></fo:wrapper>
<fo:inline font-family="monospace">openjpa.ConnectionDriverName</fo:inline>: The JDBC driver class.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To configure advanced features, use the following optional
properties. The syntax of these property strings follows the syntax of OpenJPA
plugin parameters described in <fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e17077"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17078"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17081"><!--
ConnectionProperties
--></fo:wrapper>
<fo:basic-link internal-destination="openjpa.ConnectionProperties"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.ConnectionProperties</fo:inline></fo:inline></fo:basic-link>: If the listed driver is an
instance of <fo:inline font-family="monospace">java.sql.Driver</fo:inline>, this string will be parsed
into a <fo:inline font-family="monospace">Properties</fo:inline> instance, which will then be used to
obtain database connections through the <fo:inline font-family="monospace">Driver.connect(String url,
Properties props)</fo:inline> method. If, on the other hand, the listed driver
is a <fo:inline font-family="monospace"> javax.sql.DataSource</fo:inline>, the string will be treated
as a plugin properties string, and matched to the bean setter methods of the
<fo:inline font-family="monospace">DataSource</fo:inline> instance.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17104"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17107"><!--
ConnectionFactoryProperties
--></fo:wrapper>
<fo:basic-link internal-destination="openjpa.ConnectionFactoryProperties"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.ConnectionFactoryProperties</fo:inline></fo:inline></fo:basic-link>: OpenJPA's built-in
<fo:inline font-family="monospace">DataSource</fo:inline> allows you to set the following options via
this plugin string:
</fo:block><fo:list-block provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e17118"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17119"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17122"><!--
JDBC
,
QueryTimeout
--></fo:wrapper>
<fo:inline font-family="monospace">QueryTimeout</fo:inline>: The maximum number of seconds the JDBC driver
will wait for a statement to execute.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17131"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17134"><!--
SQL
,
PrettyPrint
--></fo:wrapper>
<fo:inline font-family="monospace">PrettyPrint</fo:inline>: Boolean indicating whether to pretty-print
logged SQL statements.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17143"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17146"><!--
SQL
,
PrettyPrintLineLength
--></fo:wrapper>
<fo:inline font-family="monospace">PrettyPrintLineLength</fo:inline>: The maximum number of characters in
each pretty-printed SQL line.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_dbsetup_builtin_ex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.1. 
Properties for the OpenJPA DataSource
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e17158">
&lt;property name="openjpa.ConnectionUserName" value="user"/&gt;
&lt;property name="openjpa.ConnectionPassword" value="pass"/&gt;
&lt;property name="openjpa.ConnectionURL" value="jdbc:hsqldb:db-hypersonic"/&gt;
&lt;property name="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver"/&gt;
&lt;property name="openjpa.ConnectionFactoryProperties"
value="PrettyPrint=true, PrettyPrintLineLength=80"/&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_dbsetup_thirdparty"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Using a Third-Party DataSource
</fo:marker><fo:block font-size="20.735999999999997pt">4.2. 
Using a Third-Party DataSource
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e17163"><!--
DataSource
,
third party
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can use OpenJPA with any third-party <fo:inline font-family="monospace">javax.sql.DataSource
</fo:inline>. There are multiple ways of telling OpenJPA about a <fo:inline font-family="monospace">
DataSource</fo:inline>:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e17176"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17177"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17180"><!--
ConnectionFactory
--></fo:wrapper>
Set the <fo:inline font-family="monospace">DataSource</fo:inline> into the map passed to <fo:inline font-family="monospace">
Persistence.createEntityManagerFactory</fo:inline> under the
<fo:basic-link internal-destination="openjpa.ConnectionFactory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">openjpa.ConnectionFactory
</fo:inline></fo:inline></fo:basic-link> key.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17194"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17197"><!--
ConnectionFactoryName
--></fo:wrapper>
Bind the <fo:inline font-family="monospace">DataSource</fo:inline> into JNDI, and then specify its
location in the <fo:inline font-family="monospace">jta-data-source</fo:inline> or <fo:inline font-family="monospace">
non-jta-data-source</fo:inline> element of the
<fo:basic-link internal-destination="jpa_overview_persistence_xml"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">JPA XML format</fo:inline></fo:basic-link> (depending on
whether the <fo:inline font-family="monospace">DataSource</fo:inline> is managed by JTA), or in the
<fo:basic-link internal-destination="openjpa.ConnectionFactoryName"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.ConnectionFactoryName</fo:inline></fo:inline></fo:basic-link> property.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17220"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17223"><!--
ConnectionDriverName
--></fo:wrapper>
Specify the full class name of the <fo:inline font-family="monospace">DataSource</fo:inline>
implementation in the <fo:basic-link internal-destination="openjpa.ConnectionDriverName"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.ConnectionDriverName</fo:inline></fo:inline></fo:basic-link> property in place of a JDBC
driver. In this configuration OpenJPA will instantiate an instance of the named
class via reflection. It will then configure the <fo:inline font-family="monospace">DataSource
</fo:inline> with the properties in the
<fo:basic-link internal-destination="openjpa.ConnectionProperties"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.ConnectionProperties</fo:inline></fo:inline></fo:basic-link> setting.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The features of OpenJPA's own <fo:inline font-family="monospace">DataSource</fo:inline> can
also be used with third-party implementations. OpenJPA layers on top of the
third-party <fo:inline font-family="monospace">DataSource</fo:inline> to provide the extra
functionality. To configure these features use the
<fo:basic-link internal-destination="openjpa.ConnectionFactoryProperties"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">
<fo:inline font-family="monospace">openjpa.ConnectionFactoryProperties</fo:inline></fo:inline></fo:basic-link> property described
in the previous section.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_dbsetup_thirdparty_ex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.2. 
Properties File for a Third-Party DataSource
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e17257">
&lt;property name="openjpa.ConnectionDriverName" value="oracle.jdbc.pool.OracleDataSource"/&gt;
&lt;property name="openjpa.ConnectionProperties"
value="PortNumber=1521, ServerName=saturn, DatabaseName=solarsid, DriverType=thin"/&gt;
&lt;property name="openjpa.ConnectionFactoryProperties" value="QueryTimeout=5000"/&gt;
</fo:block></fo:block></fo:block><fo:block id="ref_guide_dbsetup_thirdparty_enlist"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Managed and XA DataSources
</fo:marker><fo:block font-size="17.28pt">4.2.1. 
Managed and XA DataSources
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e17262"><!--
DataSource
,
managed
--></fo:wrapper><fo:wrapper id="d0e17267"><!--
DataSource
,
XA
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e17274"><!--
ConnectionFactoryMode
--></fo:wrapper>
Certain application servers automatically enlist their <fo:inline font-family="monospace"> DataSource
</fo:inline>s in global transactions. When this is the case, OpenJPA should not
attempt to commit the underlying connection, leaving JDBC transaction completion
to the application server. To notify OpenJPA that your third-party <fo:inline font-family="monospace">
DataSource</fo:inline> is managed by the application server, use the
<fo:inline font-family="monospace">jta-data-source</fo:inline> element of your <fo:inline font-family="monospace">
persistence.xml</fo:inline> file or set the
<fo:basic-link internal-destination="openjpa.ConnectionFactoryMode"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.ConnectionFactoryMode</fo:inline></fo:inline></fo:basic-link> property to <fo:inline font-family="monospace">
managed</fo:inline>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Note that OpenJPA can only use managed <fo:inline font-family="monospace">DataSource</fo:inline>s when
it is also integrating with the application server's managed transactions. Also
note that all XA <fo:inline font-family="monospace">DataSource</fo:inline>s are enlisted, and you must
set this property when using any XA <fo:inline font-family="monospace"> DataSource</fo:inline>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When using a managed <fo:inline font-family="monospace">DataSource</fo:inline>, you should also
configure a second unmanaged <fo:inline font-family="monospace">DataSource</fo:inline> that OpenJPA can
use to perform tasks that are independent of the global transaction. The most
common of these tasks is updating the sequence table OpenJPA uses to generate
unique primary key values for your datastore identity objects. Configure the
second <fo:inline font-family="monospace">DataSource</fo:inline> using the <fo:inline font-family="monospace">non-jta-data-source
</fo:inline> <fo:inline font-family="monospace">persistence.xml</fo:inline> element, or OpenJPA's various
"2" connection properties, such as <fo:inline font-family="monospace">openjpa.ConnectionFactory2Name
</fo:inline> or <fo:inline font-family="monospace">openjpa.Connection2DriverName</fo:inline>. These
properties are outlined in <fo:basic-link internal-destination="ref_guide_conf"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 2, <fo:inline font-style="italic">
Configuration
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_enterprise_xa_conf_ex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.3. 
Managed DataSource Configuration
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e17336">
&lt;!-- managed DataSource --&gt;
&lt;jta-data-source&gt;java:/OracleXASource&lt;/jta-data-source&gt;
&lt;properties&gt;
&lt;!-- use OpenJPA's built-in DataSource for unmanaged connections --&gt;
&lt;property name="openjpa.Connection2UserName" value="scott"/&gt;
&lt;property name="openjpa.Connection2Password" value="tiger"/&gt;
&lt;property name="openjpa.Connection2URL" value="jdbc:oracle:thin:@CROM:1521:OpenJPADB"/&gt;
&lt;property name="openjpa.Connection2DriverName" value="oracle.jdbc.driver.OracleDriver"/&gt;
&lt;/properties&gt;
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_dbsetup_sqlconn"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Runtime Access to DataSource
</fo:marker><fo:block font-size="20.735999999999997pt">4.3. 
Runtime Access to DataSource
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e17341"><!--
connections
,
accessing DataSource
--></fo:wrapper><fo:wrapper id="d0e17346"><!--
JDBC
,
accessing DataSource
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The JPA standard defines how to access JDBC connections from enterprise beans.
OpenJPA also provides APIs to access an <fo:inline font-family="monospace">EntityManager</fo:inline>'s
connection, or to retrieve a connection directly from the <fo:inline font-family="monospace">
EntityManagerFactory</fo:inline>'s <fo:inline font-family="monospace">DataSource</fo:inline>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/OpenJPAEntityManager.html">
<fo:inline font-family="monospace">OpenJPAEntityManager.getConnection</fo:inline></fo:basic-link> method
returns an <fo:inline font-family="monospace">EntityManager</fo:inline>'s connection. If the <fo:inline font-family="monospace">
EntityManager</fo:inline> does not already have a connection, it will obtain
one. The returned connection is only guaranteed to be transactionally consistent
with other <fo:inline font-family="monospace">EntityManager</fo:inline> operations if the <fo:inline font-family="monospace">
EntityManager</fo:inline> is in a managed or non-optimistic transaction, if the
<fo:inline font-family="monospace">EntityManager</fo:inline> has flushed in the current transaction, or
if you have used the <fo:inline font-family="monospace">OpenJPAEntityManager.beginStore</fo:inline>
method to ensure that a datastore transaction is in progress. Always close the
returned connection before attempting any other <fo:inline font-family="monospace">EntityManager
</fo:inline> operations. OpenJPA will ensure that the underlying native
connection is not released if a datastore transaction is in progress.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_dbsetup_conn_jpa"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.4. 
Using the EntityManager's Connection
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e17393">
import java.sql.*;
import org.apache.openjpa.persistence.*;
...
OpenJPAEntityManager kem = OpenJPAPersistence.cast(em);
Connection conn = (Connection) kem.getConnection();
// do JDBC stuff
conn.close();
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The example below shows how to use a connection directly from the <fo:inline font-family="monospace">
DataSource</fo:inline>, rather than using an <fo:inline font-family="monospace"> EntityManager
</fo:inline>'s connection.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_dbsetup_conn_from_factory_jpa"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.5. 
Using the EntityManagerFactory's DataSource
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e17406">
import java.sql.*;
import javax.sql.*;
import org.apache.openjpa.conf.*;
import org.apache.openjpa.persistence.*;
...
OpenJPAEntityManagerFactory kemf = OpenJPAPersistence.cast(emf);
OpenJPAConfiguration conf = kemf.getConfiguration();
DataSource dataSource = (DataSource) conf.getConnectionFactory();
Connection conn = dataSource.getConnection();
// do JDBC stuff
conn.close();
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_dbsetup_dbsupport"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Database Support
</fo:marker><fo:block font-size="20.735999999999997pt">4.4. 
Database Support
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e17411"><!--
DBDictionary
--></fo:wrapper><fo:wrapper id="d0e17414"><!--
relational database
,
OpenJPA support
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA can take advantage of any JDBC 2.x compliant
driver, making almost any major database a candidate for use. See our officially
supported database list in <fo:basic-link internal-destination="supported_databases"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Appendix 2, <fo:inline font-style="italic">
Supported Databases
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="supported_databases"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="supported_databases"/>]</fo:inline></fo:basic-link> for more
information. Typically, OpenJPA auto-configures its JDBC behavior and SQL
dialect for your database, based on the values of your connection-related
configuration properties.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If OpenJPA cannot detect what type of database you are using, or if you are
using an unsupported database, you will have to tell OpenJPA what
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/sql/DBDictionary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.sql.DBDictionary</fo:inline></fo:basic-link> to use.
The <fo:inline font-family="monospace">DBDictionary</fo:inline> abstracts away the differences between
databases. You can plug a dictionary into OpenJPA using the
<fo:basic-link internal-destination="openjpa.jdbc.DBDictionary"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">openjpa.jdbc.DBDictionary
</fo:inline></fo:inline></fo:basic-link> configuration property. The built-in dictionaries are listed
below. If you are using an unsupported database, you may have to write your own
<fo:inline font-family="monospace">DBDictionary</fo:inline> subclass, a simple process.
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e17442"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17443"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17446"><!--
Microsoft Access
--></fo:wrapper>
<fo:inline font-family="monospace">access</fo:inline>: Dictionary for Microsoft Access. This is an alias
for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/sql/AccessDictionary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.sql.AccessDictionary</fo:inline></fo:basic-link>
class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17458"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17461"><!--
DB2
--></fo:wrapper>
<fo:inline font-family="monospace">db2</fo:inline>: Dictionary for IBM's DB2 database. This is an alias for
the <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/sql/DB2Dictionary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.sql.DB2Dictionary</fo:inline></fo:basic-link> class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17473"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17476"><!--
Derby
--></fo:wrapper>
<fo:inline font-family="monospace">derby</fo:inline>: Dictionary for the Apache Derby database. This is an
alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/sql/DerbyDictionary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.sql.DerbyDictionary</fo:inline> class.
</fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17489"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17492"><!--
Empress
--></fo:wrapper>
<fo:inline font-family="monospace">empress</fo:inline>: Dictionary for Empress database This is an alias
for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/sql/EmpressDictionary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.sql.EmpressDictionary</fo:inline></fo:basic-link>
class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17504"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17507"><!--
FoxPro
--></fo:wrapper>
<fo:inline font-family="monospace">foxpro</fo:inline>: Dictionary for Microsoft Visual FoxPro. This is an
alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/sql/FoxProDictionary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.sql.FoxProDictionary</fo:inline></fo:basic-link>
class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17519"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17522"><!--
Hypersonic SQL
--></fo:wrapper>
<fo:inline font-family="monospace">hsql</fo:inline>: Dictionary for the Hypersonic SQL database. This is an
alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/sql/HSQLDictionary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.sql.HSQLDictionary</fo:inline></fo:basic-link> class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17534"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17537"><!--
Informix
--></fo:wrapper>
<fo:inline font-family="monospace">informix</fo:inline>: Dictionary for the Informix database. This is an
alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/sql/InformixDictionary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.sql.InformixDictionary</fo:inline></fo:basic-link>
class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17549"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17552"><!--
JDataStore
--></fo:wrapper>
<fo:inline font-family="monospace">jdatastore</fo:inline>: Dictionary for Borland JDataStore. This is an
alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/sql/JDataStoreDictionary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.sql.JDataStoreDictionary</fo:inline></fo:basic-link>
class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17564"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17567"><!--
MySQL
--></fo:wrapper>
<fo:inline font-family="monospace">mysql</fo:inline>: Dictionary for the MySQL database. This is an alias
for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/sql/MySQLDictionary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.sql.MySQLDictionary</fo:inline></fo:basic-link>
class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17579"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17582"><!--
Oracle
--></fo:wrapper>
<fo:inline font-family="monospace">oracle</fo:inline>: Dictionary for Oracle. This is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/sql/OracleDictionary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.sql.OracleDictionary</fo:inline></fo:basic-link>
class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17594"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17597"><!--
Pointbase
--></fo:wrapper>
<fo:inline font-family="monospace">pointbase</fo:inline>: Dictionary for Pointbase Embedded database. This
is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/sql/PointbaseDictionary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.sql.PointbaseDictionary</fo:inline></fo:basic-link>
class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17609"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17612"><!--
PostgreSQL
--></fo:wrapper>
<fo:inline font-family="monospace">postgres</fo:inline>: Dictionary for PostgreSQL. This is an alias for
the <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/sql/PostgresDictionary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.sql.PostgresDictionary</fo:inline></fo:basic-link>
class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17624"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17627"><!--
SQLServer
--></fo:wrapper>
<fo:inline font-family="monospace">sqlserver</fo:inline>: Dictionary for Microsoft's SQLServer database.
This is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/sql/SQLServerDictionary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.sql.SQLServerDictionary</fo:inline></fo:basic-link>
class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e17639"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17642"><!--
Sybase
--></fo:wrapper>
<fo:inline font-family="monospace">sybase</fo:inline>: Dictionary for Sybase. This is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/sql/SybaseDictionary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.sql.SybaseDictionary</fo:inline></fo:basic-link>
class.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The example below demonstrates how to set a dictionary and configure its
properties in your configuration file. The <fo:inline font-family="monospace">DBDictionary</fo:inline>
property uses OpenJPA's <fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">plugin syntax
</fo:inline></fo:basic-link>.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_dbsetup_dbdict"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.6. 
Specifying a DBDictionary
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e17665">
&lt;property name="openjpa.jdbc.DBDictionary" value="hsql(SimulateLocking=true)"/&gt;
</fo:block></fo:block></fo:block><fo:block id="ref_guide_dbsetup_dbdictprops"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
DBDictionary Properties
</fo:marker><fo:block font-size="17.28pt">4.4.1. 
DBDictionary Properties
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The standard dictionaries all recognize the following properties. These
properties will usually not need to be overridden, since the dictionary
implementation should use the appropriate default values for your database. You
typically won't use these properties unless you are designing your own
<fo:inline font-family="monospace">DBDictionary</fo:inline> for an unsupported database.
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e17675"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.DriverVendor"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17679"><!--
JDBC
,
DriverVendor
--></fo:wrapper>
<fo:inline font-family="monospace">DriverVendor</fo:inline>: The vendor of the particular JDBC driver you
are using. Some dictionaries must alter their behavior depending on the driver
vendor. See the <fo:inline font-family="monospace">VENDOR_XXX</fo:inline> constants defined in your
dictionary's Javadoc for available options.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.CatalogSeparator"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17694"><!--
SQL
,
CatalogSeparator
--></fo:wrapper>
<fo:inline font-family="monospace">CatalogSeparator</fo:inline>: The string the database uses to delimit
between the schema name and the table name. This is typically <fo:inline font-family="monospace">"."
</fo:inline>, which is the default.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.CreatePrimaryKeys"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17709"><!--
DDL
,
CreatePrimaryKeys
--></fo:wrapper>
<fo:inline font-family="monospace">CreatePrimaryKeys</fo:inline>: If <fo:inline font-family="monospace">false</fo:inline>, then do not
create database primary keys for identifiers. Defaults to <fo:inline font-family="monospace">true
</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.ConstraintNameMode"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17727"><!--
DDL
,
ConstraintNameMode
--></fo:wrapper>
<fo:inline font-family="monospace">ConstraintNameMode</fo:inline>: When creating constraints, whether to
put the constraint name before the definition (<fo:inline font-family="monospace">before</fo:inline>),
just after the constraint type name (<fo:inline font-family="monospace">mid</fo:inline>), or after the
constraint definition (<fo:inline font-family="monospace">after</fo:inline>). Defaults to <fo:inline font-family="monospace">before
</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.MaxTableNameLength"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17751"><!--
DDL
,
MaxTableNameLength
--></fo:wrapper>
<fo:inline font-family="monospace">MaxTableNameLength</fo:inline>: The maximum number of characters in a
table name. Defaults to 128.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.MaxColumnNameLength"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17763"><!--
DDL
,
MaxColumnNameLength
--></fo:wrapper>
<fo:inline font-family="monospace">MaxColumnNameLength</fo:inline>: The maximum number of characters in a
column name. Defaults to 128.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.MaxConstraintNameLength"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17775"><!--
DDL
,
MaxConstraintNameLength
--></fo:wrapper>
<fo:inline font-family="monospace">MaxConstraintNameLength</fo:inline>: The maximum number of characters in
a constraint name. Defaults to 128.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.MaxIndexNameLength"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17787"><!--
DDL
,
MaxIndexNameLength
--></fo:wrapper>
<fo:wrapper id="d0e17793"><!--
indexes
,
MaxIndexNameLength
--></fo:wrapper>
<fo:inline font-family="monospace">MaxIndexNameLength</fo:inline>: The maximum number of characters in an
index name. Defaults to 128.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.MaxAutoAssignNameLength"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17805"><!--
DDL
,
MaxAutoAssignNameLength
--></fo:wrapper>
<fo:inline font-family="monospace">MaxAutoAssignNameLength</fo:inline>: Set this property to the maximum
length of name for sequences used for auto-increment columns. Names longer than
this value are truncated. Defaults to <fo:inline font-family="monospace">31</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.MaxIndexesPerTable"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17820"><!--
indexes
,
MaxIndexesPerTable
--></fo:wrapper>
<fo:inline font-family="monospace">MaxIndexesPerTable</fo:inline>: The maximum number of indexes that can
be placed on a single table. Defaults to no limit.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsForeignKeys"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17832"><!--
foreign keys
,
SupportsForeignKeys
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsForeignKeys</fo:inline>: Whether the database supports foreign
keys. Defaults to true.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsTimestampNanos"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17844"><!--
SupportsTimestampNanos
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsTimestampNanos</fo:inline>: Whether the database supports nanoseconds with TIMESTAMP columns. Defaults to true.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsUniqueConstraints"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17854"><!--
unique constraints
,
SupportsUniqueConstraints
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsUniqueConstraints</fo:inline>: Whether the database supports
unique constraints. Defaults to true.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsDeferredConstraints"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17866"><!--
foreign keys
,
SupportsDeferredConstraints
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsDeferredConstraints</fo:inline>: Whether the database supports
deferred constraints. Defaults to true.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsRestrictDeleteAction"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17878"><!--
foreign keys
,
SupportsRestrictDeleteAction
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsRestrictDeleteAction</fo:inline>: Whether the database supports
the RESTRICT foreign key delete action. Defaults to <fo:inline font-family="monospace">true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsCascadeDeleteAction"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17893"><!--
foreign keys
,
SupportsCascadeDeleteAction
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsCascadeDeleteAction</fo:inline>: Whether the database supports
the CASCADE foreign key delete action. Defaults to <fo:inline font-family="monospace">true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsNullDeleteAction"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17908"><!--
foreign keys
,
SupportsNullDeleteAction
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsNullDeleteAction</fo:inline>: Whether the database supports the
SET NULL foreign key delete action. Defaults to <fo:inline font-family="monospace">true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsDefaultDeleteAction"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17923"><!--
foreign keys
,
SupportsDefaultDeleteAction
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsDefaultDeleteAction</fo:inline>: Whether the database supports
the SET DEFAULT foreign key delete action. Defaults to <fo:inline font-family="monospace">true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsAlterTableWithAddColumn"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17938"><!--
DDL
,
SupportsAlterTableWithAddColumn
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsAlterTableWithAddColumn</fo:inline>: Whether the database
supports adding a new column in an ALTER TABLE statement. Defaults to <fo:inline font-family="monospace">
true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsAlterTableWithDropColumn"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17953"><!--
DDL
,
SupportsAlterTableWithDropColumn
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsAlterTableWithDropColumn</fo:inline>: Whether the database
supports dropping a column in an ALTER TABLE statement. Defaults to <fo:inline font-family="monospace">
true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.ReservedWords"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17968"><!--
SQL
,
ReservedWords
--></fo:wrapper>
<fo:inline font-family="monospace">ReservedWords</fo:inline>: A comma-separated list of reserved words for
this database, beyond the standard SQL92 keywords.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SystemTables"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17980"><!--
schema
,
reflection
,
SystemTables
--></fo:wrapper>
<fo:inline font-family="monospace">SystemTables</fo:inline>: A comma-separated list of table names that
should be ignored.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SystemSchemas"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e17994"><!--
schema
,
reflection
,
SystemSchemas
--></fo:wrapper>
<fo:inline font-family="monospace">SystemSchemas</fo:inline>: A comma-separated list of schema names that
should be ignored.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SchemaCase"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18008"><!--
schema
,
reflection
,
SchemaCase
--></fo:wrapper>
<fo:inline font-family="monospace">SchemaCase</fo:inline>: The case to use when querying the database
metadata about schema components. Defaults to making all names upper case.
Available values are: <fo:inline font-family="monospace">upper, lower, preserve</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.ValidationSQL"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18025"><!--
connections
,
ValidationSQL
--></fo:wrapper>
<fo:wrapper id="d0e18031"><!--
SQL
,
ValidationSQL
--></fo:wrapper>
<fo:inline font-family="monospace">ValidationSQL</fo:inline>: The SQL used to validate that a connection is
still in a valid state. For example, " <fo:inline font-family="monospace">SELECT SYSDATE FROM DUAL
</fo:inline> " for Oracle.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.InitializationSQL"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18046"><!--
connections
,
InitializationSQL
--></fo:wrapper>
<fo:wrapper id="d0e18052"><!--
SQL
,
InitializationSQL
--></fo:wrapper>
<fo:inline font-family="monospace">InitializationSQL</fo:inline>: A piece of SQL to issue against the
database whenever a connection is retrieved from the <fo:inline font-family="monospace">DataSource
</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.JoinSyntax"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18067"><!--
joins
,
JoinSyntax
--></fo:wrapper>
<fo:inline font-family="monospace">JoinSyntax</fo:inline>: The SQL join syntax to use in select statements.
See <fo:basic-link internal-destination="ref_guide_dbsetup_sql92"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.6, “
Setting the SQL Join Syntax
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_sql92"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_sql92"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.CrossJoinClause"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18081"><!--
joins
,
CrossJoinClause
--></fo:wrapper>
<fo:inline font-family="monospace">CrossJoinClause</fo:inline>: The clause to use for a cross join
(cartesian product). Defaults to <fo:inline font-family="monospace">CROSS JOIN</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.InnerJoinClause"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18096"><!--
joins
,
InnerJoinClause
--></fo:wrapper>
<fo:inline font-family="monospace">InnerJoinClause</fo:inline>: The clause to use for an inner join.
Defaults to <fo:inline font-family="monospace">INNER JOIN</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.OuterJoinClause"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18111"><!--
joins
,
OuterJoinClause
--></fo:wrapper>
<fo:inline font-family="monospace">OuterJoinClause</fo:inline>: The clause to use for an left outer join.
Defaults to <fo:inline font-family="monospace">LEFT OUTER JOIN</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.RequiresConditionForCrossJoin"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18126"><!--
joins
,
RequiresConditionForCrossJoin
--></fo:wrapper>
<fo:inline font-family="monospace">RequiresConditionForCrossJoin</fo:inline>: Some databases require that
there always be a conditional statement for a cross join. If set, this parameter
ensures that there will always be some condition to the join clause.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.ToUpperCaseFunction"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18138"><!--
SQL
,
ToUpperCaseFunction
--></fo:wrapper>
<fo:inline font-family="monospace">ToUpperCaseFunction</fo:inline>: SQL function call for for converting a
string to upper case. Use the token <fo:inline font-family="monospace">{0}</fo:inline> to represent the
argument.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.ToLowerCaseFunction"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18153"><!--
SQL
,
ToLowerCaseFunction
--></fo:wrapper>
<fo:inline font-family="monospace">ToLowerCaseFunction</fo:inline>: Name of the SQL function for converting
a string to lower case. Use the token <fo:inline font-family="monospace">{0}</fo:inline> to represent the
argument.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.StringLengthFunction"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18168"><!--
SQL
,
StringLengthFunction
--></fo:wrapper>
<fo:inline font-family="monospace">StringLengthFunction</fo:inline>: Name of the SQL function for getting
the length of a string. Use the token <fo:inline font-family="monospace">{0}</fo:inline> to represent the
argument.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SubstringFunctionName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18183"><!--
SQL
,
SubstringFunctionName
--></fo:wrapper>
<fo:inline font-family="monospace">SubstringFunctionName</fo:inline>: Name of the SQL function for getting
the substring of a string.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.DistinctCountColumnSeparator"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18195"><!--
SQL
,
DistinctCountColumnSeparator
--></fo:wrapper>
<fo:inline font-family="monospace">DistinctCountColumnSeparator</fo:inline>: The string the database uses
to delimit between column expressions in a <fo:inline font-family="monospace">SELECT COUNT(DISTINCT
column-list)</fo:inline> clause. Defaults to null for most databases, meaning that
multiple columns in a distinct COUNT clause are not supported.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.ForUpdateClause"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18210"><!--
SQL
,
ForUpdateClause
--></fo:wrapper>
<fo:wrapper id="d0e18216"><!--
locking
,
ForUpdateClause
--></fo:wrapper>
<fo:inline font-family="monospace">ForUpdateClause</fo:inline>: The clause to append to <fo:inline font-family="monospace">SELECT
</fo:inline> statements to issue queries that obtain pessimistic locks. Defaults
to <fo:inline font-family="monospace">FOR UPDATE</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.TableForUpdateClause"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18234"><!--
SQL
,
TableForUpdateClause
--></fo:wrapper>
<fo:wrapper id="d0e18240"><!--
locking
,
TableForUpdateClause
--></fo:wrapper>
<fo:inline font-family="monospace">TableForUpdateClause</fo:inline>: The clause to append to the end of
each table alias in queries that obtain pessimistic locks. Defaults to null.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsSelectForUpdate"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18252"><!--
locking
,
SupportsSelectForUpdate
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsSelectForUpdate</fo:inline>: If true, then the database supports
<fo:inline font-family="monospace">SELECT</fo:inline> statements with a pessimistic locking clause. Defaults
to true.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsLockingWithDistinctClause"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18267"><!--
locking
,
SupportsLockingWithDistinctClause
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsLockingWithDistinctClause</fo:inline>: If true, then the
database supports <fo:inline font-family="monospace">FOR UPDATE</fo:inline> select clauses with <fo:inline font-family="monospace">
DISTINCT</fo:inline> clauses.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsLockingWithOuterJoin"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18285"><!--
locking
,
SupportsLockingWithOuterJoin
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsLockingWithOuterJoin</fo:inline>: If true, then the database
supports <fo:inline font-family="monospace">FOR UPDATE</fo:inline> select clauses with outer join queries.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsLockingWithInnerJoin"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18300"><!--
locking
,
SupportsLockingWithInnerJoin
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsLockingWithInnerJoin</fo:inline>: If true, then the database
supports <fo:inline font-family="monospace">FOR UPDATE</fo:inline> select clauses with inner join queries.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsLockingWithMultipleTables"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18315"><!--
locking
,
SupportsLockingWithMultipleTables
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsLockingWithMultipleTables</fo:inline>: If true, then the
database supports <fo:inline font-family="monospace">FOR UPDATE</fo:inline> select clauses that select from
multiple tables.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsLockingWithOrderClause"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18330"><!--
locking
,
SupportsLockingWithOrderClause
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsLockingWithOrderClause</fo:inline>: If true, then the database
supports <fo:inline font-family="monospace">FOR UPDATE</fo:inline> select clauses with <fo:inline font-family="monospace">ORDER BY
</fo:inline> clauses.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsLockingWithSelectRange"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18348"><!--
locking
,
SupportsLockingWithSelectRange
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsLockingWithSelectRange</fo:inline>: If true, then the database
supports <fo:inline font-family="monospace">FOR UPDATE</fo:inline> select clauses with queries that select a
range of data using <fo:inline font-family="monospace">LIMIT</fo:inline>, <fo:inline font-family="monospace">TOP</fo:inline> or the
database equivalent. Defaults to true.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SimulateLocking"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18369"><!--
locking
,
SimulateLocking
--></fo:wrapper>
<fo:inline font-family="monospace">SimulateLocking</fo:inline>: Some databases do not support pessimistic
locking, which will result in an exception when you attempt a pessimistic
transaction. Setting this property to <fo:inline font-family="monospace">true</fo:inline> bypasses the
locking check to allow pessimistic transactions even on databases that do not
support locking. Defaults to <fo:inline font-family="monospace">false</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsQueryTimeout"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18387"><!--
JDBC
,
QueryTimeout
,
SupportsQueryTimeout
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsQueryTimeout</fo:inline>: If true, then the JDBC driver supports
calls to <fo:inline font-family="monospace"> java.sql.Statement.setQueryTimeout</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsHaving"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18404"><!--
aggregates
,
having
,
SupportsHaving
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsHaving</fo:inline>: Whether this database supports HAVING
clauses in selects.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsSelectStartIndex"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18418"><!--
Query
,
result range
,
SupportsSelectStartIndex
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsSelectStartIndex</fo:inline>: Whether this database can create a
select that skips the first N results.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsSelectEndIndex"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18432"><!--
Query
,
result range
,
SupportsSelectEndIndex
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsSelectEndIndex</fo:inline>: Whether this database can create a
select that is limited to the first N results.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsSubselect"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18446"><!--
SQL
,
SupportsSubselect
--></fo:wrapper>
<fo:wrapper id="d0e18452"><!--
JPQL
,
subselects
,
SupportsSubselect
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsSubselect</fo:inline>: Whether this database supports subselects
in queries.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.RequiresAliasForSubselect"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18466"><!--
SQL
,
RequiresAliasForSubselect
--></fo:wrapper>
<fo:wrapper id="d0e18472"><!--
JPQL
,
subselects
,
RequiresAliasForSubselect
--></fo:wrapper>
<fo:inline font-family="monospace">RequiresAliasForSubselect</fo:inline>: If true, then the database
requires that subselects in a FROM clause be assigned an alias.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsMultipleNontransactionalResultSets"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">SupportsMultipleNontransactionalResultSets</fo:inline>: If true, then a
nontransactional connection is capable of having multiple open <fo:inline font-family="monospace">
ResultSet</fo:inline> instances.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.StorageLimitationsFatal"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18495"><!--
persistent fields
,
StorageLimitationsFatal
--></fo:wrapper>
<fo:inline font-family="monospace">StorageLimitationsFatal</fo:inline>: If true, then any data
truncation/rounding that is performed by the dictionary in order to store a
value in the database will be treated as a fatal error, rather than just issuing
a warning.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.StoreLargeNumbersAsStrings"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18507"><!--
persistent fields
,
StoreLargeNumbersAsStrings
--></fo:wrapper>
<fo:inline font-family="monospace">StoreLargeNumbersAsStrings</fo:inline>: Many databases have limitations
on the number of digits that can be stored in a numeric field (for example,
Oracle can only store 38 digits). For applications that operate on very large
<fo:inline font-family="monospace">BigInteger</fo:inline> and <fo:inline font-family="monospace">BigDecimal</fo:inline> values,
it may be necessary to store these objects as string fields rather than the
database's numeric type. Note that this may prevent meaningful numeric queries
from being executed against the database. Defaults to <fo:inline font-family="monospace">false</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.StoreCharsAsNumbers"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18528"><!--
persistent fields
,
StoreCharsAsNumbers
--></fo:wrapper>
<fo:inline font-family="monospace">StoreCharsAsNumbers</fo:inline>: Set this property to <fo:inline font-family="monospace">false
</fo:inline> to store Java <fo:inline font-family="monospace">char</fo:inline> fields as <fo:inline font-family="monospace">CHAR
</fo:inline> values rather than numbers. Defaults to <fo:inline font-family="monospace">true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.UseGetBytesForBlobs"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18552"><!--
BLOB
,
UseGetBytesForBlobs
--></fo:wrapper>
<fo:inline font-family="monospace">UseGetBytesForBlobs</fo:inline>: If true, then <fo:inline font-family="monospace">
ResultSet.getBytes</fo:inline> will be used to obtain blob data rather than
<fo:inline font-family="monospace">ResultSet.getBinaryStream</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.UseGetObjectForBlobs"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18570"><!--
BLOB
,
UseGetObjectForBlobs
--></fo:wrapper>
<fo:inline font-family="monospace">UseGetObjectForBlobs</fo:inline>: If true, then <fo:inline font-family="monospace">
ResultSet.getObject</fo:inline> will be used to obtain blob data rather than
<fo:inline font-family="monospace">ResultSet.getBinaryStream</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.UseSetBytesForBlobs"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18588"><!--
BLOB
,
UseSetBytesForBlobs
--></fo:wrapper>
<fo:inline font-family="monospace">UseSetBytesForBlobs</fo:inline>: If true, then <fo:inline font-family="monospace">
PreparedStatement.setBytes</fo:inline> will be used to set blob data, rather
than <fo:inline font-family="monospace">PreparedStatement.setBinaryStream</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.UseGetStringForClobs"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18606"><!--
CLOB
,
UseGetStringForClobs
--></fo:wrapper>
<fo:inline font-family="monospace">UseGetStringForClobs</fo:inline>: If true, then <fo:inline font-family="monospace">
ResultSet.getString</fo:inline> will be used to obtain clob data rather than
<fo:inline font-family="monospace">ResultSet.getCharacterStream</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.UseSetStringForClobs"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18624"><!--
CLOB
,
UseSetStringForClobs
--></fo:wrapper>
<fo:inline font-family="monospace">UseSetStringForClobs</fo:inline>: If true, then <fo:inline font-family="monospace">
PreparedStatement.setString</fo:inline> will be used to set clob data, rather
than <fo:inline font-family="monospace">PreparedStatement.setCharacterStream</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.CharacterColumnSize"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18642"><!--
DDL
,
CharacterColumnSize
--></fo:wrapper>
<fo:inline font-family="monospace">CharacterColumnSize</fo:inline>: The default size of <fo:inline font-family="monospace">varchar
</fo:inline> and <fo:inline font-family="monospace">char</fo:inline> columns. Typically 255.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.ArrayTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18660"><!--
DDL
,
ArrayTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">ArrayTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.ARRAY</fo:inline>. This is only used when the schema is
generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.BigintTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18678"><!--
DDL
,
BigintTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">BigintTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.BIGINT</fo:inline>. This is only used when the schema is
generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.BinaryTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18696"><!--
DDL
,
BinaryTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">BinaryTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.BINARY</fo:inline>. This is only used when the schema is
generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.BitTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18714"><!--
DDL
,
BitTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">BitTypeName</fo:inline>: The overridden default column type for <fo:inline font-family="monospace">
java.sql.Types.BIT</fo:inline>. This is only used when the schema is generated by
the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.BlobTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18732"><!--
DDL
,
BlobTypeName
--></fo:wrapper>
<fo:wrapper id="d0e18738"><!--
BLOB
,
BlobTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">BlobTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.BLOB</fo:inline>. This is only used when the schema is
generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.CharTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18756"><!--
DDL
,
CharTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">CharTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.CHAR</fo:inline>. This is only used when the schema is
generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.ClobTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18774"><!--
DDL
,
ClobTypeName
--></fo:wrapper>
<fo:wrapper id="d0e18780"><!--
CLOB
,
ClobTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">ClobTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.CLOB</fo:inline>. This is only used when the schema is
generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.DateTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18798"><!--
DDL
,
DateTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">DateTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.DATE</fo:inline>. This is only used when the schema is
generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.DecimalTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18816"><!--
DDL
,
DecimalTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">DecimalTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.DECIMAL</fo:inline>. This is only used when the schema is
generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.DistinctTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18834"><!--
DDL
,
DistinctTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">DistinctTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.DISTINCT</fo:inline>. This is only used when the schema
is generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.DoubleTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18852"><!--
DDL
,
DoubleTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">DoubleTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.DOUBLE</fo:inline>. This is only used when the schema is
generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.FloatTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18870"><!--
DDL
,
FloatTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">FloatTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.FLOAT</fo:inline>. This is only used when the schema is
generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.IntegerTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18888"><!--
DDL
,
IntegerTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">IntegerTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.INTEGER</fo:inline>. This is only used when the schema is
generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.JavaObjectTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18906"><!--
DDL
,
JavaObjectTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">JavaObjectTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.JAVAOBJECT</fo:inline>. This is only used when the schema
is generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.LongVarbinaryTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18924"><!--
DDL
,
LongVarbinaryTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">LongVarbinaryTypeName</fo:inline>: The overridden default column type
for <fo:inline font-family="monospace">java.sql.Types.LONGVARBINARY</fo:inline>. This is only used when the
schema is generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.LongVarcharTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18942"><!--
DDL
,
LongVarcharTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">LongVarcharTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.LONGVARCHAR</fo:inline>. This is only used when the
schema is generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.NullTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18960"><!--
DDL
,
NullTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">NullTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.NULL</fo:inline>. This is only used when the schema is
generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.NumericTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18978"><!--
DDL
,
NumericTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">NumericTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.NUMERIC</fo:inline>. This is only used when the schema is
generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.OtherTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e18996"><!--
DDL
,
OtherTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">OtherTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.OTHER</fo:inline>. This is only used when the schema is
generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.RealTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19014"><!--
DDL
,
RealTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">RealTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.REAL</fo:inline>. This is only used when the schema is
generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.RefTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19032"><!--
DDL
,
RefTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">RefTypeName</fo:inline>: The overridden default column type for <fo:inline font-family="monospace">
java.sql.Types.REF</fo:inline>. This is only used when the schema is generated by
the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SmallintTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19050"><!--
DDL
,
SmallintTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">SmallintTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.SMALLINT</fo:inline>. This is only used when the schema
is generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.StructTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19068"><!--
DDL
,
StructTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">StructTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.STRUCT</fo:inline>. This is only used when the schema is
generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.TimeTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19086"><!--
DDL
,
TimeTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">TimeTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.TIME</fo:inline>. This is only used when the schema is
generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.TimestampTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19104"><!--
DDL
,
TimestampTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">TimestampTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.TIMESTAMP</fo:inline>. This is only used when the schema
is generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.TinyintTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19122"><!--
DDL
,
TinyintTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">TinyintTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.TINYINT</fo:inline>. This is only used when the schema is
generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.VarbinaryTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19140"><!--
DDL
,
VarbinaryTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">VarbinaryTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.VARBINARY</fo:inline>. This is only used when the schema
is generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.VarcharTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19158"><!--
DDL
,
VarcharTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">VarcharTypeName</fo:inline>: The overridden default column type for
<fo:inline font-family="monospace">java.sql.Types.VARCHAR</fo:inline>. This is only used when the schema is
generated by the <fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.UseSchemaName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19176"><!--
schema
,
UseSchemaName
--></fo:wrapper>
<fo:inline font-family="monospace">UseSchemaName</fo:inline>: If <fo:inline font-family="monospace">false</fo:inline>, then avoid
including the schema name in table name references. Defaults to <fo:inline font-family="monospace">true
</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.TableTypes"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19194"><!--
schema
,
reflection
,
TableTypes
--></fo:wrapper>
<fo:inline font-family="monospace">TableTypes</fo:inline>: Comma-separated list of table types to use when
looking for tables during schema reflection, as defined in the <fo:inline font-family="monospace">
java.sql.DatabaseMetaData.getTableInfo</fo:inline> JDBC method. An example is:
<fo:inline font-family="monospace">"TABLE,VIEW,ALIAS"</fo:inline>. Defaults to <fo:inline font-family="monospace">"TABLE"</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsSchemaForGetTables"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19217"><!--
schema
,
reflection
,
SupportsSchemaForGetTables
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsSchemaForGetTables</fo:inline>: If false, then the database
driver does not support using the schema name for schema reflection on table
names.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsSchemaForGetColumns"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19231"><!--
schema
,
reflection
,
SupportsSchemaForGetColumns
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsSchemaForGetColumns</fo:inline>: If false, then the database
driver does not support using the schema name for schema reflection on column
names.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsNullTableForGetColumns"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19245"><!--
schema
,
reflection
,
SupportsNullTableForGetColumns
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsNullTableForGetColumns</fo:inline>: If true, then the database
supports passing a <fo:inline font-family="monospace">null</fo:inline> parameter to <fo:inline font-family="monospace">
DatabaseMetaData.getColumns</fo:inline> as an optimization to get information
about all the tables. Defaults to <fo:inline font-family="monospace">true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsNullTableForGetPrimaryKeys"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19268"><!--
schema
,
reflection
,
SupportsNullTableForGetPrimaryKeys
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsNullTableForGetPrimaryKeys</fo:inline>: If true, then the
database supports passing a <fo:inline font-family="monospace">null</fo:inline> parameter to <fo:inline font-family="monospace">
DatabaseMetaData.getPrimaryKeys</fo:inline> as an optimization to get
information about all the tables. Defaults to <fo:inline font-family="monospace">false</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsNullTableForGetIndexInfo"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19291"><!--
schema
,
reflection
,
SupportsNullTableForGetIndexInfo
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsNullTableForGetIndexInfo</fo:inline>: If true, then the database
supports passing a <fo:inline font-family="monospace">null</fo:inline> parameter to <fo:inline font-family="monospace">
DatabaseMetaData.getIndexInfo</fo:inline> as an optimization to get information
about all the tables. Defaults to <fo:inline font-family="monospace">false</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.SupportsNullTableForGetImportedKeys"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19314"><!--
schema
,
reflection
,
SupportsNullTableForGetImportedKeys
--></fo:wrapper>
<fo:inline font-family="monospace">SupportsNullTableForGetImportedKeys</fo:inline>: If true, then the
database supports passing a <fo:inline font-family="monospace">null</fo:inline> parameter to <fo:inline font-family="monospace">
DatabaseMetaData.getImportedKeys</fo:inline> as an optimization to get
information about all the tables. Defaults to <fo:inline font-family="monospace">false</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.UseGetBestRowIdentifierForPrimaryKeys"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19337"><!--
schema
,
reflection
,
UseGetBestRowIdentifierForPrimaryKeys
--></fo:wrapper>
<fo:inline font-family="monospace">UseGetBestRowIdentifierForPrimaryKeys</fo:inline>: If true, then
metadata queries will use <fo:inline font-family="monospace">DatabaseMetaData.getBestRowIdentifier
</fo:inline> to obtain information about primary keys, rather than <fo:inline font-family="monospace">
DatabaseMetaData.getPrimaryKeys</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.RequiresAutoCommitForMetadata"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19357"><!--
schema
,
reflection
,
RequiresAutoCommitForMetaData
--></fo:wrapper>
<fo:inline font-family="monospace">RequiresAutoCommitForMetadata</fo:inline>: If true, then the JDBC driver
requires that autocommit be enabled before any schema interrogation operations
can take place.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.AutoAssignClause"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19371"><!--
persistent fields
,
automatic field values
,
AutoAssignClause
--></fo:wrapper>
<fo:inline font-family="monospace">AutoAssignClause</fo:inline>: The column definition clause to append to
a creation statement. For example, " <fo:inline font-family="monospace">AUTO_INCREMENT</fo:inline> " for
MySQL. This property is set automatically in the dictionary, and should not need
to be overridden, and is only used when the schema is generated using the
<fo:inline font-family="monospace">mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.AutoAssignTypeName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19391"><!--
DDL
,
AutoAssignTypeName
--></fo:wrapper>
<fo:wrapper id="d0e19397"><!--
persistent fields
,
automatic field values
,
AutoAssignTypeName
--></fo:wrapper>
<fo:inline font-family="monospace">AutoAssignTypeName</fo:inline>: The column type name for auto-increment
columns. For example, " <fo:inline font-family="monospace">SERIAL</fo:inline> " for PostgreSQL. This
property is set automatically in the dictionary, and should not need to be
overridden, and is only used when the schema is generated using the <fo:inline font-family="monospace">
mappingtool</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.LastGeneratedKeyQuery"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19417"><!--
persistent fields
,
automatic field values
,
LastGeneratedKeyQuery
--></fo:wrapper>
<fo:inline font-family="monospace">LastGeneratedKeyQuery</fo:inline>: The query to issue to obtain the last
automatically generated key for an auto-increment column. For example, "
<fo:inline font-family="monospace">select @@identity</fo:inline> " for Sybase. This property is set
automatically in the dictionary, and should not need to be overridden.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="DBDictionary.NextSequenceQuery"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19434"><!--
Sequence
,
NextSequenceQuery
--></fo:wrapper>
<fo:inline font-family="monospace">NextSequenceQuery</fo:inline>: A SQL string for obtaining a native
sequence value. May use a placeholder of <fo:inline font-family="monospace">{0}</fo:inline> for the variable
sequence name. Defaults to a database-appropriate value.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="ref_guide_dbsetup_dbsupport_mysql"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
MySQLDictionary Properties
</fo:marker><fo:block font-size="17.28pt">4.4.2. 
MySQLDictionary Properties
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e19449"><!--
MySQL
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">mysql</fo:inline> dictionary also understands the following
properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e19459"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="MySQLDictionary.DriverDeserializesBlobs"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19463"><!--
MySQL
,
DriverDeserializesBlobs
--></fo:wrapper>
<fo:inline font-family="monospace">DriverDeserializesBlobs</fo:inline>: Many MySQL drivers automatically
deserialize BLOBs on calls to <fo:inline font-family="monospace">ResultSet.getObject</fo:inline>. The
<fo:inline font-family="monospace">MySQLDictionary</fo:inline> overrides the standard <fo:inline font-family="monospace">
DBDictionary.getBlobObject</fo:inline> method to take this into account. If
your driver does not deserialize automatically, set this property to <fo:inline font-family="monospace">
false</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="MySQLDictionary.TableType"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19487"><!--
MySQL
,
TableType
--></fo:wrapper>
<fo:inline font-family="monospace">TableType</fo:inline>: The MySQL table type to use when creating tables.
Defaults to <fo:inline font-family="monospace">innodb</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="MySQLDictionary.UseClobs"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19502"><!--
MySQL
,
UseClobs
--></fo:wrapper>
<fo:inline font-family="monospace">UseClobs</fo:inline>: Some older versions of MySQL do not handle clobs
correctly. To enable clob functionality, set this to true. Defaults to <fo:inline font-family="monospace">
false</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="MySQLDictionary.OptimizeMultiTableDeletes"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19517"><!--
MySQL
,
OptimizeMultiTableDeletes
--></fo:wrapper>
<fo:inline font-family="monospace">OptimizeMultiTableDeletes</fo:inline>: MySQL as of version 4.0.0
supports multiple tables in <fo:inline font-family="monospace">DELETE</fo:inline> statements. When
this option is set, OpenJPA will use that syntax when doing bulk deletes
from multiple tables. This can happen when the
<fo:inline font-family="monospace">deleteTableContents</fo:inline> <fo:inline font-family="monospace">SchemaTool</fo:inline>
action is used. (See <fo:basic-link internal-destination="ref_guide_schema_schematool"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.12, “
Schema Tool
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_schema_schematool"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_schema_schematool"/>]</fo:inline></fo:basic-link> for
more info about <fo:inline font-family="monospace">deleteTableContents</fo:inline>.) Defaults to
<fo:inline font-family="monospace">false</fo:inline>, since the statement may fail if using InnoDB
tables and delete constraints.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="ref_guide_dbsetup_dbsupport_oracle"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
OracleDictionary Properties
</fo:marker><fo:block font-size="17.28pt">4.4.3. 
OracleDictionary Properties
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e19546"><!--
Oracle
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">oracle</fo:inline> dictionary understands the following additional
properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e19556"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="OracleDictionary.UseTriggersForAutoAssign"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19560"><!--
Oracle
,
UseTriggersForAutoAssign
--></fo:wrapper>
<fo:wrapper id="d0e19566"><!--
persistent fields
,
automatic field values
,
UseTriggersForAutoAssign
--></fo:wrapper>
<fo:inline font-family="monospace">UseTriggersForAutoAssign</fo:inline>: If true, then OpenJPA will allow
simulation of auto-increment columns by the use of Oracle triggers. OpenJPA will
assume that the current sequence value from the sequence specified in the
<fo:inline font-family="monospace">AutoAssignSequenceName</fo:inline> parameter will hold the value of the
new primary key for rows that have been inserted. For more details on
auto-increment support, see <fo:basic-link internal-destination="ref_guide_pc_oid_pkgen_autoinc"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.3.4, “
Autoassign / Identity Strategy Caveats
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_oid_pkgen_autoinc"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_oid_pkgen_autoinc"/>]</fo:inline></fo:basic-link>
.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="OracleDictionary.AutoAssignSequenceName"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19585"><!--
Oracle
,
AutoAssignSequenceName
--></fo:wrapper>
<fo:wrapper id="d0e19591"><!--
persistent fields
,
automatic field values
,
AutoAssignSequenceName
--></fo:wrapper>
<fo:inline font-family="monospace">AutoAssignSequenceName</fo:inline>: The global name of the sequence that
OpenJPA will assume to hold the value of primary key value for rows that use
auto-increment. If left unset, OpenJPA will use a the sequence named <fo:inline font-family="monospace">
"SEQ_&lt;table name&gt;"</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="OracleDictionary.MaxEmbeddedBlobSize"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19608"><!--
Oracle
,
MaxEmbeddedBlobSize
--></fo:wrapper>
<fo:wrapper id="d0e19614"><!--
BLOB
,
MaxEmbeddedBlobSize
--></fo:wrapper>
<fo:inline font-family="monospace">MaxEmbeddedBlobSize</fo:inline>: Oracle is unable to persist BLOBs using
the embedded update method when BLOBs get over a certain size. The size depends
on database configuration, e.g. encoding. This property defines the maximum size
BLOB to persist with the embedded method. Defaults to 4000 bytes.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="OracleDictionary.MaxEmbeddedClobSize"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e19626"><!--
Oracle
,
MaxEmbeddedClobSize
--></fo:wrapper>
<fo:wrapper id="d0e19632"><!--
CLOB
,
MaxEmbeddedClobSize
--></fo:wrapper>
<fo:inline font-family="monospace">MaxEmbeddedClobSize</fo:inline>: Oracle is unable to persist CLOBs using
the embedded update method when Clobs get over a certain size. The size depends
on database configuration, e.g. encoding. This property defines the maximum size
CLOB to persist with the embedded method. Defaults to 4000 characters.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="OracleDictionary.UseSetFormOfUseForUnicode"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">UseSetFormOfUseForUnicode</fo:inline>: Prior to Oracle 10i, statements
executed against unicode capable columns (the <fo:inline font-family="monospace">NCHAR</fo:inline>,
<fo:inline font-family="monospace">NVARCHAR</fo:inline>, <fo:inline font-family="monospace">NCLOB</fo:inline> Oracle types) required
special handling to be able to store unicode values. Setting this property to
true (the default) will cause OpenJPA to attempt to detect when the column of
one of these types, and if so, will attempt to correctly configure the statement
using the <fo:inline font-family="monospace"> OraclePreparedStatement.setFormOfUse</fo:inline>. For
more details, see the Oracle
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/nchar/readme.html">
Readme For NChar</fo:basic-link>. Note that this can only work if OpenJPA is able to
access the underlying <fo:inline font-family="monospace">OraclePreparedStatement</fo:inline> instance,
which may not be possible when using some third-party datasources. If OpenJPA
detects that this is the case, a warning will be logged.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="ref_guide_dbsetup_isolation"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Setting the Transaction Isolation
</fo:marker><fo:block font-size="20.735999999999997pt">4.5. 
Setting the Transaction Isolation
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e19668"><!--
transactions
,
isolation
--></fo:wrapper><fo:wrapper id="d0e19673"><!--
JDBC
,
transaction isolation
--></fo:wrapper><fo:wrapper id="d0e19678"><!--
TransactionIsolation
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA typically retains the default transaction isolation level of the JDBC
driver. However, you can specify a transaction isolation level to use through
the <fo:basic-link internal-destination="openjpa.jdbc.TransactionIsolation"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.jdbc.TransactionIsolation</fo:inline></fo:inline></fo:basic-link> configuration property. The
following is a list of standard isolation levels. Note that not all databases
support all isolation levels.
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e19687"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e19688"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">default</fo:inline>: Use the JDBC driver's default isolation level.
OpenJPA uses this option if you do not explicitly specify any other.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e19694"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">none</fo:inline>: No transaction isolation.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e19700"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">read-committed</fo:inline>: Dirty reads are prevented; non-repeatable
reads and phantom reads can occur.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e19706"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">read-uncommitted</fo:inline>: Dirty reads, non-repeatable reads and
phantom reads can occur.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e19712"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">repeatable-read</fo:inline>: Dirty reads and non-repeatable reads are
prevented; phantom reads can occur.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e19718"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">serializable</fo:inline>: Dirty reads, non-repeatable reads, and phantom
reads are prevented.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_dbsetup_isoex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.7. 
Specifying a Transaction Isolation
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e19727">
&lt;property name="openjpa.jdbc.TransactionIsolation" value="repeatable-read"/&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_dbsetup_sql92"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Setting the SQL Join Syntax
</fo:marker><fo:block font-size="20.735999999999997pt">4.6. 
Setting the SQL Join Syntax
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e19732"><!--
joins
,
syntax options
--></fo:wrapper><fo:wrapper id="d0e19737"><!--
SQL
,
join syntax
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Object queries often involve using SQL joins behind the scenes. You can
configure OpenJPA to use either SQL 92-style join syntax, in which joins are
placed in the SQL FROM clause, the traditional join syntax, in which join
criteria are part of the WHERE clause, or a database-specific join syntax
mandated by the <fo:basic-link internal-destination="ref_guide_dbsetup_dbdict"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
DBDictionary</fo:inline></fo:inline></fo:basic-link>. OpenJPA only supports outer joins when using
SQL 92 syntax or a database-specific syntax with outer join support.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:basic-link internal-destination="openjpa.jdbc.DBDictionary"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.jdbc.DBDictionary</fo:inline></fo:inline></fo:basic-link> plugin accepts the the <fo:inline font-family="monospace">
JoinSyntax</fo:inline> property to set the system's default syntax. The available
values are:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e19757"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e19758"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">traditional</fo:inline>: Traditional SQL join syntax; outer joins are
not supported.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e19764"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">database</fo:inline>: The database's native join syntax. Databases that
do not have a native syntax will default to one of the other options.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e19770"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">sql92</fo:inline>: ANSI SQL92 join syntax. Outer joins are supported.
Not all databases support this syntax.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can change the join syntax at runtime through the OpenJPA fetch
configuration API, which is described in <fo:basic-link internal-destination="ref_guide_runtime"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 9, <fo:inline font-style="italic">
Runtime Extensions
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_runtime"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_runtime"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_dbsetup_sql92_conf"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.8. 
Specifying the Join Syntax Default
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e19783">
&lt;property name="openjpa.jdbc.DBDictionary" value="JoinSyntax=sql92"/&gt;
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_dbsetup_sql92_fetch"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.9. 
Specifying the Join Syntax at Runtime
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e19788">
import org.apache.openjpa.persistence.jdbc.*;
...
Query q = em.createQuery("select m from Magazine m where m.title = 'JDJ'");
OpenJPAQuery kq = OpenJPAPersistence.cast(q);
JDBCFetchPlan fetch = (JDBCFetchPlan) kq.getFetchPlan ();
fetch.setJoinSyntax(JDBCFetchPlan.JOIN_SYNTAX_SQL92);
List results = q.getResultList();
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_dbsetup_multidb"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Accessing Multiple Databases
</fo:marker><fo:block font-size="20.735999999999997pt">4.7. 
Accessing Multiple Databases
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e19793"><!--
relational database
,
accessing multiple databases
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Through the properties we've covered thus far, you can configure each
<fo:inline font-family="monospace">EntityManagerFactory</fo:inline> to access a different
database. If your application accesses multiple databases, we recommend that you
maintain a separate persistence unit for each one. This will allow you to easily
load the appropriate resource for each database at runtime, and to give the
correct configuration file to OpenJPA's command-line tools during development.
</fo:block></fo:block><fo:block id="ref_guide_dbsetup_retain"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Configuring the Use of JDBC Connections
</fo:marker><fo:block font-size="20.735999999999997pt">4.8. 
Configuring the Use of JDBC Connections
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e19806"><!--
connections
,
usage
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In its default configuration, OpenJPA obtains JDBC connections on an as-needed
basis. OpenJPA <fo:inline font-family="monospace">EntityManager</fo:inline>s do not retain a connection
to the database unless they are in a datastore transaction or there are open
<fo:inline font-family="monospace">Query</fo:inline> results that are using a live JDBC result set. At
all other times, including during optimistic transactions, <fo:inline font-family="monospace">
EntityManager</fo:inline>s request a connection for each query, then
immediately release the connection back to the pool.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e19824"><!--
ConnectionRetainMode
--></fo:wrapper>
In some cases, it may be more efficient to retain connections for longer periods
of time. You can configure OpenJPA's use of JDBC connections through the
<fo:basic-link internal-destination="openjpa.ConnectionRetainMode"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.ConnectionRetainMode</fo:inline></fo:inline></fo:basic-link> configuration property. The
property accepts the following values:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e19832"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e19833"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">always</fo:inline>: Each <fo:inline font-family="monospace">EntityManager</fo:inline> obtains a
single connection and uses it until the <fo:inline font-family="monospace">EntityManager</fo:inline>
closes.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e19845"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">transaction</fo:inline>: A connection is obtained when each transaction
begins (optimistic or datastore), and is released when the transaction
completes. Non-transactional connections are obtained on-demand.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e19851"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">on-demand</fo:inline>: Connections are obtained only when needed. This
option is equivalent to the <fo:inline font-family="monospace">transaction</fo:inline> option when datastore
transactions are used. For optimistic transactions, though, it means that a
connection will be retained only for the duration of the datastore flush and
commit process.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can also specify the connection retain mode of individual <fo:inline font-family="monospace">
EntityManager</fo:inline>s when you retrieve them from the <fo:inline font-family="monospace">
EntityManagerFactory</fo:inline>. See
<fo:basic-link internal-destination="ref_guide_runtime_emfactory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 9.2.1, “
OpenJPAEntityManagerFactory
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_runtime_emfactory"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_runtime_emfactory"/>]</fo:inline></fo:basic-link> for details.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e19872"><!--
FlushBeforeQueries
--></fo:wrapper>
The <fo:basic-link internal-destination="openjpa.FlushBeforeQueries"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.FlushBeforeQueries</fo:inline></fo:inline></fo:basic-link> configuration property controls
another aspect of connection usage: whether to flush transactional changes
before executing object queries. This setting only applies to queries that would
otherwise have to be executed in-memory because the
<fo:basic-link internal-destination="openjpa.IgnoreChanges"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">IgnoreChanges</fo:inline></fo:inline></fo:basic-link>
property is set to false and the query may involve objects that have been
changed in the current transaction. Legal values are:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e19884"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e19885"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">true</fo:inline>: Always flush rather than executing the query
in-memory. If the current transaction is optimistic, OpenJPA will begin a
non-locking datastore transaction. This is the default.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e19891"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">false</fo:inline>: Never flush before a query.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e19897"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">with-connection</fo:inline>: Flush only if the <fo:inline font-family="monospace">EntityManager
</fo:inline> has already established a dedicated connection to the datastore,
otherwise execute the query in-memory.
This option is useful if you use long-running optimistic transactions and want
to ensure that these transactions do not consume database resources until
commit. OpenJPA's behavior with this option is dependent on the transaction
status and mode, as well as the configured connection retain mode described
earlier in this section.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The flush mode can also be varied at runtime using the OpenJPA fetch
configuration API, discussed in <fo:basic-link internal-destination="ref_guide_runtime"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 9, <fo:inline font-style="italic">
Runtime Extensions
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_runtime"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_runtime"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e19912"><!--
flush
,
automatic
--></fo:wrapper>
The table below describes the behavior of automatic flushing in various
situations. In all cases, flushing will only occur if OpenJPA detects that you
have made modifications in the current transaction that may affect the query's
results.
</fo:block><fo:block xmlns:rx="http://www.renderx.com/XSL/Extensions" space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="d0e19918"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Table 4.1. 
OpenJPA Automatic Flush Behavior
</fo:block><fo:table border-before-width.conditionality="retain" border-collapse="collapse" border-left-style="solid" border-right-style="solid" border-top-style="solid" border-bottom-style="solid" border-left-width="0.5pt" border-right-width="0.5pt" border-top-width="0.5pt" border-bottom-width="0.5pt" border-left-color="black" border-right-color="black" border-top-color="black" border-bottom-color="black" table-layout="fixed" width="100%"><fo:table-column column-number="1"/><fo:table-column column-number="2"/><fo:table-column column-number="3"/><fo:table-column column-number="4"/><fo:table-column column-number="5"/><fo:table-header start-indent="0pt" end-indent="0pt"><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">
FlushBeforeQueries = false
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">
FlushBeforeQueries = true
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">
FlushBeforeQueries = with-connection;
ConnectionRetainMode = on-demand
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block font-weight="bold">
FlushBeforeQueries = with-connection;
ConnectionRetainMode = transaction or always
</fo:block></fo:table-cell></fo:table-row></fo:table-header><fo:table-body start-indent="0pt" end-indent="0pt"><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
IgnoreChanges = true
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
no flush
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
no flush
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
no flush
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
no flush
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
IgnoreChanges = false; no tx active
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
no flush
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
no flush
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
no flush
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
no flush
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
IgnoreChanges = false; datastore tx active
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
no flush
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
flush
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
flush
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
flush
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
IgnoreChanges = false; optimistic tx active
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
no flush
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
flush
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
no flush unless <fo:inline font-family="monospace">flush</fo:inline> has already been invoked
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" text-align="left"><fo:block>
flush
</fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_dbsetup_sql92_retain_conf"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.10. 
Specifying Connection Usage Defaults
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e20002">
&lt;property name="openjpa.ConnectionRetainMode" value="on-demand"/&gt;
&lt;property name="openjpa.FlushBeforeQueries" value="true"/&gt;
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_dbsetup_sql92_retain_runtime"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.11. 
Specifying Connection Usage at Runtime
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e20007">
import org.apache.openjpa.persistence.*;
// obtaining an em with a certain connection retain mode
Map props = new HashMap();
props.put("openjpa.ConnectionRetainMode", "always");
EntityManager em = emf.createEntityManager(props);
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_dbsetup_lrs"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Large Result Sets
</fo:marker><fo:block font-size="20.735999999999997pt">4.9. 
Large Result Sets
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e20012"><!--
large result sets
--></fo:wrapper><fo:wrapper id="d0e20015"><!--
JDBC
,
large result sets
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
By default, OpenJPA uses standard forward-only JDBC result sets, and completely
instantiates the results of database queries on execution. When using a JDBC
driver that supports version 2.0 or higher of the JDBC specification, however,
you can configure OpenJPA to use scrolling result sets that may not bring all
results into memory at once. You can also configure the number of result objects
OpenJPA keeps references to, allowing you to traverse potentially enormous
amounts of data without exhausting JVM memory.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e20024"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can also configure on-demand loading for individual collection and map
fields via large result set proxies. See
<fo:basic-link internal-destination="ref_guide_pc_scos_proxy_lrs"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.5.4.2, “
Large Result Set Proxies
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_scos_proxy_lrs"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_scos_proxy_lrs"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Use the following properties to configure OpenJPA's handling of result sets:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e20031"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20032"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e20035"><!--
FetchBatchSize
--></fo:wrapper>
<fo:basic-link internal-destination="openjpa.FetchBatchSize"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">openjpa.FetchBatchSize</fo:inline>
</fo:inline></fo:basic-link>: The number of objects to instantiate at once when traversing a result
set. This number will be set as the fetch size on JDBC <fo:inline font-family="monospace">Statement
</fo:inline> objects used to obtain result sets. It also factors in to the
number of objects OpenJPA will maintain a hard reference to when traversing a
query result.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The fetch size defaults to -1, meaning all results will be instantiated
immediately on query execution. A value of 0 means to use the JDBC driver's
default batch size. Thus to enable large result set handling, you must set this
property to 0 or to a positive number.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20049"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e20052"><!--
ResultSetType
--></fo:wrapper>
<fo:basic-link internal-destination="openjpa.jdbc.ResultSetType"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace"> openjpa.jdbc.ResultSetType
</fo:inline></fo:inline></fo:basic-link>: The type of result set to use when executing database
queries. This property accepts the following values, each of which corresponds
exactly to the same-named <fo:inline font-family="monospace">java.sql.ResultSet</fo:inline> constant:
</fo:block><fo:list-block provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e20063"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20064"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">forward-only</fo:inline>: This is the default.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20070"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">scroll-sensitive</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20076"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">scroll-insensitive</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Different JDBC drivers treat the different result set types differently. Not all
drivers support all types.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20084"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e20087"><!--
FetchDirection
--></fo:wrapper>
<fo:basic-link internal-destination="openjpa.jdbc.FetchDirection"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.jdbc.FetchDirection</fo:inline></fo:inline></fo:basic-link>: The expected order in which you
will access the query results. This property affects the type of datastructure
OpenJPA will use to hold the results, and is also given to the JDBC driver in
case it can optimize for certain access patterns. This property accepts the
following values, each of which corresponds exactly to the same-named
<fo:inline font-family="monospace">java.sql.ResultSet</fo:inline> FETCH constant:
</fo:block><fo:list-block provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e20098"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20099"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">forward</fo:inline>: This is the default.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20105"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">reverse</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20111"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">unknown</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Not all drivers support all fetch directions.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20119"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e20122"><!--
LRSSize
--></fo:wrapper>
<fo:basic-link internal-destination="openjpa.jdbc.LRSSize"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace"> openjpa.jdbc.LRSSize</fo:inline>
</fo:inline></fo:basic-link>: The strategy OpenJPA will use to determine the size of result sets.
This property is <fo:inline font-weight="bold">only</fo:inline> used if you change the
fetch batch size from its default of -1, so that OpenJPA begins to use on-demand
result loading. Available values are:
</fo:block><fo:list-block provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e20134"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20135"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">query</fo:inline>: This is the default. The first time you ask for the
size of a query result, OpenJPA will perform a <fo:inline font-family="monospace">SELECT COUNT(*)
</fo:inline> query to determine the number of expected results. Note that
depending on transaction status and settings, this can mean that the reported
size is slightly different than the actual number of results available.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20144"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">last</fo:inline>: If you have chosen a scrollable result set type, this
setting will use the <fo:inline font-family="monospace">ResultSet.last</fo:inline> method to move to
the last element in the result set and get its index. Unfortunately, some JDBC
drivers will bring all results into memory in order to access the last one. Note
that if you do not choose a scrollable result set type, then this will behave
exactly like <fo:inline font-family="monospace">unknown</fo:inline>. The default result set type is
<fo:inline font-family="monospace">forward-only</fo:inline>, so you must change the result set type in
order for this property to have an effect.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20159"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">unknown</fo:inline>: Under this setting OpenJPA will return <fo:inline font-family="monospace">
Integer.MAX_VALUE</fo:inline> as the size for any query result that uses on-demand
loading.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_dbsetup_lrs_def"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.12. 
Specifying Result Set Defaults
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e20171">
&lt;property name="openjpa.FetchBatchSize" value="20"/&gt;
&lt;property name="openjpa.jdbc.ResultSetType" value="scroll-insensitive"/&gt;
&lt;property name="openjpa.jdbc.FetchDirection" value="forward"/&gt;
&lt;property name="openjpa.jdbc.LRSSize" value="last"/&gt;
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Many <fo:basic-link internal-destination="ref_guide_runtime"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">OpenJPA runtime components</fo:inline></fo:basic-link> also
have methods to configure these properties on a case-by-case basis through their
fetch configuration. See <fo:basic-link internal-destination="ref_guide_runtime"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 9, <fo:inline font-style="italic">
Runtime Extensions
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_runtime"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_runtime"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_dbsetup_lrs_runtime"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.13. 
Specifying Result Set Behavior at Runtime
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e20183">
import java.sql.*;
import org.apache.openjpa.persistence.jdbc.*;
...
Query q = em.createQuery("select m from Magazine m where m.title = 'JDJ'");
OpenJPAQuery kq = OpenJPAPersistence.cast(q);
JDBCFetchPlan fetch = (JDBCFetchPlan) kq.getFetchPlan();
fetch.setFetchBatchSize(20);
fetch.setResultSetType(ResultSet.TYPE_SCROLL_INSENSITIVE);
fetch.setFetchDirection(ResultSet.FETCH_FORWARD);
fetch.setLRSSize(JDBCFetchPlan.SIZE_LAST);
List results = q.getResultList();
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_schema_def"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Default Schema
</fo:marker><fo:block font-size="20.735999999999997pt">4.10. 
Default Schema
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e20188"><!--
schema
,
default
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
It is common to duplicate a database model in multiple schemas. You may have one
schema for development and another for production, or different database users
may access different schemas. OpenJPA facilitates these patterns with the
<fo:basic-link internal-destination="openjpa.jdbc.Schema"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">openjpa.jdbc.Schema</fo:inline>
</fo:inline></fo:basic-link> configuration property. This property establishes a default schema for
any unqualified table names, allowing you to leave schema names out of your
mapping definitions.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">Schema</fo:inline> property also establishes the default schema for
new tables created through OpenJPA tools, such as the mapping tool covered in
<fo:basic-link internal-destination="ref_guide_mapping_mappingtool"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.1, “
Forward Mapping
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_mappingtool"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_mappingtool"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block><fo:block id="ref_guide_schema_info"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Schema Reflection
</fo:marker><fo:block font-size="20.735999999999997pt">4.11. 
Schema Reflection
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e20210"><!--
schema
,
reflection
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA needs information about your database schema for two reasons. First, it
can use schema information at runtime to validate that your schema is compatible
with your persistent class definitions. Second, OpenJPA requires schema
information during development so that it can manipulate the schema to match
your object model. OpenJPA uses the <fo:inline font-family="monospace">SchemaFactory</fo:inline> interface
to provide runtime mapping information, and the <fo:inline font-family="monospace">SchemaTool
</fo:inline> for development-time data. Each is presented below.
</fo:block><fo:block id="ref_guide_schema_info_list"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Schemas List
</fo:marker><fo:block font-size="17.28pt">4.11.1. 
Schemas List
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e20226"><!--
Schemas
--></fo:wrapper><fo:wrapper id="d0e20229"><!--
schema
,
schemas list
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
By default, schema reflection acts on all the schemas your JDBC driver can
"see". You can limit the schemas and tables OpenJPA acts on with the <fo:inline font-family="monospace">
openjpa.jdbc.Schemas</fo:inline> configuration property. This property accepts a
comma-separated list of schemas and tables. To list a schema, list its name. To
list a table, list its full name in the form <fo:inline font-family="monospace">
&lt;schema-name&gt;.&lt;table-name&gt;</fo:inline>. If a table does not have a
schema or you do not know its schema, list its name as <fo:inline font-family="monospace">
.&lt;table-name&gt;</fo:inline> (notice the preceding '.'). For example, to list
the <fo:inline font-family="monospace">BUSOBJS</fo:inline> schema, the <fo:inline font-family="monospace">ADDRESS</fo:inline> table in
the <fo:inline font-family="monospace">GENERAL</fo:inline> schema, and the <fo:inline font-family="monospace">SYSTEM_INFO</fo:inline>
table, regardless of what schema it is in, use the string:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e20257">
BUSOBJS,GENERAL.ADDRESS,.SYSTEM_INFO
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e20259"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Some databases are case-sensitive with respect to schema and table names.
Oracle, for example, requires names in all upper case.
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_schema_info_factory"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Schema Factory
</fo:marker><fo:block font-size="17.28pt">4.11.2. 
Schema Factory
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e20265"><!--
schema
,
SchemaFactory
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA relies on the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/schema/SchemaFactory.html">
<fo:inline font-family="monospace">openjpa.jdbc.SchemaFactory</fo:inline></fo:basic-link> interface for runtime
schema information. You can control the schema factory OpenJPA uses through the
<fo:inline font-family="monospace">openjpa.jdbc.SchemaFactory</fo:inline> property. There are several
built-in options to choose from:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e20280"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20281"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">dynamic</fo:inline>: This is the default setting. It is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/schema/DynamicSchemaFactory.html">
<fo:inline font-family="monospace">
org.apache.openjpa.jdbc.schema.DynamicSchemaFactory</fo:inline></fo:basic-link>. The
<fo:inline font-family="monospace">DynamicSchemaFactory</fo:inline> is the most performant
schema factory, because it does not validate mapping information against the
database. Instead, it assumes all object-relational mapping information is
correct, and dynamically builds an in-memory representation of the schema from
your mapping metadata. When using this factory, it is important that your
mapping metadata correctly represent your database's foreign key constraints so
that OpenJPA can order its SQL statements to meet them.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20295"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">native</fo:inline>: This is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/schema/LazySchemaFactory.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.schema.LazySchemaFactory</fo:inline></fo:basic-link>
. As persistent classes are loaded by the application, OpenJPA reads their
metadata and object-relational mapping information. This factory uses the
<fo:inline font-family="monospace">java.sql.DatabaseMetaData</fo:inline> interface to reflect on the
schema and ensure that it is consistent with the mapping data being read.
Use this factory if you want up-front validation that your mapping metadata is
consistent with the database during development. This factory accepts the
following important properties:
</fo:block><fo:list-block provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e20309"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20310"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">ForeignKeys</fo:inline>: Set to <fo:inline font-family="monospace"> true</fo:inline> to automatically
read foreign key information during schema validation.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20319"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">table</fo:inline>: This is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/schema/TableSchemaFactory.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.schema.TableSchemaFactory</fo:inline></fo:basic-link>
. This schema factory stores schema information as an XML document in a database
table it creates for this purpose. If your JDBC driver doesn't support the
<fo:inline font-family="monospace">java.sql.DatabaseMetaData</fo:inline> standard interface, but you
still want some schema validation to occur at runtime, you might use this
factory. It is not recommended for most users, though, because it is easy for
the stored XML schema definition to get out-of-synch with the actual database.
This factory accepts the following properties:
</fo:block><fo:list-block provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e20333"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20334"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Table</fo:inline>: The name of the table to create to store schema
information. Defaults to <fo:inline font-family="monospace">OPENJPA_SCHEMA</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20343"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">PrimaryKeyColumn</fo:inline>: The name of the table's numeric primary
key column. Defaults to <fo:inline font-family="monospace">ID</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20352"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">SchemaColumn</fo:inline>: The name of the table's string column for
holding the schema definition as an XML string. Defaults to <fo:inline font-family="monospace">SCHEMA_DEF
</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20361"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">file</fo:inline>: This is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/schema/FileSchemaFactory.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.schema.FileSchemaFactory</fo:inline></fo:basic-link>
. This factory is a lot like the <fo:inline font-family="monospace">TableSchemaFactory</fo:inline>, and
has the same advantages and disadvantages. Instead of storing its XML schema
definition in a database table, though, it stores it in a file. This factory
accepts the following properties:
</fo:block><fo:list-block provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e20375"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20376"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">File</fo:inline>: The resource name of the XML schema file. By default,
the factory looks for a resource called <fo:inline font-family="monospace"> package.schema</fo:inline>,
located in any top-level directory of the <fo:inline font-family="monospace">CLASSPATH</fo:inline> or in the
top level of any jar in your <fo:inline font-family="monospace">CLASSPATH</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can switch freely between schema factories at any time. The XML file format
used by some factories is detailed in <fo:basic-link internal-destination="ref_guide_schema_xml"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.13, “
XML Schema Format
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_schema_xml"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_schema_xml"/>]</fo:inline></fo:basic-link>
. As with any OpenJPA plugin, you can can also implement your own schema
factory if you have needs not met by the existing options.
</fo:block></fo:block></fo:block><fo:block id="ref_guide_schema_schematool"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Schema Tool
</fo:marker><fo:block font-size="20.735999999999997pt">4.12. 
Schema Tool
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e20398"><!--
schema
,
schema tool
--></fo:wrapper><fo:wrapper id="d0e20403"><!--
schema
,
DDL
--></fo:wrapper><fo:wrapper id="d0e20410"><!--
SQL
,
DDL
--></fo:wrapper><fo:wrapper id="d0e20417"><!--
DDL
,
with schema tool
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Most users will only access the schema tool indirectly, through the interfaces
provided by other tools. You may find, however, that the schema tool is a
powerful utility in its own right. The schema tool has two functions:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.2em" id="d0e20424"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20425"><fo:list-item-label end-indent="label-end()"><fo:block>1.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
To reflect on the current database schema, optionally translating it to an XML
representation for further manipulation.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20428"><fo:list-item-label end-indent="label-end()"><fo:block>2.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
To take in an XML schema definition, calculate the differences between the XML
and the existing database schema, and apply the necessary changes to make the
database match the XML.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:basic-link internal-destination="ref_guide_schema_xml"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">XML format</fo:inline></fo:basic-link> used by the schema
tool abstracts away the differences between SQL dialects used by different
database vendors. The tool also automatically adapts its SQL to meet foreign key
dependencies. Thus the schema tool is useful as a general way to manipulate
schemas.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can invoke the schema tool through its Java class,
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/schema/SchemaTool.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.schema.SchemaTool</fo:inline></fo:basic-link>. In
addition to the universal flags of the <fo:basic-link internal-destination="ref_guide_conf"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">
configuration framework</fo:inline></fo:basic-link>, the schema tool accepts the following command
line arguments:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e20446"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20447"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-ignoreErrors/-i &lt;true/t | false/f&gt;</fo:inline>: If <fo:inline font-family="monospace">false
</fo:inline>, an exception will be thrown if the tool encounters any database
errors. Defaults to <fo:inline font-family="monospace">false</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20459"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-file/-f &lt;stdout | output file&gt;</fo:inline>: Use this option to
write a SQL script for the planned schema modifications, rather them committing
them to the database. When used in conjunction with the <fo:inline font-family="monospace">export
</fo:inline> or <fo:inline font-family="monospace">reflect</fo:inline> actions, the named file will be used to
write the exported schema XML. If the file names a resource in the <fo:inline font-family="monospace">
CLASSPATH</fo:inline>, data will be written to that resource. Use <fo:inline font-family="monospace">stdout
</fo:inline> to write to standard output. Defaults to <fo:inline font-family="monospace">stdout</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20480"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-openjpaTables/-ot &lt;true/t | false/f&gt;</fo:inline>: When reflecting
on the schema, whether to reflect on tables and sequences whose names start with
<fo:inline font-family="monospace">OPENJPA_</fo:inline>. Certain OpenJPA components may use such tables -
for example, the <fo:inline font-family="monospace">table</fo:inline> schema factory option covered in
<fo:basic-link internal-destination="ref_guide_schema_info_factory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.11.2, “
Schema Factory
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_schema_info_factory"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_schema_info_factory"/>]</fo:inline></fo:basic-link>. When using other
actions, <fo:inline font-family="monospace">openjpaTables</fo:inline> controls whether these tables can be
dropped. Defaults to <fo:inline font-family="monospace">false</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20500"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-dropTables/-dt &lt;true/t | false/f&gt;</fo:inline>: Set this option to
<fo:inline font-family="monospace">true</fo:inline> to drop tables that appear to be unused during <fo:inline font-family="monospace">
retain</fo:inline> and <fo:inline font-family="monospace">refresh</fo:inline> actions. Defaults to <fo:inline font-family="monospace">
true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20518"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-dropSequences/-dsq &lt;true/t | false/f&gt;</fo:inline>: Set this
option to <fo:inline font-family="monospace">true</fo:inline> to drop sequences that appear to be unused
during <fo:inline font-family="monospace">retain</fo:inline> and <fo:inline font-family="monospace">refresh</fo:inline> actions.
Defaults to <fo:inline font-family="monospace">true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20536"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-sequences/-sq &lt;true/t | false/f&gt;</fo:inline>: Whether to
manipulate sequences. Defaults to <fo:inline font-family="monospace">true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20545"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-indexes/-ix &lt;true/t | false/f&gt;</fo:inline>: Whether to manipulate
indexes on existing tables. Defaults to <fo:inline font-family="monospace">true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20554"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-primaryKeys/-pk &lt;true/t | false/f&gt;</fo:inline>: Whether to
manipulate primary keys on existing tables. Defaults to <fo:inline font-family="monospace">true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20563"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-foreignKeys/-fk &lt;true/t | false/f&gt;</fo:inline>: Whether to
manipulate foreign keys on existing tables. Defaults to <fo:inline font-family="monospace">true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20572"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-record/-r &lt;true/t | false/f&gt;</fo:inline>: Use <fo:inline font-family="monospace">false
</fo:inline> to prevent writing the schema changes made by the tool to the current
<fo:basic-link internal-destination="ref_guide_schema_info_factory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">schema
factory</fo:inline></fo:inline></fo:basic-link>. Defaults to <fo:inline font-family="monospace">true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20588"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-schemas/-s &lt;schema list&gt;</fo:inline>: A list of schema and table
names that OpenJPA should access during this run of the schema tool. This is
equivalent to setting the <fo:basic-link internal-destination="openjpa.jdbc.Schemas"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">
openjpa.jdbc.Schemas</fo:inline></fo:basic-link> property for a single run.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The schema tool also accepts an <fo:inline font-family="monospace">-action</fo:inline> or <fo:inline font-family="monospace">-a
</fo:inline> flag. Multiple actions can be composed in a comma-separated list.
The available actions are:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e20605"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20606"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">add</fo:inline>: This is the default action if you do not specify one.
It brings the schema up-to-date with the given XML document by adding tables,
columns, indexes, etc. This action never drops any schema components.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20612"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">retain</fo:inline>: Keep all schema components in the given XML
definition, but drop the rest from the database. This action never adds any
schema components.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20618"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">drop</fo:inline>: Drop all schema components in the schema XML. Tables
will only be dropped if they would have 0 columns after dropping all columns
listed in the XML.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20624"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">refresh</fo:inline>: Equivalent to <fo:inline font-family="monospace">retain</fo:inline>, then
<fo:inline font-family="monospace">add</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20636"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">build</fo:inline>: Generate SQL to build a schema matching the one in
the given XML file. Unlike <fo:inline font-family="monospace">add</fo:inline>, this option does not take
into account the fact that part of the schema defined in the XML file might
already exist in the database. Therefore, this action is typically used in
conjunction with the <fo:inline font-family="monospace">-file</fo:inline> flag to write a SQL script. This
script can later be used to recreate the schema in the XML.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20648"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">reflect</fo:inline>: Generate an XML representation of the current
database schema.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20654"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">createDB</fo:inline>: Generate SQL to re-create the current database.
This action is typically used in conjunction with the <fo:inline font-family="monospace">-file</fo:inline>
flag to write a SQL script that can be used to recreate the current schema on a
fresh database.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20663"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">dropDB</fo:inline>: Generate SQL to drop the current database. Like
<fo:inline font-family="monospace">createDB</fo:inline>, this action can be used with the <fo:inline font-family="monospace">-file
</fo:inline> flag to script a database drop rather than perform it.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20675"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">import</fo:inline>: Import the given XML schema definition into the
current schema factory. Does nothing if the factory does not store a record of
the schema.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20681"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">export</fo:inline>: Export the current schema factory's stored schema
definition to XML. May produce an empty file if the factory does not store a
record of the schema.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20687"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">deleteTableContents</fo:inline>: Execute SQL to delete all rows from
all tables that OpenJPA knows about.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e20693"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The schema tool manipulates tables, columns, indexes, constraints, and
sequences. It cannot create or drop the database schema objects in which the
tables reside, however. If your XML documents refer to named database schemas,
those schemas must exist.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
We present some examples of schema tool usage below.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_schema_schematool_create"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.14. 
Schema Creation
</fo:block><fo:wrapper id="d0e20701"><!--
schema
,
create with schema tool
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Add the necessary schema components to the database to match the given XML
document, but don't drop any data:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e20708">
java org.apache.openjpa.jdbc.schema.SchemaTool targetSchema.xml
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_schema_schematool_script"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.15. 
SQL Scripting
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Repeat the same action as the first example, but this time don't change the
database. Instead, write any planned changes to a SQL script:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e20715">
java org.apache.openjpa.jdbc.schema.SchemaTool -f script.sql targetSchema.xml
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Write a SQL script that will re-create the current database:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e20719">
java org.apache.openjpa.jdbc.schema.SchemaTool -a createDB -f script.sql
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_schema_schematool_table_cleanup"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.16. 
Table Cleanup
</fo:block><fo:wrapper id="d0e20724"><!--
schema
,
refresh schema and delete all contents of all tables
--></fo:wrapper><fo:wrapper id="d0e20729"><!--
testing
,
refresh schema and delete all contents of all tables
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Refresh the schema and delete all contents of all tables that OpenJPA
knows about:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e20736">
java org.apache.openjpa.jdbc.schema.SchemaTool -a refresh,deleteTableContents
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_schema_schematool_drop"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.17. 
Schema Drop
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Drop the current database:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e20743">
java org.apache.openjpa.jdbc.schema.SchemaTool -a dropDB
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_schema_schematool_reflect"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.18. 
Schema Reflection
</fo:block><fo:wrapper id="d0e20748"><!--
schema
,
reflection
,
with schema tool
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Write an XML representation of the current schema to file <fo:inline font-family="monospace">schema.xml
</fo:inline>.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e20760">
java org.apache.openjpa.jdbc.schema.SchemaTool -a reflect -f schema.xml
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_schema_xml"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
XML Schema Format
</fo:marker><fo:block font-size="20.735999999999997pt">4.13. 
XML Schema Format
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e20765"><!--
schema
,
XML representation
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:basic-link internal-destination="ref_guide_schema_schematool"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">schema tool</fo:inline></fo:basic-link> and
<fo:basic-link internal-destination="ref_guide_schema_info_factory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"> schema factories</fo:inline></fo:basic-link> all use
the same XML format to represent database schema. The Document Type Definition
(DTD) for schema information is presented below, followed by examples of schema
definitions in XML.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e20778">
&lt;!ELEMENT schemas (schema)+&gt;
&lt;!ELEMENT schema (table|sequence)+&gt;
&lt;!ATTLIST schema name CDATA #IMPLIED&gt;
&lt;!ELEMENT sequence EMPTY&gt;
&lt;!ATTLIST sequence name CDATA #REQUIRED&gt;
&lt;!ATTLIST sequence initial-value CDATA #IMPLIED&gt;
&lt;!ATTLIST sequence increment CDATA #IMPLIED&gt;
&lt;!ATTLIST sequence allocate CDATA #IMPLIED&gt;
&lt;!ELEMENT table (column|index|pk|fk|unique)+&gt;
&lt;!ATTLIST table name CDATA #REQUIRED&gt;
&lt;!ELEMENT column EMPTY&gt;
&lt;!ATTLIST column name CDATA #REQUIRED&gt;
&lt;!ATTLIST column type (array | bigint | binary | bit | blob | char | clob
| date | decimal | distinct | double | float | integer | java_object
| longvarbinary | longvarchar | null | numeric | other | real | ref
| smallint | struct | time | timestamp | tinyint | varbinary | varchar)
#REQUIRED&gt;
&lt;!ATTLIST column not-null (true|false) "false"&gt;
&lt;!ATTLIST column auto-assign (true|false) "false"&gt;
&lt;!ATTLIST column default CDATA #IMPLIED&gt;
&lt;!ATTLIST column size CDATA #IMPLIED&gt;
&lt;!ATTLIST column decimal-digits CDATA #IMPLIED&gt;
&lt;!-- the type-name attribute can be used when you want OpenJPA to --&gt;
&lt;!-- use a particular SQL type declaration when creating the --&gt;
&lt;!-- column. It is up to you to ensure that this type is --&gt;
&lt;!-- compatible with the JDBC type used in the type attribute. --&gt;
&lt;!ATTLIST column type-name CDATA #IMPLIED&gt;
&lt;!-- the 'column' attribute of indexes, pks, and fks can be used --&gt;
&lt;!-- when the element has only one column (or for foreign keys, --&gt;
&lt;!-- only one local column); in these cases the on/join child --&gt;
&lt;!-- elements can be omitted --&gt;
&lt;!ELEMENT index (on)*&gt;
&lt;!ATTLIST index name CDATA #REQUIRED&gt;
&lt;!ATTLIST index column CDATA #IMPLIED&gt;
&lt;!ATTLIST index unique (true|false) "false"&gt;
&lt;!-- the 'logical' attribute of pks should be set to 'true' if --&gt;
&lt;!-- the primary key does not actually exist in the database, --&gt;
&lt;!-- but the given column should be used as a primary key for --&gt;
&lt;!-- O-R purposes --&gt;
&lt;!ELEMENT pk (on)*&gt;
&lt;!ATTLIST pk name CDATA #IMPLIED&gt;
&lt;!ATTLIST pk column CDATA #IMPLIED&gt;
&lt;!ATTLIST pk logical (true|false) "false"&gt;
&lt;!ELEMENT on EMPTY&gt;
&lt;!ATTLIST on column CDATA #REQUIRED&gt;
&lt;!-- fks with a delete-action of 'none' are similar to logical --&gt;
&lt;!-- pks; they do not actually exist in the database, but --&gt;
&lt;!-- represent a logical relation between tables (or their --&gt;
&lt;!-- corresponding Java classes) --&gt;
&lt;!ELEMENT fk (join)*&gt;
&lt;!ATTLIST fk name CDATA #IMPLIED&gt;
&lt;!ATTLIST fk deferred (true|false) "false"&gt;
&lt;!ATTLIST fk to-table CDATA #REQUIRED&gt;
&lt;!ATTLIST fk column CDATA #IMPLIED&gt;
&lt;!ATTLIST fk delete-action (cascade|default|exception|none|null) "none"&gt;
&lt;!ELEMENT join EMPTY&gt;
&lt;!ATTLIST join column CDATA #REQUIRED&gt;
&lt;!ATTLIST join to-column CDATA #REQUIRED&gt;
&lt;!ATTLIST join value CDATA #IMPLIED&gt;
&lt;!-- unique constraint --&gt;
&lt;!ELEMENT unique (on)*&gt;
&lt;!ATTLIST unique name CDATA #IMPLIED&gt;
&lt;!ATTLIST unique column CDATA #IMPLIED&gt;
&lt;!ATTLIST unique deferred (true|false) "false"&gt;
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_schema_xml_basic"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.19. 
Basic Schema
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A very basic schema definition.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e20785">
&lt;schemas&gt;
&lt;schema&gt;
&lt;sequence name="S_ARTS"/&gt;
&lt;table name="ARTICLE"&gt;
&lt;column name="TITLE" type="varchar" size="255" not-null="true"/&gt;
&lt;column name="AUTHOR_FNAME" type="varchar" size="28"&gt;
&lt;column name="AUTHOR_LNAME" type="varchar" size="28"&gt;
&lt;column name="CONTENT" type="clob"&gt;
&lt;/table&gt;
&lt;table name="AUTHOR"&gt;
&lt;column name="FIRST_NAME" type="varchar" size="28" not-null="true"&gt;
&lt;column name="LAST_NAME" type="varchar" size="28" not-null="true"&gt;
&lt;/table&gt;
&lt;/schema&gt;
&lt;/schemas&gt;
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_schema_xml_full"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 4.20. 
Full Schema
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Expansion of the above schema with primary keys, constraints, and indexes, some
of which span multiple columns.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e20792">
&lt;schemas&gt;
&lt;schema&gt;
&lt;sequence name="S_ARTS"/&gt;
&lt;table name="ARTICLE"&gt;
&lt;column name="TITLE" type="varchar" size="255" not-null="true"/&gt;
&lt;column name="AUTHOR_FNAME" type="varchar" size="28"&gt;
&lt;column name="AUTHOR_LNAME" type="varchar" size="28"&gt;
&lt;column name="CONTENT" type="clob"&gt;
&lt;pk column="TITLE"/&gt;
&lt;fk to-table="AUTHOR" delete-action="exception"&gt;
&lt;join column="AUTHOR_FNAME" to-column="FIRST_NAME"/&gt;
&lt;join column="AUTHOR_LNAME" to-column="LAST_NAME"/&gt;
&lt;/fk&gt;
&lt;index name="ARTICLE_AUTHOR"&gt;
&lt;on column="AUTHOR_FNAME"/&gt;
&lt;on column="AUTHOR_LNAME"/&gt;
&lt;/index&gt;
&lt;/table&gt;
&lt;table name="AUTHOR"&gt;
&lt;column name="FIRST_NAME" type="varchar" size="28" not-null="true"&gt;
&lt;column name="LAST_NAME" type="varchar" size="28" not-null="true"&gt;
&lt;pk&gt;
&lt;on column="FIRST_NAME"/&gt;
&lt;on column="LAST_NAME"/&gt;
&lt;/pk&gt;
&lt;/table&gt;
&lt;/schema&gt;
&lt;/schemas&gt;
</fo:block></fo:block></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Persistent Classes
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Persistent Classes
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="ref_guide_pc"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 5. 
Persistent Classes
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e20798"><!--
persistent classes
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Persistent class basics are covered in <fo:basic-link internal-destination="jpa_overview_pc"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 4, <fo:inline font-style="italic">
Entity
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_pc"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_pc"/>]</fo:inline></fo:basic-link>
of the JPA Overview. This chapter details the persistent class features OpenJPA
offers beyond the core JPA specification.
</fo:block><fo:block id="ref_guide_pc_pcclasses"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Persistent Class List
</fo:marker><fo:block font-size="20.735999999999997pt">5.1. 
Persistent Class List
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e20808"><!--
persistent classes
,
list
--></fo:wrapper><fo:wrapper id="d0e20813"><!--
PCClasses
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Unlike many ORM products, OpenJPA does not need to know about all of your
persistent classes at startup. OpenJPA discovers new persistent classes
automatically as they are loaded into the JVM; in fact you can introduce new
persistent classes into running applications under OpenJPA. However, there are
certain situations in which providing OpenJPA with a persistent class list is
helpful:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e20818"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20819"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
OpenJPA must be able to match entity names in JPQL queries to persistent
classes. OpenJPA automatically knows the entity names of any persistent classes
already loaded into the JVM. To match entity names to classes that have not been
loaded, however, you must supply a persistent class list.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20822"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
When OpenJPA manipulates classes in a persistent inheritance hierarchy, OpenJPA
must be aware of all the classes in the hierarchy. If some of the classes have
not been loaded into the JVM yet, OpenJPA may not know about them, and queries
may return incorrect results.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20825"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If you configure OpenJPA to create the needed database schema on startup (see
<fo:basic-link internal-destination="ref_guide_mapping_synch"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.1.3, “
Runtime Forward Mapping
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_synch"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_synch"/>]</fo:inline></fo:basic-link>), OpenJPA must know all of your
persistent classes up-front.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When any of these conditions are a factor in your JPA application, use the
<fo:inline font-family="monospace">class</fo:inline>, <fo:inline font-family="monospace">mapping-file</fo:inline>, and <fo:inline font-family="monospace">
jar-file</fo:inline> elements of JPA's standard XML format to list your persistent
classes. See <fo:basic-link internal-destination="jpa_overview_persistence_xml"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 6.1, “
persistence.xml
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_persistence_xml"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_persistence_xml"/>]</fo:inline></fo:basic-link> for details.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e20843"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Listing persistent classes (or their metadata or jar files) is an all-or-nothing
endeavor. If your persistent class list is non-empty, OpenJPA will assume that
any unlisted class is not persistent.
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_pc_enhance"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Enhancement
</fo:marker><fo:block font-size="20.735999999999997pt">5.2. 
Enhancement
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e20849"><!--
enhancer
--></fo:wrapper><fo:wrapper id="d0e20852"><!--
openjpac
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In order to provide optimal runtime performance, flexible lazy loading, and
efficient, immediate dirty tracking, OpenJPA can use an <fo:inline font-style="italic">enhancer
</fo:inline>. An enhancer is a tool that automatically adds code to your
persistent classes after you have written them. The enhancer post-processes the
bytecode generated by your Java compiler, adding the necessary fields and
methods to implement the required persistence features. This bytecode
modification perfectly preserves the line numbers in stack traces and is
compatible with Java debuggers. In fact, the only change to debugging
is that the persistent setter and getter methods of entity classes using
property access will be prefixed with <fo:inline font-family="monospace">pc</fo:inline> in stack traces and
step-throughs. For example, if your entity has a <fo:inline font-family="monospace">getId</fo:inline>
method for persistent property <fo:inline font-family="monospace">id</fo:inline>, and that method throws an
exception, the stack trace will report the exception from method <fo:inline font-family="monospace">
pcgetId</fo:inline>. The line numbers, however, will correctly correspond to
the <fo:inline font-family="monospace">getId</fo:inline> method in your source file.
</fo:block><fo:block id="d0e20877"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/enhancement.png" width="339px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The diagram above illustrates the compilation of a persistent class.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can add the OpenJPA enhancer to your build process, or use Java 1.5's
instrumentation features to transparently enhance persistent classes when they
are loaded into the JVM. The following sections describe each option.
</fo:block><fo:block id="ref_guide_pc_enhance_build"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Enhancing at Build Time
</fo:marker><fo:block font-size="17.28pt">5.2.1. 
Enhancing at Build Time
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e20888"><!--
enhancer
,
build time
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The enhancer can be invoked at build time
via its Java class, <fo:inline font-family="monospace">
org.apache.openjpa.enhance.PCEnhancer</fo:inline>.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e20898"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can also enhance via Ant; see
<fo:basic-link internal-destination="ref_guide_integration_enhance"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.1.2, “
Enhancer Ant Task
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_integration_enhance"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_integration_enhance"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_pc_enhance_enhancer"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.1. 
Using the OpenJPA Enhancer
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e20906">
java org.apache.openjpa.enhance.PCEnhancer Magazine.java
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The enhancer accepts the standard set of command-line arguments defined by the
configuration framework (see <fo:basic-link internal-destination="ref_guide_conf_devtools"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.3, “
Command Line Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_devtools"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_devtools"/>]</fo:inline></fo:basic-link> ),
along with the following flags:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e20912"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20913"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-directory/-d &lt;output directory&gt;</fo:inline>: Path to the output
directory. If the directory does not match the enhanced class' package, the
package structure will be created beneath the directory. By default, the
enhancer overwrites the original <fo:inline font-family="monospace">.class</fo:inline> file.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20922"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-enforcePropertyRestrictions/-epr &lt;true/t | false/f&gt;</fo:inline>:
Whether to throw an exception when it appears that a property access entity is
not obeying the restrictions placed on property access. Defaults to false.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20928"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-addDefaultConstructor/-adc &lt;true/t | false/f&gt;</fo:inline>: The
spec requires that all persistent classes define a no-arg constructor. This flag
tells the enhancer whether to add a protected no-arg constructor to any
persistent classes that don't already have one. Defaults to <fo:inline font-family="monospace">
true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20937"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-tmpClassLoader/-tcl &lt;true/t | false/f&gt;</fo:inline>: Whether to
load persistent classes with a temporary class loader. This allows other code to
then load the enhanced version of the class within the same JVM. Defaults to
<fo:inline font-family="monospace">true</fo:inline>. Try setting this flag to <fo:inline font-family="monospace">false</fo:inline> as a
debugging step if you run into class loading problems when running the enhancer.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Each additional argument to the enhancer must be one of the following:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e20951"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20952"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The full name of a class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20955"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The .java file for a class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e20958"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The <fo:inline font-family="monospace">.class</fo:inline> file of a class.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If you do not supply any arguments to the enhancer, it will run on the classes
in your persistent class list (see <fo:basic-link internal-destination="ref_guide_pc_pcclasses"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.1, “
Persistent Class List
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_pcclasses"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_pcclasses"/>]</fo:inline></fo:basic-link>).
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can run the enhancer over classes that have already been enhanced, in which
case it will not further modify the class. You can also run it over classes that
are not persistence-capable, in which case it will treat the class as
persistence-aware. Persistence-aware classes can directly manipulate the
persistent fields of persistence-capable classes.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Note that the enhancement process for subclasses introduces dependencies on the
persistent parent class being enhanced. This is normally not problematic;
however, when running the enhancer multiple times over a subclass whose parent
class is not yet enhanced, class loading errors can occur. In the event of a
class load error, simply re-compile and re-enhance the offending classes.
</fo:block></fo:block><fo:block id="ref_guide_pc_enhance_runtime_container"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Enhancing JPA Entities on Deployment
</fo:marker><fo:block font-size="17.28pt">5.2.2. 
Enhancing JPA Entities on Deployment
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e20975"><!--
enhancer
,
runtime
,
in an EJB container
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The Java EE 5 specification includes hooks to automatically enhance JPA entities
when they are deployed into a container. Thus, if you are using a Java EE
5-compliant application server, OpenJPA will enhance your entities automatically
at runtime. Note that if you prefer build-time enhancement, OpenJPA's runtime
enhancer will correctly recognize and skip pre-enhanced classes.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If your application server does not support the Java EE 5 enhancement hooks,
consider using the build-time enhancement described above, or the more general
runtime enhancement described in the next section.
</fo:block></fo:block><fo:block id="ref_guide_pc_enhance_runtime"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Enhancing at Runtime
</fo:marker><fo:block font-size="17.28pt">5.2.3. 
Enhancing at Runtime
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e20989"><!--
enhancer
,
runtime
,
outside a container
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA includes a <fo:inline font-style="italic">Java agent</fo:inline> for automatically enhancing
persistent classes as they are loaded into the JVM. Java agents are classes that
are invoked prior to your application's <fo:inline font-family="monospace">main</fo:inline> method.
OpenJPA's agent uses JVM hooks to intercept all class loading to enhance classes
that have persistence metadata before the JVM loads them.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Searching for metadata for every class loaded by the JVM can slow application
initialization. One way to speed things up is to take advantage of the optional
persistent class list described in <fo:basic-link internal-destination="ref_guide_pc_pcclasses"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.1, “
Persistent Class List
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_pcclasses"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_pcclasses"/>]</fo:inline></fo:basic-link>. If
you declare a persistent class list, OpenJPA will only search for
metadata for classes in that list.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To employ the OpenJPA agent, invoke <fo:inline font-family="monospace">java</fo:inline> with the <fo:inline font-family="monospace">
-javaagent</fo:inline> set to the path to your OpenJPA jar file.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_pc_enhance_runtime_ex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.2. 
Using the OpenJPA Agent for Runtime Enhancement
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e21019">
java -javaagent:/home/dev/openjpa/lib/openjpa.jar com.xyz.Main
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can pass settings to the agent using OpenJPA's plugin syntax (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>). The agent accepts the long
form of any of the standard configuration options
(<fo:basic-link internal-destination="ref_guide_conf_devtools"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.3, “
Command Line Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_devtools"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_devtools"/>]</fo:inline></fo:basic-link> ). It also accepts the following
options, the first three of which correspond exactly to to the same-named
options of the enhancer tool described in
<fo:basic-link internal-destination="ref_guide_pc_enhance_build"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.1, “
Enhancing at Build Time
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_enhance_build"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_enhance_build"/>]</fo:inline></fo:basic-link>:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e21029"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21030"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">addDefaultConstructor</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21036"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">enforcePropertyRestrictions</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21042"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">scanDevPath</fo:inline>: Boolean indicating whether to scan the
classpath for persistent types if none have been configured. If you do not
specify a persistent types list and do not set this option to true, OpenJPA will
check whether each class loaded into the JVM is persistent, and enhance it
accordingly. This may slow down class load times significantly.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21048"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">classLoadEnhancement</fo:inline>: Boolean controlling whether OpenJPA
load-time class enhancement should be available in this JVM execution. Default:
<fo:inline font-family="monospace">true</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21057"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">runtimeRedefinition</fo:inline>: Boolean controlling whether OpenJPA
class redefinition should be available in this JVM execution. Default:
<fo:inline font-family="monospace">true</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_pc_enhance_runtime_opt_ex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.3. 
Passing Options to the OpenJPA Agent
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e21069">
java -javaagent:/home/dev/openjpa/lib/openjpa.jar=addDefaultConstructor=false com.xyz.Main
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_pc_enhance_unenhanced_types"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Omitting the OpenJPA enhancer
</fo:marker><fo:block font-size="17.28pt">5.2.4. 
Omitting the OpenJPA enhancer
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e21074"><!--
enhancer
,
omitting
,
outside a container
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA does not require that the enhancer be run. If you do not run the
enhancer, OpenJPA will fall back to one of several possible alternatives for
state tracking, depending on the execution environment.
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e21083"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21084"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-style="italic">Deploy-time enhancement</fo:inline>: if you are running your
application inside a Java EE 5 container, or another environment that supports
the JPA container contract, then OpenJPA will automatically perform class
transformation at deploy time.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21090"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-style="italic">Java 6 class retransformation</fo:inline>: if you are running your
application in a Java 6 environment, OpenJPA will attempt to dynamically
register a <fo:inline font-family="monospace">ClassTransformer</fo:inline> that will redefine your
persistent classes on the fly to track access to persistent data. Additionally,
OpenJPA will create a subclass for each of your persistent classes. When
you execute a query or traverse a relation, OpenJPA will return an instance
of the subclass. This means that the <fo:inline font-family="monospace">instanceof</fo:inline> operator
will work as expected, but <fo:inline font-family="monospace">o.getClass()</fo:inline> will return the
subclass instead of the class that you wrote.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You do not need to do anything at all to get this behavior. OpenJPA will
automatically detect whether or not the execution environment is capable of
Java 6 class retransformation.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21107"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-style="italic">Java 5 class redefinition</fo:inline>: if you are running your
application in a Java 5 environment, and you specify the OpenJPA javaagent,
OpenJPA will use Java 5 class redefinition to redefine any persistent classes
that are not enhanced by thet OpenJPA javaagent. Aside from the requirement
that you specify a javaagent on the command line, this behavior is exactly the
same as the Java 6 class retransformation behavior. Of course, since the
OpenJPA javaagent performs enhancement by default, this will only be available
if you set the <fo:inline font-family="monospace">classLoadEnhancement</fo:inline> javaagent flag to
<fo:inline font-family="monospace">false</fo:inline>, or on any classes that are skipped by the OpenJPA
runtime enhancement process for some reason.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21119"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-style="italic">state comparison and subclassing</fo:inline>: if you are running
in a Java 5 environment without a javaagent, or in a Java 6 environment that
does not support class retransformation, OpenJPA will still create subclasses
as outlined above. However, in some cases, OpenJPA may not be able to receive
notifications when you read or write persistent data.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If you are using <fo:inline font-style="italic">property access</fo:inline> for your persistent data,
then OpenJPA will be able to track all accesses for instances that you load
from the database, but not for instances that you create. This is because
OpenJPA will create new instances of its dynamically-generated subclass when
it loads data from the database. The dynamically-generated subclass has
code in the setters and getters that notify OpenJPA about persistent data
access. This means that new instances that you create will be subject to
state-comparison checks (see discussion below) to compute which fields to
write to the database, and that OpenJPA will ignore requests to evict
persistent data from such instances. In practice, this is not a particularly
bad limitation, since OpenJPA already knows that it must insert all field
values for new instances. So, this is only really an issue if you flush
changes to the database while inserting new records; after such a flush,
OpenJPA will need to hold potentially-unneeded hard references to the
new-flushed instances.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If you are using <fo:inline font-style="italic">field access</fo:inline> for your persistent data,
then OpenJPA will not be able to track accesses for any instances, including
ones that you load from the database. So, OpenJPA will perform state-comparison
checks to determine which fields are dirty. These state comparison checks are
costly in two ways. First, there is a performance penalty at flush / commit
time, since OpenJPA must walk through every field of every instance to determine
which fields of which records are dirty. Second, there is a memory penalty,
since OpenJPA must hold hard references to all instances that were loaded at
any time in a given transaction, and since OpenJPA must keep a copy of all
the initial values of the loaded data for later comparison. Additionally,
OpenJPA will ignore requests to evict persistent state for these types of
instances. Finally, the default lazy loading configuration will be ignored for
single-valued fields (one-to-one, many-to-one, and any other non-collection
or non-map field that has a lazy loading configuration). If you use fetch
groups or programmatically configure your fetch plan, OpenJPA will obey these
directives, but will be unable to lazily load any data that you exclude from
loading. As a result of these limitations, it is not recommended that you use
field access if you are not either running the enhancer or using OpenJPA with
a javaagent or in a Java 6 environment.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="ref_guide_pc_oid"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Object Identity
</fo:marker><fo:block font-size="20.735999999999997pt">5.3. 
Object Identity
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e21138"><!--
identity
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA makes several enhancements to JPA's standard entity identity.
</fo:block><fo:block id="ref_guide_pc_oid_datastore"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Datastore Identity
</fo:marker><fo:block font-size="17.28pt">5.3.1. 
Datastore Identity
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e21146"><!--
identity
,
datastore
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The JPA specification requires you to declare one or more identity fields in
your persistent classes. OpenJPA fully supports this form of object identity,
called <fo:inline font-style="italic">application</fo:inline> identity. OpenJPA, however, also
supports <fo:inline font-style="italic">datastore</fo:inline> identity. In datastore identity, you do
not declare any primary key fields. OpenJPA manages the identity of your
persistent objects for you through a surrogate key in the database.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can control how your JPA datastore identity value is generated through
OpenJPA's
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/DataStoreId.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.DataStoreId</fo:inline></fo:basic-link> class
annotation. This annotation has <fo:inline font-family="monospace">strategy</fo:inline> and <fo:inline font-family="monospace">
generator</fo:inline> properties that mirror the same-named properties on the
standard <fo:inline font-family="monospace">javax.persistence.GeneratedValue</fo:inline> annotation
described in <fo:basic-link internal-destination="jpa_overview_meta_id"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.2, “
Id
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_id"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_id"/>]</fo:inline></fo:basic-link> of the JPA Overview.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To retrieve the identity value of a datastore identity entity, use the
<fo:inline font-family="monospace">OpenJPAEntityManager.getObjectId(Object entity)</fo:inline>
method. See <fo:basic-link internal-destination="ref_guide_runtime_em"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 9.2.2, “
OpenJPAEntityManager
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_runtime_em"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_runtime_em"/>]</fo:inline></fo:basic-link> for more information on
the <fo:inline font-family="monospace">OpenJPAEntityManager</fo:inline>.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_pc_oid_datastoreentityex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.4. 
JPA Datastore Identity Metadata
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e21190">
import org.apache.openjpa.persistence.*;
@Entity
@DataStoreId
public class LineItem {
... no @Id fields declared ...
}
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Internally, OpenJPA uses the public
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/util/Id.html"><fo:inline font-family="monospace">
org.apache.openjpa.util.Id</fo:inline></fo:basic-link> class for datastore identity
objects. When writing OpenJPA plugins, you can manipulate datastore identity
objects by casting them to this class. You can also create your own <fo:inline font-family="monospace">
Id</fo:inline> instances and pass them to any internal OpenJPA method that
expects an identity object.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In JPA, you will never see <fo:inline font-family="monospace">Id</fo:inline> instances directly.
Instead, calling <fo:inline font-family="monospace">OpenJPAEntityManager.getObjectId</fo:inline> on a
datastore identity object will return the <fo:inline font-family="monospace">Long</fo:inline> surrogate
primary key value for that object. You can then use this value in calls to
<fo:inline font-family="monospace">EntityManager.find</fo:inline> for subsequent lookups of the same
record.
</fo:block></fo:block><fo:block id="ref_guide_pc_oid_entitypk"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Entities as Identity Fields
</fo:marker><fo:block font-size="17.28pt">5.3.2. 
Entities as Identity Fields
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e21218"><!--
identity
,
application
,
entity id fields
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The JPA specification limits identity fields to simple types. OpenJPA, however,
also allows <fo:inline font-family="monospace">ManyToOne</fo:inline> and <fo:inline font-family="monospace">OneToOne</fo:inline>
relations to be identity fields. To identify a relation field as an identity
field, simply annotate it with both the <fo:inline font-family="monospace">@ManyToOne</fo:inline> or
<fo:inline font-family="monospace">@OneToOne</fo:inline> relation annotation and the <fo:inline font-family="monospace">@Id</fo:inline>
identity annotation.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When finding an entity identified by a relation, pass the id of the
<fo:inline font-style="italic">relation</fo:inline> to the <fo:inline font-family="monospace">EntityManager.find</fo:inline>
method:
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_pc_oid_entitypk_simplefind"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.5. 
Finding an Entity with an Entity Identity Field
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e21253">
public Delivery createDelivery(EntityManager em, Order order) {
Delivery delivery = new Delivery();
delivery.setId(o);
delivery.setDelivered(new Date());
return delivery;
}
public Delivery findDelivery(EntityManager em, Order order) {
// use the identity of the related instance
return em.find(Delivery.class, order.getId());
}
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When your entity has multiple identity fields, at least one of which is a
relation to another entity, you must use an identity class (see
<fo:basic-link internal-destination="jpa_overview_pc_identitycls"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.2.1, “
Identity Class
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_pc_identitycls"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_pc_identitycls"/>]</fo:inline></fo:basic-link> in the JPA Overview). You cannot
use an embedded identity object. Identity class fields corresponding to
entity identity fields should be of the same type as the related entity's
identity.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_pc_oid_entitypk_idcls"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.6. 
Id Class for Entity Identity Fields
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e21262">
@Entity
public class Order {
@Id
private long id;
...
}
@Entity
@IdClass(LineItemId.class)
public class LineItem {
@Id
private int index;
@Id
@ManyToOne
private Order order;
...
}
public class LineItemId {
public int index;
public long order; // same type as order's identity
...
}
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In the example above, if <fo:inline font-family="monospace">Order</fo:inline> had used an identity
class <fo:inline font-family="monospace">OrderId</fo:inline> in place of a simple <fo:inline font-family="monospace">long
</fo:inline> value, then the <fo:inline font-family="monospace">LineItemId.order</fo:inline> field would
have been of type <fo:inline font-family="monospace">OrderId</fo:inline>.
</fo:block></fo:block><fo:block id="ref_guide_pc_oid_application"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Application Identity Tool
</fo:marker><fo:block font-size="17.28pt">5.3.3. 
Application Identity Tool
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e21284"><!--
identity
,
application
,
application identity tool
--></fo:wrapper><fo:wrapper id="d0e21291"><!--
application identity tool
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If you choose to use application identity, you may want to take advantage of
OpenJPA's application identity tool. The application
identity tool generates Java code implementing the identity class for any
persistent type using application identity. The code satisfies all the
requirements the specification places on identity classes. You can use it as-is,
or simply use it as a starting point, editing it to meet your needs.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Before you can run the application identity tool on a persistent class, the
class must be compiled and must have complete metadata. All primary key fields
must be marked as such in the metadata.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In JPA metadata, do not attempt to specify the <fo:inline font-family="monospace">@IdClass</fo:inline>
annotation unless you are using the application identity tool to overwrite an
existing identity class. Attempting to set the value of the <fo:inline font-family="monospace">@IdClass
</fo:inline> to a non-existent class will prevent your persistent class from
compiling. Instead, use the <fo:inline font-family="monospace">-name</fo:inline> or <fo:inline font-family="monospace">-suffix
</fo:inline> options described below to tell OpenJPA what name to give your
generated identity class. Once the application identity tool has generated the
class code, you can set the <fo:inline font-family="monospace">@IdClass</fo:inline> annotation.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The application identity tool can be invoked via its Java class,
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/enhance/ApplicationIdTool">
<fo:inline font-family="monospace">org.apache.openjpa.enhance.ApplicationIdTool</fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e21322"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:basic-link internal-destination="ref_guide_integration_appidtool"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.1.3, “
Application Identity Tool Ant Task
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_integration_appidtool"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_integration_appidtool"/>]</fo:inline></fo:basic-link> describes the
application identity tool's Ant task.
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_pc_appid_appidtool"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.7. 
Using the Application Identity Tool
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e21330">
java org.apache.openjpa.enhance.ApplicationIdTool -s Id Magazine.java
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The application identity tool accepts the standard set of command-line arguments
defined by the configuration framework (see
<fo:basic-link internal-destination="ref_guide_conf_devtools"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.3, “
Command Line Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_devtools"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_devtools"/>]</fo:inline></fo:basic-link>), including code formatting
flags described in <fo:basic-link internal-destination="ref_guide_conf_devtools_format"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.3.1, “
Code Formatting
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_devtools_format"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_devtools_format"/>]</fo:inline></fo:basic-link>. It
also accepts the following arguments:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e21338"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21339"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-directory/-d &lt;output directory&gt;</fo:inline>: Path to the output
directory. If the directory does not match the generated oid class' package, the
package structure will be created beneath the directory. If not specified, the
tool will first try to find the directory of the <fo:inline font-family="monospace">.java</fo:inline> file
for the persistence-capable class, and failing that will use the current
directory.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21348"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-ignoreErrors/-i &lt;true/t | false/f&gt;</fo:inline>: If <fo:inline font-family="monospace">false
</fo:inline>, an exception will be thrown if the tool is run on any class that
does not use application identity, or is not the base class in the inheritance
hierarchy (recall that subclasses never define the application identity class;
they inherit it from their persistent superclass).
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21357"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-token/-t &lt;token&gt;</fo:inline>: The token to use to separate
stringified primary key values in the string form of the object id. This option
is only used if you have multiple primary key fields. It defaults to "::".
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21363"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-name/-n &lt;id class name&gt;</fo:inline>: The name of the identity
class to generate. If this option is specified, you must run the tool on exactly
one class. If the class metadata already names an object id class, this option
is ignored. If the name is not fully qualified, the persistent class' package is
prepended to form the qualified name.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21369"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-suffix/-s &lt;id class suffix&gt;</fo:inline>: A string to suffix each
persistent class name with to form the identity class name. This option is
overridden by <fo:inline font-family="monospace">-name</fo:inline> or by any object id class specified in
metadata.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Each additional argument to the tool must be one of the following:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e21380"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21381"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The full name of a persistent class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21384"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The .java file for a persistent class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21387"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The <fo:inline font-family="monospace">.class</fo:inline> file of a persistent class.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If you do not supply any arguments to the tool, it will act on the classes in
your persistent classes list (see <fo:basic-link internal-destination="ref_guide_pc_pcclasses"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.1, “
Persistent Class List
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_pcclasses"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_pcclasses"/>]</fo:inline></fo:basic-link>).
</fo:block></fo:block><fo:block id="ref_guide_pc_oid_pkgen_autoinc"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Autoassign / Identity Strategy Caveats
</fo:marker><fo:block font-size="17.28pt">5.3.4. 
Autoassign / Identity Strategy Caveats
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e21400"><!--
datastore identity
,
autoassign strategy
--></fo:wrapper><fo:wrapper id="d0e21405"><!--
datastore identity
,
autoassign strategy
--></fo:wrapper><fo:wrapper id="d0e21410"><!--
persistent fields
,
autoassign strategy
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:basic-link internal-destination="jpa_overview_meta_gen"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.3, “
Generated Value
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_gen"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_gen"/>]</fo:inline></fo:basic-link> explains how to use JPA's
<fo:inline font-family="monospace">IDENTITY</fo:inline> generation type to automatically assign field
values. However, here are some additional caveats you should be aware of when
using <fo:inline font-family="monospace">IDENTITY</fo:inline> generation:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.2em" id="d0e21425"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21426"><fo:list-item-label end-indent="label-end()"><fo:block>1.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Your database must support auto-increment / identity columns, or some equivalent
(see <fo:basic-link internal-destination="ref_guide_dbsetup_dbsupport_oracle"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.4.3, “
OracleDictionary Properties
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_dbsupport_oracle"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_dbsupport_oracle"/>]</fo:inline></fo:basic-link> for how to
configure a combination of triggers and sequences to fake auto-increment support
in Oracle).
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21431"><fo:list-item-label end-indent="label-end()"><fo:block>2.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Auto-increment / identity columns must be an integer or long integer type.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21434"><fo:list-item-label end-indent="label-end()"><fo:block>3.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Databases support auto-increment / identity columns to varying degrees. Some do
not support them at all. Others only allow a single such column per table, and
require that it be the primary key column. More lenient databases may allow
non-primary key auto-increment columns, and may allow more than one per table.
See your database documentation for details.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="ref_guide_inverses"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Managed Inverses
</fo:marker><fo:block font-size="20.735999999999997pt">5.4. 
Managed Inverses
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e21440"><!--
bidirectional relations
,
automatic management
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Bidirectional relations are an essential part of data modeling.
<fo:basic-link internal-destination="jpa_overview_mapping"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 12, <fo:inline font-style="italic">
Mapping Metadata
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping"/>]</fo:inline></fo:basic-link> in the JPA Overview explains how to
use the <fo:inline font-family="monospace">mappedBy</fo:inline> annotation attribute to form bidirectional
relations that also share datastore storage in JPA.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA also allows you to define purely logical bidirectional relations. The
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/InverseLogical.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.InverseLogical</fo:inline></fo:basic-link>
annotation names a logical inverse in JPA metadata.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_inverses_logicalex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.8. 
Specifying Logical Inverses
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-family="monospace">Magazine.coverPhoto</fo:inline> and <fo:inline font-family="monospace">Photograph.mag</fo:inline> are
each mapped to different foreign keys in their respective tables, but form a
logical bidirectional relation. Only one of the fields needs to declare the
other as its logical inverse, though it is not an error to set the logical
inverse of both fields.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e21470">
import org.apache.openjpa.persistence.*;
@Entity
public class Magazine {
@OneToOne
private Photograph coverPhoto;
...
}
@Entity
public class Photograph {
@OneToOne
@InverseLogical("coverPhoto")
private Magazine mag;
...
}
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Java does not provide any native facilities to ensure that both sides of a
bidirectional relation remain consistent. Whenever you set one side of the
relation, you must manually set the other side as well.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
By default, OpenJPA behaves the same way. OpenJPA does not automatically
propagate changes from one field in bidirectional relation to the other field.
This is in keeping with the philosophy of transparency, and also provides higher
performance, as OpenJPA does not need to analyze your object graph to correct
inconsistent relations.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e21478"><!--
InverseManager
--></fo:wrapper>
If convenience is more important to you than strict transparency, however, you
can enable inverse relation management in OpenJPA. Set the
<fo:basic-link internal-destination="openjpa.InverseManager"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">openjpa.InverseManager
</fo:inline></fo:inline></fo:basic-link> plugin property to <fo:inline font-family="monospace">true</fo:inline> for standard
management. Under this setting, OpenJPA detects changes to either side of a
bidirectional relation (logical or physical), and automatically sets the other
side appropriately on flush.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_inversesex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.9. 
Enabling Managed Inverses
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e21492">
&lt;property name="openjpa.InverseManager" value="true"/&gt;
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The inverse manager has options to log a warning or throw an exception when it
detects an inconsistent bidirectional relation, rather than correcting it. To
use these modes, set the manager's <fo:inline font-family="monospace">Action</fo:inline> property to
<fo:inline font-family="monospace">warn</fo:inline> or <fo:inline font-family="monospace">exception</fo:inline>, respectively.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
By default, OpenJPA excludes <fo:basic-link internal-destination="ref_guide_pc_scos_proxy_lrs"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"> large
result set fields</fo:inline></fo:basic-link> from management. You can force large result set fields
to be included by setting the <fo:inline font-family="monospace">ManageLRS</fo:inline> plugin property to
<fo:inline font-family="monospace">true</fo:inline>.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_inverses_logex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.10. 
Log Inconsistencies
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e21519">
&lt;property name="openjpa.InverseManager" value="true(Action=warn)"/&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_pc_scos"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Persistent Fields
</fo:marker><fo:block font-size="20.735999999999997pt">5.5. 
Persistent Fields
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e21524"><!--
persistent fields
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA enhances the specification's support for persistent fields in many ways.
This section documents aspects of OpenJPA's persistent field handling that may
affect the way you design your persistent classes.
</fo:block><fo:block id="ref_guide_pc_scos_restore"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Restoring State
</fo:marker><fo:block font-size="17.28pt">5.5.1. 
Restoring State
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e21532"><!--
persistent fields
,
field rollback
--></fo:wrapper><fo:wrapper id="d0e21537"><!--
RestoreState
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
While the JPA specification says that you should not use rolled back objects,
such objects are perfectly valid in OpenJPA. You can control whether the
objects' managed state is rolled back to its pre-transaction values with the
<fo:basic-link internal-destination="openjpa.RestoreState"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">openjpa.RestoreState</fo:inline>
</fo:inline></fo:basic-link> configuration property. <fo:inline font-family="monospace">none</fo:inline> does not roll back state
(the object becomes hollow, and will re-load its state the next time it is
accessed), <fo:inline font-family="monospace">immutable</fo:inline> restores immutable values (primitives,
primitive wrappers, strings) and clears mutable values so that they are reloaded
on next access, and <fo:inline font-family="monospace">all</fo:inline> restores all managed values to their
pre-transaction state.
</fo:block></fo:block><fo:block id="ref_guide_pc_scos_order"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Typing and Ordering
</fo:marker><fo:block font-size="17.28pt">5.5.2. 
Typing and Ordering
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e21559"><!--
persistent fields
,
comparators
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When loading data into a field, OpenJPA examines the value you assign the field
in your declaration code or in your no-args constructor. If the field value's
type is more specific than the field's declared type, OpenJPA uses the value
type to hold the loaded data. OpenJPA also uses the comparator you've
initialized the field with, if any. Therefore, you can use custom comparators on
your persistent field simply by setting up the comparator and using it in your
field's initial value.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_pc_scos_order_initialvals"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.11. 
Using Initial Field Values
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Though the annotations are left out for simplicity, assume <fo:inline font-family="monospace">
employeesBySal</fo:inline> and <fo:inline font-family="monospace">departments</fo:inline> are persistent
fields in the class below.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e21577">
public class Company {
// OpenJPA will detect the custom comparator in the initial field value
// and use it whenever loading data from the database into this field
private Collection employeesBySal = new TreeSet(new SalaryComparator());
private Map departments;
public Company {
// or we can initialize fields in our no-args constructor; even though
// this field is declared type Map, OpenJPA will detect that it's
// actually a TreeMap and use natural ordering for loaded data
departments = new TreeMap();
}
// rest of class definition...
}
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_pc_calendar_timezone"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Calendar Fields and TimeZones
</fo:marker><fo:block font-size="17.28pt">5.5.3. 
Calendar Fields and TimeZones
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e21582"><!--
persistent fields
,
calendar
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA's support for the <fo:inline font-family="monospace">java.util.Calendar</fo:inline> type will
store only the <fo:inline font-family="monospace">Date</fo:inline> part of the field, not the
<fo:inline font-family="monospace">TimeZone</fo:inline> associated with the field. When loading the date
into the <fo:inline font-family="monospace">Calendar</fo:inline> field, OpenJPA will use the <fo:inline font-family="monospace">
TimeZone</fo:inline> that was used to initialize the field.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e21604"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA will automatically track changes made via modification methods in fields
of type <fo:inline font-family="monospace">Calendar</fo:inline>, with one exception: when using Java
version 1.3, the <fo:inline font-family="monospace">set()</fo:inline> method cannot be overridden, so
when altering the calendar using that method, the field must be explicitly
marked as dirty. This limitation does not apply when running with Java version
1.4 and higer.
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_pc_scos_proxy"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Proxies
</fo:marker><fo:block font-size="17.28pt">5.5.4. 
Proxies
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e21616"><!--
proxies
--></fo:wrapper><fo:wrapper id="d0e21619"><!--
persistent fields
,
proxies
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
At runtime, the values of all mutable second class object fields in persistent
and transactional objects are replaced with implementation-specific proxies. On
modification, these proxies notify their owning instance that they have been
changed, so that the appropriate updates can be made on the datastore.
</fo:block><fo:block id="ref_guide_pc_scos_proxy_smart"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">5.5.4.1. 
Smart Proxies
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e21631"><!--
proxies
,
smart
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Most proxies only track whether or not they have been modified. Smart proxies
for collection and map fields, however, keep a record of which elements have
been added, removed, and changed. This record enables the OpenJPA runtime to
make more efficient database updates on these fields.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When designing your persistent classes, keep in mind that you can optimize for
OpenJPA smart proxies by using fields of type <fo:inline font-family="monospace">java.util.Set
</fo:inline>, <fo:inline font-family="monospace">java.util.TreeSet</fo:inline>, and <fo:inline font-family="monospace">
java.util.HashSet</fo:inline> for your collections whenever possible. Smart
proxies for these types are more efficient than proxies for <fo:inline font-family="monospace">
List</fo:inline>s. You can also design your own smart proxies to further
optimize OpenJPA for your usage patterns. See the section on
<fo:basic-link internal-destination="ref_guide_pc_scos_proxy_custom"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">custom proxies</fo:inline></fo:basic-link> for
details.
</fo:block></fo:block><fo:block id="ref_guide_pc_scos_proxy_lrs"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">5.5.4.2. 
Large Result Set Proxies
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e21658"><!--
proxies
,
large result set
--></fo:wrapper><fo:wrapper id="d0e21663"><!--
large result sets
,
fields
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Under standard ORM behavior, traversing a persistent collection or map field
brings the entire contents of that field into memory. Some persistent fields,
however, might represent huge amounts of data, to the point that attempting to
fully instantiate them can overwhelm the JVM or seriously degrade performance.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA uses special proxy types to represent these "large result set" fields.
OpenJPA's large result set proxies do not cache any data in memory. Instead,
each operation on the proxy offloads the work to the database and returns the
proper result. For example, the <fo:inline font-family="monospace">contains</fo:inline> method of a
large result set collection will perform a <fo:inline font-family="monospace"> SELECT COUNT(*)</fo:inline>
query with the proper <fo:inline font-family="monospace">WHERE</fo:inline> conditions to find out if the
given element exists in the database's record of the collection. Similarly, each
time you obtain an iterator OpenJPA performs the proper query using the current
<fo:basic-link internal-destination="ref_guide_dbsetup_lrs"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">large result set settings</fo:inline></fo:basic-link>, as
discussed in the <fo:basic-link internal-destination="ref_guide_dbsetup"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">JDBC</fo:inline></fo:basic-link> chapter. As you
invoke <fo:inline font-family="monospace">Iterator.next</fo:inline>, OpenJPA instantiates the result
objects on-demand.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can free the resources used by a large result set iterator by passing it to
the static <fo:basic-link internal-destination="ref_guide_runtime_openjpapersistence"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
OpenJPAPersistence.close</fo:inline></fo:inline></fo:basic-link> method.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_pc_scos_proxy_lrs_itr"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.12. 
Using a Large Result Set Iterator
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e21699">
import org.apache.openjpa.persistence.*;
...
Collection employees = company.getEmployees(); // employees is a lrs collection
Iterator itr = employees.iterator();
while (itr.hasNext())
process((Employee) itr.next());
OpenJPAPersistence.close(itr);
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can also add and remove from large result set proxies, just as with standard
fields. OpenJPA keeps a record of all changes to the elements of the proxy,
which it uses to make sure the proper results are always returned from
collection and map methods, and to update the field's database record on commit.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In order to use large result set proxies in JPA, add the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/LRS.html"><fo:inline font-family="monospace">
org.apache.openjpa.persistence.LRS</fo:inline></fo:basic-link> annotation to the
persistent field.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following restrictions apply to large result set fields:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e21711"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21712"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The field must be declared as either a <fo:inline font-family="monospace">java.util.Collection
</fo:inline> or <fo:inline font-family="monospace">java.util.Map</fo:inline>. It cannot be declared as
any other type, including any sub-interface of collection or map, or any
concrete collection or map class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21721"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The field cannot have an externalizer (see
<fo:basic-link internal-destination="ref_guide_pc_extern"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.5.5, “
Externalization
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_extern"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_extern"/>]</fo:inline></fo:basic-link>).
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21726"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Because they rely on their owning object for context, large result set proxies
cannot be transferred from one persistent field to another. The following code
would result in an error on commit:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e21729">
Collection employees = company.getEmployees() // employees is a lrs collection
company.setEmployees(null);
anotherCompany.setEmployees(employees);
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_pc_scos_proxy_lrs_extension"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.13. 
Marking a Large Result Set Field
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e21734">
import org.apache.openjpa.persistence.*;
@Entity
public class Company {
@ManyToMany
@LRS private Collection&lt;Employee&gt; employees;
...
}
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_pc_scos_proxy_custom"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">5.5.4.3. 
Custom Proxies
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e21739"><!--
proxies
,
custom
--></fo:wrapper><fo:wrapper id="d0e21744"><!--
proxies
,
ProxyManager
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA manages proxies through the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/util/ProxyManager.html"><fo:inline font-family="monospace">
org.apache.openjpa.util.ProxyManager</fo:inline></fo:basic-link> interface. OpenJPA
includes a default proxy manager, the <fo:inline font-family="monospace">
org.apache.openjpa.util.ProxyManagerImpl</fo:inline> (with a plugin alias name
of <fo:inline font-family="monospace">default</fo:inline>), that will meet the needs of most users. The
default proxy manager understands the following configuration properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e21761"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21762"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">TrackChanges</fo:inline>: Whether to use
<fo:basic-link internal-destination="ref_guide_pc_scos_proxy_smart"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">smart proxies</fo:inline></fo:basic-link>. Defaults to
<fo:inline font-family="monospace">true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21774"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">AssertAllowedType</fo:inline>: Whether to immediately throw an exception
if you attempt to add an element to a collection or map that is not assignable
to the element type declared in metadata. Defaults to <fo:inline font-family="monospace">false</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The default proxy manager can proxy the standard methods of any
<fo:inline font-family="monospace">Collection</fo:inline>, <fo:inline font-family="monospace">List</fo:inline>,
<fo:inline font-family="monospace">Map</fo:inline>, <fo:inline font-family="monospace">Queue</fo:inline>,
<fo:inline font-family="monospace">Date</fo:inline>, or <fo:inline font-family="monospace">Calendar</fo:inline> class,
including custom implementations. It can also proxy custom classes whose
accessor and mutator methods follow JavaBean naming conventions. Your custom
types must, however, meet the following criteria:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e21803"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21804"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Custom container types must have a public no-arg constructor or a public
constructor that takes a single <fo:inline font-family="monospace">Comparator</fo:inline> parameter.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21810"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Custom date types must have a public no-arg constructor or a public
constructor that takes a single <fo:inline font-family="monospace">long</fo:inline> parameter
representing the current time.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e21816"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Other custom types must have a public no-arg constructor or a public copy
constructor. If a custom types does not have a copy constructor, it must be
possible to fully copy an instance A by creating a new instance B and calling
each of B's setters with the value from the corresponding getter on A.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If you have custom classes that must be proxied and do not meet these
requirements, OpenJPA allows you to define your own proxy classes and
your own proxy manager. See the <fo:inline font-family="monospace">openjpa.util</fo:inline> package
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/">Javadoc</fo:basic-link> for details on the interfaces involved,
and the utility classes OpenJPA provides to assist you.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can plug your custom proxy manager into the OpenJPA runtime through the
<fo:basic-link internal-destination="openjpa.ProxyManager"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace"> openjpa.ProxyManager</fo:inline>
</fo:inline></fo:basic-link> configuration property.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_pc_scos_proxy_custom_ex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.14. 
Configuring the Proxy Manager
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e21837">
&lt;property name="openjpa.ProxyManager" value="TrackChanges=false"/&gt;
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_pc_extern"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Externalization
</fo:marker><fo:block font-size="17.28pt">5.5.5. 
Externalization
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e21842"><!--
externalization
--></fo:wrapper><fo:wrapper id="d0e21845"><!--
persistent fields
,
externalization
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA offers the ability to write
<fo:basic-link internal-destination="ref_guide_mapping_custom_field"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">custom field mappings</fo:inline></fo:basic-link> in
order to have complete control over the mechanism with which fields are stored,
queried, and loaded from the datastore. Often, however, a custom mapping is
overkill. There is often a simple transformation from a Java field value to its
database representation. Thus, OpenJPA provides the externalization service.
Externalization allows you to specify methods that will externalize a field
value to its database equivalent on store and then rebuild the value from its
externalized form on load.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e21857"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Fields of embeddable classes used for <fo:inline font-family="monospace">@EmbeddedId</fo:inline> values in
JPA cannot have externalizers.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The OpenJPA
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/Externalizer.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.Externalizer</fo:inline></fo:basic-link>
annotation sets the name of a method that will be invoked to convert
the field into its external form for database storage. You can specify either
the name of a non-static method, which will be invoked on the field value, or a
static method, which will be invoked with the field value as a parameter. Each
method can also take an optional
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/StoreContext.html"><fo:inline font-family="monospace">
StoreContext</fo:inline></fo:basic-link> parameter for access to a persistence context.
The return value of the method is the field's external form. By default, OpenJPA
assumes that all named methods belong to the field value's class (or its
superclasses). You can, however, specify static methods of other classes using
the format <fo:inline font-family="monospace">&lt;class-name&gt;.&lt;method-name&gt;</fo:inline>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Given a field of type <fo:inline font-family="monospace">CustomType</fo:inline> that externalizes to a
string, the table below demonstrates several possible externalizer methods and
their corresponding metadata extensions.
</fo:block><fo:block xmlns:rx="http://www.renderx.com/XSL/Extensions" space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="d0e21882"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Table 5.1. 
Externalizer Options
</fo:block><fo:table border-before-width.conditionality="retain" border-collapse="collapse" border-left-style="solid" border-right-style="solid" border-top-style="solid" border-bottom-style="solid" border-left-width="0.5pt" border-right-width="0.5pt" border-top-width="0.5pt" border-bottom-width="0.5pt" border-left-color="black" border-right-color="black" border-top-color="black" border-bottom-color="black" table-layout="fixed" width="100%"><fo:table-column column-number="1"/><fo:table-column column-number="2"/><fo:table-header start-indent="0pt" end-indent="0pt"><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">
Method
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block font-weight="bold">
Extension
</fo:block></fo:table-cell></fo:table-row></fo:table-header><fo:table-body start-indent="0pt" end-indent="0pt"><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-family="monospace">
public String CustomType.toString()
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
<fo:inline font-family="monospace">
@Externalizer("toString")
</fo:inline>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-family="monospace">
public String CustomType.toString(StoreContext ctx)
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
<fo:inline font-family="monospace">
@Externalizer("toString")
</fo:inline>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-family="monospace">
public static String AnyClass.toString(CustomType ct)
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
<fo:inline font-family="monospace">
@Externalizer("AnyClass.toString")
</fo:inline>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-family="monospace">
public static String AnyClass.toString(CustomType ct, StoreContext ctx)
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" text-align="left"><fo:block>
<fo:inline font-family="monospace">
@Externalizer("AnyClass.toString")
</fo:inline>
</fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The OpenJPA
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/Factory.html"><fo:inline font-family="monospace">
org.apache.openjpa.persistence.Factory</fo:inline></fo:basic-link> annotation
contains the name of a method that will be invoked to instantiate the field from
the external form stored in the database. Specify a static method name. The
method will will be invoked with the externalized value and must return an
instance of the field type. The method can also take an optional
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/StoreContext.html"><fo:inline font-family="monospace">
StoreContext</fo:inline></fo:basic-link> parameter for access to a persistence context.
If a factory is not specified, OpenJPA will use the constructor of the field
type that takes a single argument of the external type, or will throw an
exception if no constructor with that signature exists.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Given a field of type <fo:inline font-family="monospace">CustomType</fo:inline> that externalizes to a
string, the table below demonstrates several possible factory methods and their
corresponding metadata extensions.
</fo:block><fo:block xmlns:rx="http://www.renderx.com/XSL/Extensions" space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="d0e21954"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Table 5.2. 
Factory Options
</fo:block><fo:table border-before-width.conditionality="retain" border-collapse="collapse" border-left-style="solid" border-right-style="solid" border-top-style="solid" border-bottom-style="solid" border-left-width="0.5pt" border-right-width="0.5pt" border-top-width="0.5pt" border-bottom-width="0.5pt" border-left-color="black" border-right-color="black" border-top-color="black" border-bottom-color="black" table-layout="fixed" width="100%"><fo:table-column column-number="1"/><fo:table-column column-number="2"/><fo:table-header start-indent="0pt" end-indent="0pt"><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">
Method
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block font-weight="bold">
Extension
</fo:block></fo:table-cell></fo:table-row></fo:table-header><fo:table-body start-indent="0pt" end-indent="0pt"><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-family="monospace">
public CustomType(String str)
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
none
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-family="monospace">
public static CustomType CustomType.fromString(String str)
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
<fo:inline font-family="monospace">
@Factory("fromString")
</fo:inline>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-family="monospace">
public static CustomType CustomType.fromString(String str, StoreContext ctx)
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
<fo:inline font-family="monospace">
@Factory("fromString")
</fo:inline>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-family="monospace">
public static CustomType AnyClass.fromString(String str)
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
<fo:inline font-family="monospace">
@Factory("AnyClass.fromString")
</fo:inline>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-family="monospace">
public static CustomType AnyClass.fromString(String str, StoreContext ctx)
</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" text-align="left"><fo:block>
<fo:inline font-family="monospace">
@Factory("AnyClass.fromString")
</fo:inline>
</fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If your externalized field is not a standard persistent type, you must
explicitly mark it persistent. In OpenJPA, you can force a persistent field
by annotating it with <fo:basic-link internal-destination="ref_guide_meta_jpa_persistent"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
org.apache.openjpa.persistence.Persistent</fo:inline></fo:inline></fo:basic-link> annotation.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e22025"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If your custom field type is mutable and is not a standard collection, map, or
date class, OpenJPA will not be able to detect changes to the field. You must
mark the field dirty manually, or create a custom field proxy.
See
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/OpenJPAEntityManager.html">
<fo:inline font-family="monospace">OpenJPAEntityManager.dirty</fo:inline></fo:basic-link> for how to mark a
field dirty manually in JPA.
See <fo:basic-link internal-destination="ref_guide_pc_scos_proxy"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.5.4, “
Proxies
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_scos_proxy"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_scos_proxy"/>]</fo:inline></fo:basic-link> for a discussion of proxies.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can externalize a field to virtually any value that is supported by
OpenJPA's field mappings (embedded relations are the exception; you must declare
your field to be a persistence-capable type in order to embed it). This means
that a field can externalize to something as simple as a primitive, something as
complex as a collection or map of entities, or anything in
between. If you do choose to externalize to a collection or map, OpenJPA
recognizes a family of metadata extensions for specying type information for the
externalized form of your fields - see <fo:basic-link internal-destination="type"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 6.3.2.6, “
Type
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="type"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="type"/>]</fo:inline></fo:basic-link>. If the
external form of your field is an entity object or contains entities, OpenJPA
will correctly include the objects in its persistence-by-reachability
algorithms and its delete-dependent algorithms.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The example below demonstrates a few forms of externalization.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_pc_externex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.15. 
Using Externalization
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e22044">
import org.apache.openjpa.persistence.*;
@Entity
public class Magazine {
// use Class.getName and Class.forName to go to/from strings
@Persistent
@Externalizer("getName")
@Factory("forName")
private Class cls;
// use URL.getExternalForm for externalization. no factory;
// we can rely on the URL string constructor
@Persistent
@Externalizer("toExternalForm")
private URL url;
// use our custom methods
@Persistent
@Externalizer("Magazine.authorsFromCustomType")
@Factory("Magazine.authorsToCustomType")
@ElementType(Author.class)
private CustomType customType;
public static Collection authorsFromCustomType(CustomType customType) {
... logic to pack custom type into a list of authors ...
}
public static CustomType authorsToCustomType (Collection authors) {
... logic to create custom type from a collection of authors ...
}
...
}
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e22048"><!--
externalization
,
queries
--></fo:wrapper>
You can query externalized fields using parameters. Pass in a value of the field
type when executing the query. OpenJPA will externalize the parameter using the
externalizer method named in your metadata, and compare the externalized
parameter with the value stored in the database. As a shortcut, OpenJPA also
allows you to use parameters or literals of the field's externalized type in
queries, as demonstrated in the example below.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e22054"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Currently, queries are limited to fields that externalize to a primitive,
primitive wrapper, string, or date types, due to constraints on query syntax.
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_pc_extern_queryex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.16. 
Querying Externalization Fields
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Assume the <fo:inline font-family="monospace">Magazine</fo:inline> class has the same fields as in the
previous example.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e22065">
// you can query using parameters
Query q = em.createQuery("select m from Magazine m where m.url = :u");
q.setParameter("u", new URL("http://www.solarmetric.com"));
List results = q.getResultList();
// or as a shortcut, you can use the externalized form directly
q = em.createQuery("select m from Magazine m where m.url = 'http://www.solarmetric.com'");
results = q.getResultList();
</fo:block></fo:block></fo:block><fo:block id="ref_guide_pc_extern_values"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">5.5.5.1. 
External Values
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e22070"><!--
externalization
,
external values
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Externalization often takes simple constant values and transforms them to
constant values of a different type. An example would be storing a <fo:inline font-family="monospace">
boolean</fo:inline> field as a <fo:inline font-family="monospace">char</fo:inline>, where <fo:inline font-family="monospace">true
</fo:inline> and <fo:inline font-family="monospace">false</fo:inline> would be stored in the database as
<fo:inline font-family="monospace">'T'</fo:inline> and <fo:inline font-family="monospace">'F'</fo:inline> respectively.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA allows you to define these simple translations in metadata, so that the
field behaves as in <fo:basic-link internal-destination="ref_guide_pc_extern"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">full-fledged
externalization</fo:inline></fo:basic-link> without requiring externalizer and factory methods.
External values supports translation of pre-defined simple types (primitives,
primitive wrappers, and Strings), to other pre-defined simple values.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Use the OpenJPA
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/ExternalValues.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.ExternalValues</fo:inline></fo:basic-link>
annotation to define external value translations. The values are
defined in a format similar to that of <fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">
configuration plugins</fo:inline></fo:basic-link>, except that the value pairs represent Java and
datastore values. To convert the Java boolean values of <fo:inline font-family="monospace">true</fo:inline>
and <fo:inline font-family="monospace">false</fo:inline> to the character values <fo:inline font-family="monospace">T</fo:inline> and
<fo:inline font-family="monospace">F</fo:inline>, for example, you would use the extension value: <fo:inline font-family="monospace">
true=T,false=F</fo:inline>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If the type of the datastore value is different from the field's type, use the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/Type.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.Type</fo:inline></fo:basic-link> annotation
to define the datastore type.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="externvalues_ex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.17. 
Using External Values
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This example uses external value translation to transform a string field to an
integer in the database.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e22137">
public class Magazine {
@ExternalValues({"SMALL=5", "MEDIUM=8", "LARGE=10"})
@Type(int.class)
private String sizeWidth;
...
}
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_fetch"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Fetch Groups
</fo:marker><fo:block font-size="20.735999999999997pt">5.6. 
Fetch Groups
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e22142"><!--
fetch groups
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Fetch groups are sets of fields that load together. They can be used to to pool
together associated fields in order to provide performance improvements over
standard data fetching. Specifying fetch groups allows for tuning of lazy
loading and eager fetching behavior.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The JPA Overview's <fo:basic-link internal-destination="jpa_overview_meta_fetch"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.6.1, “
Fetch Type
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_fetch"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_fetch"/>]</fo:inline></fo:basic-link> describes how
to use JPA metadata annotations to control whether a field is fetched eagerly or
lazily. Fetch groups add a dynamic aspect to this standard ability. As you will
see, OpenJPA's JPA extensions allow you can add and remove fetch groups at
runtime to vary the sets of fields that are eagerly loaded.
</fo:block><fo:block id="ref_guide_fetch_custom"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Custom Fetch Groups
</fo:marker><fo:block font-size="17.28pt">5.6.1. 
Custom Fetch Groups
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA places any field that is eagerly loaded according to the JPA metadata
rules into the built-in <fo:inline font-style="italic">default</fo:inline> fetch group. As its name
implies, the default fetch group is active by default. You may also
define your own named fetch groups and activate or deactivate them at runtime,
as described later in this chapter. OpenJPA will eagerly-load the fields in all
active fetch groups when loading objects from the datastore.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You create fetch groups with the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/FetchGroup.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.FetchGroup</fo:inline></fo:basic-link>
annotation. If your class only has one custom fetch group, you can place this
annotation directly on the class declaration. Otherwise, use the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/FetchGroups.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.FetchGroups</fo:inline></fo:basic-link>
annotation to declare an array of individual <fo:inline font-family="monospace">FetchGroup</fo:inline>
values. The <fo:inline font-family="monospace">FetchGroup</fo:inline> annotation has the following
properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e22177"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22178"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String name</fo:inline>: The name of the fetch group. Fetch group names
are global, and are expected to be shared among classes. For example, a shopping
website may use a <fo:inline font-style="italic">detail</fo:inline> fetch group in each product class
to efficiently load all the data needed to display a product's "detail" page.
The website might also define a sparse <fo:inline font-style="italic">list</fo:inline> fetch group
containing only the fields needed to display a table of products, as in a search
result.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following names are reserved for use by OpenJPA: <fo:inline font-family="monospace">default</fo:inline>
, <fo:inline font-family="monospace">values</fo:inline>, <fo:inline font-family="monospace">all</fo:inline>, <fo:inline font-family="monospace">none</fo:inline>,
and any name beginning with <fo:inline font-family="monospace">jdo</fo:inline>, <fo:inline font-family="monospace">jpa</fo:inline>, or
<fo:inline font-family="monospace">openjpa</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22213"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">FetchAttribute[] attributes</fo:inline>: The set of persistent fields or
properties in the fetch group.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22219"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String[] fetchGroups</fo:inline>: Other fetch groups whose fields to
include in this group.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
As you might expect, listing a
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/FetchAttribute.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.FetchAttribute</fo:inline></fo:basic-link>
within a <fo:inline font-family="monospace">FetchGroup</fo:inline> includes the corresponding persistent
field or property in the fetch group. Each <fo:inline font-family="monospace">FetchAttribute</fo:inline>
has the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e22238"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22239"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String name</fo:inline>: The name of the persistent field or property to
include in the fetch group.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22245"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">recursionDepth</fo:inline>: If the attribute represents a relation, the
maximum number of same-typed relations to eager-fetch from this field. Defaults
to 1. For example, consider an <fo:inline font-family="monospace">Employee</fo:inline> class with a
<fo:inline font-family="monospace">manager</fo:inline> field, also of type <fo:inline font-family="monospace">Employee</fo:inline>.
When we load an <fo:inline font-family="monospace">Employee</fo:inline> and the <fo:inline font-family="monospace">
manager</fo:inline> field is in an active fetch group, the recursion depth (along
with the max fetch depth setting, described below) determines whether we only
retrieve the target <fo:inline font-family="monospace">Employee</fo:inline> and his manager (depth 1),
or whether we also retrieve the manager's manager (depth 2), or the manager's
manager's manager (depth 3), etc. Use -1 for unlimited depth.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_fetch_customgroups"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.18. 
Custom Fetch Group Metadata
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Creates a <fo:inline font-style="italic">detail</fo:inline> fetch group consisting of the
<fo:inline font-family="monospace">publisher</fo:inline> and <fo:inline font-family="monospace">articles</fo:inline> relations.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e22283">
import org.apache.openjpa.persistence.*;
@Entity
@FetchGroups({
@FetchGroup(name="detail", attributes={
@FetchAttribute(name="publisher"),
@FetchAttribute(name="articles")
}),
...
})
public class Magazine {
...
}
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A field can be a member of any number of fetch groups. A field can also
declare a <fo:inline font-style="italic">load fetch group</fo:inline>.
When you access a lazy-loaded field for the first time, OpenJPA makes a
datastore trip to fetch that field's data. Sometimes, however, you know
that whenever you access a lazy field A, you're likely to access lazy fields B
and C as well. Therefore, it would be more efficient to fetch the data for A,
B, and C in the same datastore trip. By setting A's load fetch group to the
name of a <fo:basic-link internal-destination="ref_guide_fetch"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">fetch group</fo:inline></fo:basic-link> containing B and
C, you can tell OpenJPA to load all of these fields together when A is first
accessed.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Use OpenJPA's
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/LoadFetchGroup.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.LoadFetchGroup</fo:inline></fo:basic-link>
annotation to specify the load fetch group of any persistent field. The value of
the annotation is the name of a declared fetch group whose members should be
loaded along with the annotated field.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_fetch_loadgroup"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.19. 
Load Fetch Group Metadata
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e22303">
import org.apache.openjpa.persistence.*;
@Entity
@FetchGroups({
@FetchGroup(name="detail", attributes={
@FetchAttribute(name="publisher"),
@FetchAttribute(name="articles")
}),
...
})
public class Magazine {
@ManyToOne(fetch=FetchType.LAZY)
@LoadFetchGroup("detail")
private Publisher publisher;
...
}
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_fetch_conf"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Custom Fetch Group Configuration
</fo:marker><fo:block font-size="17.28pt">5.6.2. 
Custom Fetch Group Configuration
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e22308"><!--
fetch groups
,
custom configuration
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e22315"><!--
fetch groups
,
FetchGroups
--></fo:wrapper>
You can control the default set of fetch groups with the
<fo:basic-link internal-destination="openjpa.FetchGroups"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">openjpa.FetchGroups</fo:inline>
</fo:inline></fo:basic-link> configuration property. Set this property to a comma-separated list of
fetch group names.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can also set the system's default maximum fetch depth with the
<fo:basic-link internal-destination="openjpa.MaxFetchDepth"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">openjpa.MaxFetchDepth</fo:inline>
</fo:inline></fo:basic-link> configuration property. The maximum fetch depth determines how "deep"
into the object graph to traverse when loading an instance. For example, with
a <fo:inline font-family="monospace">MaxFetchDepth</fo:inline> of 1, OpenJPA will load at most the target
instance and its immediate relations. With a <fo:inline font-family="monospace">MaxFetchDepth</fo:inline>
of 2, OpenJPA may load the target instance, its immediate relations, and
the relations of those relations. This works to arbitrary depth. In fact,
the default <fo:inline font-family="monospace">MaxFetchDepth</fo:inline> value is -1, which symbolizes
infinite depth. Under this setting, OpenJPA will fetch configured relations
until it reaches the edges of the object graph. Of course, which relation
fields are loaded depends on whether the fields are eager or lazy, and on the
active fetch groups. A fetch group member's recursion depth may also limit
the fetch depth to something less than the configured maximum.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA's <fo:inline font-family="monospace">OpenJPAEntityManager</fo:inline> and <fo:inline font-family="monospace">
OpenJPAQuery</fo:inline> extensions to the standard <fo:inline font-family="monospace">EntityManager
</fo:inline> and <fo:inline font-family="monospace">Query</fo:inline> interfaces provide access to a
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/FetchPlan.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.FetchPlan</fo:inline></fo:basic-link> object.
The <fo:inline font-family="monospace">FetchPlan</fo:inline> maintains the set of active fetch groups
and the maximum fetch depth. It begins with the groups and depth defined in the
<fo:inline font-family="monospace">openjpa.FetchGroups</fo:inline> and <fo:inline font-family="monospace">openjpa.MaxFetchDepth
</fo:inline> properties, but allows you to add or remove groups and change the
maximum fetch depth for an individual <fo:inline font-family="monospace">EntityManager</fo:inline> or
<fo:inline font-family="monospace">Query</fo:inline> through the methods below.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e22376">
public FetchPlan addFetchGroup(String group);
public FetchPlan addFetchGroups(String... groups);
public FetchPlan addFetchGroups(Collection groups);
public FetchPlan removeFetchGrop(String group);
public FetchPlan removeFetchGroups(String... groups);
public FetchPlan removeFetchGroups(Collection groups);
public FetchPlan resetFetchGroups();
public Collection&lt;String&gt; getFetchGroups();
public void clearFetchGroups();
public FetchPlan setMaxFetchDepth(int depth);
public int getMaxFetchDepth();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:basic-link internal-destination="ref_guide_runtime"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 9, <fo:inline font-style="italic">
Runtime Extensions
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_runtime"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_runtime"/>]</fo:inline></fo:basic-link> details the <fo:inline font-family="monospace">
OpenJPAEntityManager</fo:inline>, <fo:inline font-family="monospace">OpenJPAQuery</fo:inline>, and
<fo:inline font-family="monospace">FetchPlan</fo:inline> interfaces.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_fetch_conf_query"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.20. 
Using the FetchPlan
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e22394">
import org.apache.openjpa.persistence.*;
...
OpenJPAQuery kq = OpenJPAPersistence.cast(em.createQuery(...));
kq.getFetchPlan().setMaxFetchDepth(3).addFetchGroup("detail");
List results = kq.getResultList();
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_fetch_single_field"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Per-field Fetch Configuration
</fo:marker><fo:block font-size="17.28pt">5.6.3. 
Per-field Fetch Configuration
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e22399"><!--
fetch groups
,
single fields
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In addition to controlling fetch configuration on a per-fetch-group basis, you
can configure OpenJPA to include particular fields in the current fetch
plan. This allows you to add individual fields that are not in the
default fetch group or in any other active fetch groups to the set of
fields that will be eagerly loaded from the database.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA <fo:inline font-family="monospace">FetchPlan</fo:inline> methods:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e22411">
public FetchPlan addField(String field);
public FetchPlan addFields(String... fields);
public FetchPlan addFields(Class cls, String... fields);
public FetchPlan addFields(Collection fields);
public FetchPlan addFields(Class cls, Collection fields);
public FetchPlan removeField(String field);
public FetchPlan removeFields(String... fields);
public FetchPlan removeFields(Class cls, String... fields);
public FetchPlan removeFields(Collection fields);
public FetchPlan removeFields(Class cls, Collection fields);
public Collection&lt;String&gt; getFields();
public void clearFields();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The methods that take only string arguments use the fully-qualified field name,
such as <fo:inline font-family="monospace">org.mag.Magazine.publisher</fo:inline>. Similarly, <fo:inline font-family="monospace">
getFields</fo:inline> returns the set of fully-qualified field names. In all
methods, the named field must be defined in the class specified in the
invocation, not a superclass. So, if the field <fo:inline font-family="monospace">publisher</fo:inline> is
defined in base class <fo:inline font-family="monospace">Publication</fo:inline> rather than subclass
<fo:inline font-family="monospace">Magazine</fo:inline>, you must invoke <fo:inline font-family="monospace">addField
(Publication.class, "publisher")</fo:inline> and not <fo:inline font-family="monospace">addField
(Magazine.class, "publisher")</fo:inline>. This is stricter than Java's default
field-masking algorithms, which would allow the latter method behavior if
<fo:inline font-family="monospace">Magazine</fo:inline> did not also define a field called <fo:inline font-family="monospace">
publisher</fo:inline>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In order to avoid the cost of reflection, OpenJPA does not perform any
validation of the field name / class name pairs that you put into the fetch
configuration. If you specify non-existent class / field pairs, nothing adverse
will happen, but you will receive no notification of the fact that the specified
configuration is not being used.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_fetch-conf_per_field"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.21. 
Adding an Eager Field
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e22447">
import org.apache.openjpa.persistence.*;
...
OpenJPAEntityManager kem = OpenJPAPersistence.cast(em);
kem.getFetchPlan().addField(Magazine.class, "publisher");
Magazine mag = em.find(Magazine.class, magId);
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_fetch_impl"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Implementation Notes
</fo:marker><fo:block font-size="17.28pt">5.6.4. 
Implementation Notes
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e22452"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22453"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Even when a direct relation is not eagerly fetched, OpenJPA selects the foreign
key columns and caches the values. This way when you do traverse the relation,
OpenJPA can often find the related object in its cache, or at least avoid joins
when loading the related object from the database.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22456"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The above implicit foreign key-selecting behavior does not always apply when the
relation is in a subclass table. If the subclass table would not otherwise be
joined into the select, OpenJPA avoids the extra join just to select the foreign
key values.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="ref_guide_perfpack_eager"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Eager Fetching
</fo:marker><fo:block font-size="20.735999999999997pt">5.7. 
Eager Fetching
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e22462"><!--
eager fetching
--></fo:wrapper><fo:wrapper id="d0e22465"><!--
persistent fields
--></fo:wrapper><fo:wrapper id="d0e22470"><!--
fetch groups
,
eager fetching
--></fo:wrapper><fo:wrapper id="d0e22477"><!--
lazy loading
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Eager fetching is the ability to efficiently load subclass data and related
objects along with the base instances being queried. Typically, OpenJPA has to
make a trip to the database whenever a relation is loaded, or when you first
access data that is mapped to a table other than the least-derived superclass
table. If you perform a query that returns 100 <fo:inline font-family="monospace">Person</fo:inline>
objects, and then you have to retrieve the <fo:inline font-family="monospace">Address</fo:inline> for
each person, OpenJPA may make as many as 101 queries (the initial query, plus
one for the address of each person returned). Or if some of the <fo:inline font-family="monospace">
Person</fo:inline> instances turn out to be <fo:inline font-family="monospace">Employee</fo:inline>s,
where <fo:inline font-family="monospace">Employee</fo:inline> has additional data in its own joined
table, OpenJPA once again might need to make extra database trips to access the
additional employee data. With eager fetching, OpenJPA can reduce these cases to
a single query.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Eager fetching only affects relations in the active fetch groups, and is limited
by the declared maximum fetch depth and field recursion depth (see
<fo:basic-link internal-destination="ref_guide_fetch"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.6, “
Fetch Groups
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_fetch"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_fetch"/>]</fo:inline></fo:basic-link>). In other words, relations that would
not normally be loaded immediately when retrieving an object or accessing a
field are not affected by eager fetching. In our example above, the address of
each person would only be eagerly fetched if the query were configured to
include the address field or its fetch group, or if the address were in the
default fetch group. This allows you to control exactly which fields are eagerly
fetched in different situations. Similarly, queries that exclude subclasses
aren't affected by eager subclass fetching, described below.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Eager fetching has three modes:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e22507"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22508"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">none</fo:inline>: No eager fetching is performed. Related objects are
always loaded in an independent select statement. No joined subclass data is
loaded unless it is in the table(s) for the base type being queried. Unjoined
subclass data is loaded using separate select statements rather than a SQL UNION
operation.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22514"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e22517"><!--
eager fetching
,
join mode
--></fo:wrapper>
<fo:inline font-family="monospace">join</fo:inline>: In this mode, OpenJPA joins to to-one relations in the
configured fetch groups. If OpenJPA is loading data for a single instance, then
OpenJPA will also join to any collection field in the configured fetch groups.
When loading data for multiple instances, though, (such as when executing a
<fo:inline font-family="monospace">Query</fo:inline>) OpenJPA will not join to collections by default.
Instead, OpenJPA defaults to <fo:inline font-family="monospace">parallel</fo:inline> mode for collections,
as described below. You can force OpenJPA use a join rather than parallel mode
for a collection field using the metadata extension described in
<fo:basic-link internal-destination="eager-fetch-mode"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.9.2.1, “
Eager Fetch Mode
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="eager-fetch-mode"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="eager-fetch-mode"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e22536"><!--
outer joins
--></fo:wrapper>
Under <fo:inline font-family="monospace">join</fo:inline> mode, OpenJPA uses a left outer join (or inner
join, if the relations' field metadata declares the relation non-nullable) to
select the related data along with the data for the target objects. This process
works recursively for to-one joins, so that if <fo:inline font-family="monospace">Person</fo:inline> has
an <fo:inline font-family="monospace">Address</fo:inline>, and <fo:inline font-family="monospace">Address</fo:inline> has a
<fo:inline font-family="monospace">TelephoneNumber</fo:inline>, and the fetch groups are configured
correctly, OpenJPA might issue a single select that joins across the tables for
all three classes. To-many joins can not recursively spawn other to-many joins,
but they can spawn recursive to-one joins.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Under the <fo:inline font-family="monospace">join</fo:inline> subclass fetch mode, subclass data in joined
tables is selected by outer joining to all possible subclass tables of the type
being queried. As you'll see below, subclass data fetching is configured
separately from relation fetching, and can be disabled for specific classes.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e22560"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Some databases may not support outer joins. Also, OpenJPA can not use
outer joins if you have set the <fo:basic-link internal-destination="openjpa.jdbc.DBDictionary"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">
<fo:inline font-family="monospace"> DBDictionary</fo:inline></fo:inline></fo:basic-link>'s <fo:inline font-family="monospace">JoinSyntax</fo:inline> to
<fo:inline font-family="monospace">traditional</fo:inline>. See <fo:basic-link internal-destination="ref_guide_dbsetup_sql92"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.6, “
Setting the SQL Join Syntax
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_sql92"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_sql92"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22576"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e22579"><!--
eager fetching
,
parallel mode
--></fo:wrapper>
<fo:inline font-family="monospace">parallel</fo:inline>: Under this mode, OpenJPA selects to-one relations
and joined collections as outlined in the <fo:inline font-family="monospace">join</fo:inline> mode
description above. Unjoined collection fields, however, are eagerly fetched
using a separate select statement for each collection, executed in parallel with
the select statement for the target objects. The parallel selects use the
<fo:inline font-family="monospace">WHERE</fo:inline> conditions from the primary select, but add their own
joins to reach the related data. Thus, if you perform a query that returns 100
<fo:inline font-family="monospace">Company</fo:inline> objects, where each company has a list of
<fo:inline font-family="monospace">Employee</fo:inline> objects and <fo:inline font-family="monospace">Department</fo:inline>
objects, OpenJPA will make 3 queries. The first will select the company objects,
the second will select the employees for those companies, and the third will
select the departments for the same companies. Just as for joins, this process
can be recursively applied to the objects in the relations being eagerly
fetched. Continuing our example, if the <fo:inline font-family="monospace">Employee</fo:inline> class
had a list of <fo:inline font-family="monospace">Projects</fo:inline> in one of the fetch groups being
loaded, OpenJPA would execute a single additional select in parallel to load the
projects of all employees of the matching companies.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Using an additional select to load each collection avoids transferring more data
than necessary from the database to the application. If eager joins were used
instead of parallel select statements, each collection added to the configured
fetch groups would cause the amount of data being transferred to rise
dangerously, to the point that you could easily overwhelm the network.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Polymorphic to-one relations to table-per-class mappings use parallel eager
fetching because proper joins are impossible. You can force other to-one
relations to use parallel rather than join mode eager fetching using the
metadata extension described in <fo:basic-link internal-destination="eager-fetch-mode"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.9.2.1, “
Eager Fetch Mode
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="eager-fetch-mode"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="eager-fetch-mode"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Parallel subclass fetch mode only applies to queries on joined inheritance
hierarchies. Rather than outer-joining to
subclass tables, OpenJPA will issue the query separately for each subclass. In
all other situations, parallel subclass fetch mode acts just like join mode in
regards to vertically-mapped subclasses.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When OpenJPA knows that it is selecting for a single object only, it never uses
<fo:inline font-family="monospace">parallel</fo:inline> mode, because the additional selects can be made
lazily just as efficiently. This mode only increases efficiency over <fo:inline font-family="monospace">
join</fo:inline> mode when multiple objects with eager relations are being loaded,
or when multiple selects might be faster than joining to all possible
subclasses.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block id="ref_guide_perfpack_eager_conf"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Configuring Eager Fetching
</fo:marker><fo:block font-size="17.28pt">5.7.1. 
Configuring Eager Fetching
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e22628"><!--
eager fetching
,
configuration
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e22635"><!--
EagerFetchMode
--></fo:wrapper>
<fo:wrapper id="d0e22639"><!--
SubclassFetchMode
--></fo:wrapper>
<fo:wrapper id="d0e22643"><!--
eager fetching
,
EagerFetchMode
--></fo:wrapper>
<fo:wrapper id="d0e22649"><!--
eager fetching
,
SubclassFetchMode
--></fo:wrapper>
You can control OpenJPA's default eager fetch mode through the
<fo:basic-link internal-destination="openjpa.jdbc.EagerFetchMode"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.jdbc.EagerFetchMode</fo:inline></fo:inline></fo:basic-link> and
<fo:basic-link internal-destination="openjpa.jdbc.SubclassFetchMode"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.jdbc.SubclassFetchMode</fo:inline></fo:inline></fo:basic-link> configuration properties. Set
each of these properties to one of the mode names described in the previous
section: <fo:inline font-family="monospace">none, join, parallel</fo:inline>. If left unset, the eager
fetch mode defaults to <fo:inline font-family="monospace">parallel</fo:inline> and the subclass fetch mode
defaults to <fo:inline font-family="monospace">join</fo:inline> These are generally the most robust and
performant strategies.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can easily override the default fetch modes at runtime for any lookup or
query through OpenJPA's fetch configuration APIs. See
<fo:basic-link internal-destination="ref_guide_runtime"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 9, <fo:inline font-style="italic">
Runtime Extensions
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_runtime"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_runtime"/>]</fo:inline></fo:basic-link> for details.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_perfpack_eager_def"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.22. 
Setting the Default Eager Fetch Mode
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e22679">
&lt;property name="openjpa.jdbc.EagerFetchMode" value="parallel"/&gt;
&lt;property name="openjpa.jdbc.SubclassFetchMode" value="join"/&gt;
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_perfpack_eager_runtime"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 5.23. 
Setting the Eager Fetch Mode at Runtime
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e22684">
import org.apache.openjpa.persistence.*;
import org.apache.openjpa.persistence.jdbc.*;
...
Query q = em.createQuery("select p from Person p where p.address.state = 'TX'");
OpenJPAQuery kq = OpenJPAPersistence.cast(q);
JDBCFetchPlan fetch = (JDBCFetchPlan) kq.getFetchPlan();
fetch.setEagerFetchMode(JDBCFetchPlan.EAGER_PARALLEL);
fetch.setSubclassFetchMode(JDBCFetchPlan.EAGER_JOIN);
List results = q.getResultList();
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can specify a default subclass fetch mode for an individual class with the
metadata extension described in <fo:basic-link internal-destination="subclass-fetch-mode"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.9.1.1, “
Subclass Fetch Mode
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="subclass-fetch-mode"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="subclass-fetch-mode"/>]</fo:inline></fo:basic-link>.
Note, however, that you cannot "upgrade" the runtime fetch mode with your class
setting. If the runtime fetch mode is <fo:inline font-family="monospace">none</fo:inline>, no eager
subclass data fetching will take place, regardless of your metadata setting.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This applies to the eager fetch mode metadata extension as well (see
<fo:basic-link internal-destination="eager-fetch-mode"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.9.2.1, “
Eager Fetch Mode
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="eager-fetch-mode"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="eager-fetch-mode"/>]</fo:inline></fo:basic-link>). You can use this extension to
disable eager fetching on a field or to declare that a collection would rather
use joins than parallel selects or vice versa. But an extension value of
<fo:inline font-family="monospace">join</fo:inline> won't cause any eager joining if the fetch
configuration's setting is <fo:inline font-family="monospace">none</fo:inline>.
</fo:block></fo:block><fo:block id="ref_guide_perfpack_eager_consider"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Eager Fetching Considerations and Limitations
</fo:marker><fo:block font-size="17.28pt">5.7.2. 
Eager Fetching Considerations and Limitations
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
There are several important points that you should consider when using eager
fetching:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e22708"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22709"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e22712"><!--
eager fetching
,
with large result sets
--></fo:wrapper>
<fo:wrapper id="d0e22718"><!--
large result sets
,
interaction with eager fetching
--></fo:wrapper>
When you are using <fo:inline font-family="monospace">parallel</fo:inline> eager fetch mode and you have
large result sets enabled (see <fo:basic-link internal-destination="ref_guide_dbsetup_lrs"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.9, “
Large Result Sets
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_lrs"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_lrs"/>]</fo:inline></fo:basic-link>)
or you place a range on a query, OpenJPA performs the needed parallel selects on
one page of results at a time. For example, suppose your <fo:inline font-family="monospace">
FetchBatchSize</fo:inline> is set to 20, and you perform a large result set query
on a class that has collection fields in the configured fetch groups. OpenJPA
will immediately cache the first <fo:inline font-family="monospace">20</fo:inline> results of the query
using <fo:inline font-family="monospace">join</fo:inline> mode eager fetching only. Then, it will issue the
extra selects needed to eager fetch your collection fields according to
<fo:inline font-family="monospace">parallel</fo:inline> mode. Each select will use a SQL <fo:inline font-family="monospace">IN
</fo:inline> clause (or multiple <fo:inline font-family="monospace">OR</fo:inline> clauses if your class has a
compound primary key) to limit the selected collection elements to those owned
by the 20 cached results.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Once you iterate past the first 20 results, OpenJPA will cache the next 20 and
again issue any needed extra selects for collection fields, and so on. This
pattern ensures that you get the benefits of eager fetching without bringing
more data into memory than anticipated.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22749"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Once OpenJPA eager-joins into a class, it cannot issue any further eager to-many
joins or parallel selects from that class in the same query. To-one joins,
however, can recurse to any level.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22752"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Using a to-many join makes it impossible to determine the number of instances
the result set contains without traversing the entire set. This is because each
result object might be represented by multiple rows. Thus, queries with a range
specification or queries configured for lazy result set traversal automatically
turn off eager to-many joining.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22755"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
OpenJPA cannot eagerly join to polymorphic relations to non-leaf classes in a
table-per-class inheritance hierarchy. You can work around this restriction
using the mapping extensions described in <fo:basic-link internal-destination="nonpolymorphic"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.9.2.2, “
Nonpolymorphic
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="nonpolymorphic"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="nonpolymorphic"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Metadata
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Metadata
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="ref_guide_meta"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 6. 
Metadata
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The JPA Overview covers JPA metadata in <fo:basic-link internal-destination="jpa_overview_meta"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 5, <fo:inline font-style="italic">
Metadata
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta"/>]</fo:inline></fo:basic-link>.
This chapter discusses OpenJPA's extensions to standard JPA metadata.
</fo:block><fo:block id="ref_guide_meta_factory"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Metadata Factory
</fo:marker><fo:block font-size="20.735999999999997pt">6.1. 
Metadata Factory
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e22771"><!--
metadata
,
loading and storing
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:basic-link internal-destination="openjpa.MetaDataFactory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">openjpa.MetaDataFactory
</fo:inline></fo:inline></fo:basic-link> configuration property controls metadata loading and storing.
This property takes a plugin string (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) describing a concrete
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/meta/MetaDataFactory.html">
<fo:inline font-family="monospace">org.apache.openjpa.meta.MetaDataFactory</fo:inline></fo:basic-link>
implementation. A metadata factory can load mapping information as well as
persistence metadata, or it can leave mapping information to a separate
<fo:inline font-style="italic">mapping factory</fo:inline> (see
<fo:basic-link internal-destination="ref_guide_mapping_factory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.5, “
Mapping Factory
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_factory"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_factory"/>]</fo:inline></fo:basic-link>). OpenJPA recognizes the
following built-in metadata factories:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e22796"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22797"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">jpa</fo:inline>: Standard JPA metadata. This is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/PersistenceMetaDataFactory.html">
<fo:inline font-family="monospace">
org.apache.openjpa.persistence.PersistenceMetaDataFactory</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA has built-in settings for listing your persistent classes, which
the <fo:basic-link internal-destination="jpa_overview_persistence_xml"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">JPA Overview</fo:inline></fo:basic-link> describes.
OpenJPA supports these JPA standard settings by translating them into its own
internal metadata factory properties. Each internal property represents a
different mechanism for locating persistent types; you can choose the mechanism
or combination of mechanisms that are most convenient. See
<fo:basic-link internal-destination="ref_guide_pc_pcclasses"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.1, “
Persistent Class List
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_pcclasses"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_pcclasses"/>]</fo:inline></fo:basic-link> for a discussion of when it is
necessary to list your persistent classes.
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e22815"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22816"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Types</fo:inline>: A semicolon-separated list of fully-qualified
persistent class names.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22822"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Resources</fo:inline>: A semicolon-separated list of resource paths to
metadata files or jar archives. Each jar archive will be scanned for
annotated JPA entities.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22828"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">URLs</fo:inline>: A semicolon-separated list of URLs of metadata files
or jar archives. Each jar archive will be scanned for annotated JPA
entities.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22834"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">ClasspathScan</fo:inline>: A semicolon-separated list of directories or
jar archives listed in your classpath. Each directory and jar archive will be
scanned for annotated JPA entities.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_meta_stdfactoryex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 6.1. 
Setting a Standard Metadata Factory
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e22843">
&lt;property name="openjpa.MetaDataFactory" value="jpa(ClasspathScan=build;lib.jar)"/&gt;
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_meta_customfactoryex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 6.2. 
Setting a Custom Metadata Factory
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e22848">
&lt;property name="openjpa.MetaDataFactory" value="com.xyz.CustomMetaDataFactory"/&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_meta_jpa"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Additional JPA Metadata
</fo:marker><fo:block font-size="20.735999999999997pt">6.2. 
Additional JPA Metadata
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e22853"><!--
metadata
,
JPA additions
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This section describes OpenJPA's core additions to standard entity metadata. We
present the object-relational mapping syntax to support these additions in
<fo:basic-link internal-destination="ref_guide_mapping_jpa"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.7, “
Additional JPA Mappings
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_jpa"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_jpa"/>]</fo:inline></fo:basic-link>. Finally,
<fo:basic-link internal-destination="ref_guide_meta_ext"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 6.3, “
Metadata Extensions
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_meta_ext"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_meta_ext"/>]</fo:inline></fo:basic-link> covers additional extensions to JPA
metadata that allow you to access auxiliary OpenJPA features.
</fo:block><fo:block id="ref_guide_meta_jpa_datastoreid"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Datastore Identity
</fo:marker><fo:block font-size="17.28pt">6.2.1. 
Datastore Identity
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e22867"><!--
identity
,
datastore
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA typically requires you to declare one or more <fo:inline font-family="monospace">Id</fo:inline> fields
to act as primary keys. OpenJPA, however, can create and maintain a surrogate
primary key value when you do not declare any <fo:inline font-family="monospace">Id</fo:inline> fields. This
form of persistent identity is called <fo:inline font-style="italic">datastore identity</fo:inline>.
<fo:basic-link internal-destination="ref_guide_pc_oid"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.3, “
Object Identity
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_oid"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_oid"/>]</fo:inline></fo:basic-link> discusses OpenJPA's support for
datastore identity in JPA. We cover how to map your datastore identity primary
key column in <fo:basic-link internal-destination="ref_guide_mapping_jpa_datastoreid"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.7.1, “
Datastore Identity Mapping
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_jpa_datastoreid"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_jpa_datastoreid"/>]</fo:inline></fo:basic-link>
</fo:block></fo:block><fo:block id="ref_guide_meta_jpa_version"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Surrogate Version
</fo:marker><fo:block font-size="17.28pt">6.2.2. 
Surrogate Version
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e22890"><!--
version
,
surrogate
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Just as OpenJPA can maintain your entity's identity without any <fo:inline font-family="monospace">Id
</fo:inline> fields, OpenJPA can maintain your entity's optimistic version without
any <fo:inline font-family="monospace">Version</fo:inline> fields.
<fo:basic-link internal-destination="ref_guide_mapping_jpa_version"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.7.2, “
Surrogate Version Mapping
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_jpa_version"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_jpa_version"/>]</fo:inline></fo:basic-link> shows you how to map
surrogate version columns.
</fo:block></fo:block><fo:block id="ref_guide_meta_jpa_persistent"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Persistent Field Values
</fo:marker><fo:block font-size="17.28pt">6.2.3. 
Persistent Field Values
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e22908"><!--
persistent fields
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA defines <fo:inline font-family="monospace">Basic</fo:inline>, <fo:inline font-family="monospace">Lob</fo:inline>, <fo:inline font-family="monospace">Embedded
</fo:inline>, <fo:inline font-family="monospace">ManyToOne</fo:inline>, and <fo:inline font-family="monospace">OneToOne</fo:inline>
persistence strategies for direct field values. OpenJPA supports all of these
standard strategies, but adds one of its own: <fo:inline font-family="monospace">Persistent</fo:inline>.
The <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/Persistent.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.Persistent</fo:inline></fo:basic-link>
metadata annotation can represent any direct field value, including custom
types. It has the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e22936"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22937"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">FetchType fetch</fo:inline>: Whether to load the field eagerly or
lazily. Corresponds exactly to the same-named property of standard JPA
annotations such as <fo:basic-link internal-destination="jpa_overview_meta_basic"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace"> Basic
</fo:inline></fo:inline></fo:basic-link>. Defaults to <fo:inline font-family="monospace">FetchType.EAGER</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22950"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">CascadeType[] cascade</fo:inline>: Array of enum values defining cascade
behavior for this field. Corresponds exactly to the same-named property of
standard JPA annotations such as <fo:basic-link internal-destination="jpa_overview_meta_manytoone"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">
<fo:inline font-family="monospace"> ManyToOne</fo:inline></fo:inline></fo:basic-link>. Defaults to empty array.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22961"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String mappedBy</fo:inline>: Names the field in the related entity that
maps this bidirectional relation. Corresponds to the same-named property of
standard JPA annotations such as <fo:basic-link internal-destination="jpa_overview_meta_onetoone"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">
<fo:inline font-family="monospace"> OneToOne</fo:inline></fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22972"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean optional</fo:inline>: Whether the value can be null. Corresponds
to the same-named property of standard JPA annotations such as
<fo:basic-link internal-destination="jpa_overview_meta_manytoone"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace"> ManyToOne</fo:inline>
</fo:inline></fo:basic-link>, but can apply to non-entity object values as well. Defaults to
<fo:inline font-family="monospace">true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e22986"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean embedded</fo:inline>: Set this property to <fo:inline font-family="monospace">true
</fo:inline> if the field value is stored as an embedded object.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Though you can use the <fo:inline font-family="monospace">Persistent</fo:inline> annotation in place of
most of the standard direct field annotations mentioned above, we recommend
primarily using it for non-standard and custom types for which no standard JPA
annotation exists. For example, <fo:basic-link internal-destination="ref_guide_mapping_jpa_columns"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.7.3, “
Multi-Column Mappings
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_jpa_columns"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_jpa_columns"/>]</fo:inline></fo:basic-link>
demonstrates the use of the <fo:inline font-family="monospace">Persistent</fo:inline> annotation
to denote a persistent <fo:inline font-family="monospace">java.awt.Point</fo:inline> field.
</fo:block></fo:block><fo:block id="ref_guide_meta_jpa_persistent_coll"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">Persistent Collection Fields</fo:marker><fo:block font-size="17.28pt">6.2.4. Persistent Collection Fields</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23011"><!--persistent fields, collection metadata--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA standardizes support for collections of entities with the <fo:inline font-family="monospace">
OneToMany</fo:inline> and <fo:inline font-family="monospace">ManyToMany</fo:inline> persistence strategies.
OpenJPA supports these strategies, and may be extended for other strategies as
well. For extended strategies, use the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/PersistentCollection.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.PersistentCollection</fo:inline></fo:basic-link> metadata
annotation to represents any persistent collection field. It has the following
properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e23029"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23030"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Class elementType</fo:inline>: The class of the collection elements.
This information is usually taken from the parameterized collection element
type. You must supply it explicitly, however, if your field isn't a
parameterized type.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23036"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">FetchType fetch</fo:inline>: Whether to load the collection eagerly or
lazily. Corresponds exactly to the same-named property of standard JPA
annotations such as <fo:basic-link internal-destination="jpa_overview_meta_basic"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
Basic</fo:inline></fo:inline></fo:basic-link>. Defaults to <fo:inline font-family="monospace">FetchType.LAZY</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23049"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String mappedBy</fo:inline>: Names the field in the related entity that
maps this bidirectional relation. Corresponds to the same-named property of
standard JPA annotations such as <fo:basic-link internal-destination="jpa_overview_meta_manytomany"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">
<fo:inline font-family="monospace">ManyToMany</fo:inline></fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23060"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">CascadeType[] elementCascade</fo:inline>: Array of enum values defining
cascade behavior for the collection elements. Corresponds exactly to the
<fo:inline font-family="monospace">cascade</fo:inline> property of standard JPA annotations such as
<fo:basic-link internal-destination="jpa_overview_meta_manytomany"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
ManyToMany</fo:inline></fo:inline></fo:basic-link>. Defaults to empty array.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23073"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean elementEmbedded</fo:inline>: Set this property to <fo:inline font-family="monospace">true
</fo:inline> if the elements are stored as embedded objects.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="ref_guide_meta_jpa_persistent_map"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">Persistent Map Fields</fo:marker><fo:block font-size="17.28pt">6.2.5. Persistent Map Fields</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23085"><!--persistent fields, map metadata--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA has limited support for maps. If you extend JPA's standard map support to
encompass new mappings, use the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/PersistentMap.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.PersistentMap</fo:inline></fo:basic-link> metadata
annotation to represent your custom persistent map fields. It has the
following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e23097"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23098"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Class keyType</fo:inline>: The class of the map keys. This information
is usually taken from the parameterized map key type. You must supply it
explicitly, however, if your field isn't a parameterized type.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23104"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Class elementType</fo:inline>: The class of the map values. This
information is usually taken from the parameterized map value type. You must
supply it explicitly, however, if your field isn't a parameterized type.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23110"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">FetchType fetch</fo:inline>: Whether to load the collection eagerly or
lazily. Corresponds exactly to the same-named property of standard JPA
annotations such as <fo:basic-link internal-destination="jpa_overview_meta_basic"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
Basic</fo:inline></fo:inline></fo:basic-link>. Defaults to <fo:inline font-family="monospace">FetchType.LAZY</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23123"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">CascadeType[] keyCascade</fo:inline>: Array of enum values defining
cascade behavior for the map keys. Corresponds exactly to the <fo:inline font-family="monospace">cascade
</fo:inline> property of standard JPA annotations such as
<fo:basic-link internal-destination="jpa_overview_meta_manytoone"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
ManyToOne</fo:inline></fo:inline></fo:basic-link>. Defaults to empty array.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23136"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">CascadeType[] elementCascade</fo:inline>: Array of enum values defining
cascade behavior for the map values. Corresponds exactly to the
<fo:inline font-family="monospace">cascade</fo:inline> property of standard JPA annotations such as
<fo:basic-link internal-destination="jpa_overview_meta_manytoone"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
ManyToOne</fo:inline></fo:inline></fo:basic-link>. Defaults to empty array.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23149"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean keyEmbedded</fo:inline>: Set this property to <fo:inline font-family="monospace">true
</fo:inline> if the map keys are stored as embedded objects.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23158"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean elementEmbedded</fo:inline>: Set this property to <fo:inline font-family="monospace">
true</fo:inline> if the map values are stored as embedded objects.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="ref_guide_meta_ext"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Metadata Extensions
</fo:marker><fo:block font-size="20.735999999999997pt">6.3. 
Metadata Extensions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23170"><!--
metadata
,
extensions
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA extends standard metadata to allow you to access advanced OpenJPA
functionality. This section covers persistence metadata extensions; we discuss
mapping metadata extensions in <fo:basic-link internal-destination="ref_guide_mapping_ext"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.9, “
Mapping Extensions
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_ext"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_ext"/>]</fo:inline></fo:basic-link>.
All metadata extensions are optional; OpenJPA will rely on its defaults when no
explicit data is provided.
</fo:block><fo:block id="ref_guide_meta_class"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Class Extensions
</fo:marker><fo:block font-size="17.28pt">6.3.1. 
Class Extensions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA recognizes the following class extensions:
</fo:block><fo:block id="fetch-groups"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">6.3.1.1. 
Fetch Groups
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23187"><!--
metadata
,
extensions
,
fetch groups
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/FetchGroups.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.FetchGroups</fo:inline></fo:basic-link> and
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/FetchGroup.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.FetchGroup</fo:inline></fo:basic-link>
annotations allow you to define fetch groups in your JPA entities.
<fo:basic-link internal-destination="ref_guide_fetch"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.6, “
Fetch Groups
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_fetch"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_fetch"/>]</fo:inline></fo:basic-link> discusses OpenJPA's support for fetch
groups in general; see <fo:basic-link internal-destination="ref_guide_fetch_custom"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.6.1, “
Custom Fetch Groups
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_fetch_custom"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_fetch_custom"/>]</fo:inline></fo:basic-link> for how to
use these annotations in particular.
</fo:block></fo:block><fo:block id="data-cache"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">6.3.1.2. 
Data Cache
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23215"><!--
metadata
,
extensions
,
data cache
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:basic-link internal-destination="ref_guide_cache"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.1, “
Data Cache
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_cache"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_cache"/>]</fo:inline></fo:basic-link> examines caching in OpenJPA. Metadata
extensions allow individual classes to override system caching defaults.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA defines the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/DataCache.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.DataCache</fo:inline></fo:basic-link>
annotation for caching information. This annotation has the following
properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e23235"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23236"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean enabled</fo:inline>: Whether to cache data for instances of the
class. Defaults to <fo:inline font-family="monospace">true</fo:inline> for base classes, or the superclass
value for subclasses. If you set this property to <fo:inline font-family="monospace">false</fo:inline>, all
other properties are ignored.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23248"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">int timeout</fo:inline>: The number of milliseconds data for the class
remains valid. Use -1 for no timeout. Defaults to the
<fo:basic-link internal-destination="openjpa.DataCacheTimeout"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace"> openjpa.DataCacheTimeout
</fo:inline></fo:inline></fo:basic-link> property value.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="detached-state-field"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">6.3.1.3. 
Detached State
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23261"><!--
metadata
,
extensions
,
detached state field
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The OpenJPA <fo:basic-link internal-destination="ref_guide_pc_enhance"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">enhancer</fo:inline></fo:basic-link> may add a
synthetic field to detachable classes to hold detached state (see
<fo:basic-link internal-destination="ref_guide_detach_graph"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 11.1.3, “
Defining the Detached Object Graph
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_detach_graph"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_detach_graph"/>]</fo:inline></fo:basic-link> for details). You can instead
declare your own detached state field or supress the creation of a detached
state field altogether. In the latter case, your class must not use
<fo:basic-link internal-destination="ref_guide_pc_oid"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">datastore identity</fo:inline></fo:basic-link>, and should declare
a version field to detect optimistic concurrency errors during detached
modifications.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA defines the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/DetachedState.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.DetachedState</fo:inline></fo:basic-link>
annotation for controlling detached state. When used to annotate a class,
<fo:inline font-family="monospace">DetachedState</fo:inline> recognizes the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e23290"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23291"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean enabled</fo:inline>: Set to false to suppress the use of
detached state.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23297"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String fieldName</fo:inline>: Use this property to declare your own
detached state field. The field must be of type <fo:inline font-family="monospace">Object</fo:inline>.
Typically this property is only used if the field is inherited from a
non-persisted superclass. If the field is declared in your entity class, you
will typically annotate the field directly, as described below.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If you declare your own detached state field, you can annotate that field with
<fo:inline font-family="monospace">DetachedState</fo:inline> directly, rather than placing the
annotation at the class level and using the <fo:inline font-family="monospace">fieldName</fo:inline>
property. When placed on a field, <fo:inline font-family="monospace">DetachedState</fo:inline> acts as a
marker annotation; it does not recognize any properties. Your annotated field
must be of type <fo:inline font-family="monospace">Object</fo:inline>.
</fo:block></fo:block></fo:block><fo:block id="ref_guide_meta_field"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Field Extensions
</fo:marker><fo:block font-size="17.28pt">6.3.2. 
Field Extensions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA recognizes the following field extensions:
</fo:block><fo:block id="dependent"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">6.3.2.1. 
Dependent
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23328"><!--
metadata
,
extensions
,
dependent
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In a <fo:inline font-style="italic">dependent</fo:inline> relation, the referenced object is deleted
whenever the owning object is deleted, or whenever the relation is severed by
nulling or resetting the owning field. For example, if the <fo:inline font-family="monospace">
Magazine.coverArticle</fo:inline> field is marked dependent, then setting
<fo:inline font-family="monospace">Magazine.coverArticle</fo:inline> to a new <fo:inline font-family="monospace">Article</fo:inline>
instance will automatically delete the old <fo:inline font-family="monospace">Article</fo:inline> stored
in the field. Similarly, deleting a <fo:inline font-family="monospace">Magazine</fo:inline> object will
automatically delete its current cover <fo:inline font-family="monospace">Article</fo:inline>. (This
latter processing is analogous to using JPA's CascadeType.REMOVE functionality
as described in <fo:basic-link internal-destination="jpa_overview_meta_cascade"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2.8.1, “
Cascade Type
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_meta_cascade"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_meta_cascade"/>]</fo:inline></fo:basic-link>.) You can
prevent an orphaned dependent object from being automatically deleted by
assigning it to another relation in the same transaction.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA offers a family of marker annotations to denote dependent relations in
JPA entities:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e23362"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23363"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/Dependent.html">
<fo:inline font-family="monospace"> org.apache.openjpa.persistence.Dependent</fo:inline></fo:basic-link>: Marks
a direct relation as dependent.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23371"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/ElementDependent.html">
<fo:inline font-family="monospace"> org.apache.openjpa.persistence.ElementDependent</fo:inline></fo:basic-link>
: Marks the entity elements of a collection, array, or map field as dependent.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23379"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/KeyDependent.html">
<fo:inline font-family="monospace"> org.apache.openjpa.persistence.KeyDependent</fo:inline></fo:basic-link>:
Marks the key entities in a map field as dependent.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="load-fetch-group"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">6.3.2.2. 
Load Fetch Group
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23390"><!--
metadata
,
extensions
,
load fetch group
--></fo:wrapper><fo:wrapper id="d0e23397"><!--
fetch groups
,
load fetch group
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/LoadFetchGroup.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.LoadFetchGroup</fo:inline></fo:basic-link>
annotation specifies a field's load fetch group.
<fo:basic-link internal-destination="ref_guide_fetch"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.6, “
Fetch Groups
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_fetch"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_fetch"/>]</fo:inline></fo:basic-link> discusses OpenJPA's support for fetch groups
in general; see <fo:basic-link internal-destination="ref_guide_fetch_custom"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.6.1, “
Custom Fetch Groups
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_fetch_custom"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_fetch_custom"/>]</fo:inline></fo:basic-link> for how to use this
annotation in particular.
</fo:block></fo:block><fo:block id="lrs"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">6.3.2.3. 
LRS
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23416"><!--
metadata
,
extensions
,
lrs
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This boolean extension, denoted by the OpenJPA
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/LRS.html"><fo:inline font-family="monospace">
org.apache.openjpa.persistence.LRS</fo:inline></fo:basic-link> annotation,
indicates that a field should use OpenJPA's special large result set collection
or map proxies. A complete description of large result set proxies is available
in <fo:basic-link internal-destination="ref_guide_pc_scos_proxy_lrs"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.5.4.2, “
Large Result Set Proxies
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_scos_proxy_lrs"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_scos_proxy_lrs"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block><fo:block id="inverse-logical"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">6.3.2.4. 
Inverse-Logical
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23436"><!--
metadata
,
extensions
,
inverse-logical
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This extension names the inverse field in a logical bidirectional relation.
To create a logical bidrectional relation in OpenJPA, use the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/InverseLogical.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.InverseLogical</fo:inline></fo:basic-link>
annotation. We discuss logical bidirectional relations and this
extension in detail in <fo:basic-link internal-destination="ref_guide_inverses"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.4, “
Managed Inverses
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_inverses"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_inverses"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block><fo:block id="read-only"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">6.3.2.5. 
Read-Only
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23457"><!--
metadata
,
extensions
,
read-only
--></fo:wrapper><fo:wrapper id="d0e23466"><!--
persistent fields
,
read only
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The read-only extension makes a field unwritable. The extension only applies to
existing persistent objects; new object fields are always writeable.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To mark a field read-only in JPA metadata, set the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/ReadOnly.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.ReadOnly</fo:inline></fo:basic-link>
annotation to an
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/UpdateAction.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.UpdateAction</fo:inline></fo:basic-link> enum
value. The <fo:inline font-family="monospace">UpdateAction</fo:inline> enum includes:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e23488"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23489"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">UpdateAction.IGNORE</fo:inline>: Updates to the field are completely
ignored. The field is not considered dirty. The new value will not even get
stored in the OpenJPA <fo:basic-link internal-destination="ref_guide_cache"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">data cache</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23498"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">UpdateAction.RESTRICT</fo:inline>: Any attempt to change the field will
result in an immediate exception.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="type"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">6.3.2.6. 
Type
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23507"><!--
metadata
,
extensions
,
type
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA has three levels of support for relations:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.2em" id="d0e23518"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23519"><fo:list-item-label end-indent="label-end()"><fo:block>1.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Relations that hold a reference to an object of a concrete persistent class are
supported by storing the primary key values of the related instance in the
database.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23522"><fo:list-item-label end-indent="label-end()"><fo:block>2.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Relations that hold a reference to an object of an unknown persistent class are
supported by storing the stringified identity value of the related instance.
This level of support does not allow queries across the relation.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23525"><fo:list-item-label end-indent="label-end()"><fo:block>3.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Relations that hold an unknown object or interface. The only way to support
these relations is to serialize their value to the database. This does not allow
you to query the field, and is not very efficient.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Clearly, when you declare a field's type to be another persistence-capable
class, OpenJPA uses level 1 support. By default, OpenJPA assumes that any
interface-typed fields you declare will be implemented only by other persistent
classes, and assigns interfaces level 2 support. The exception to this rule is
the <fo:inline font-family="monospace">java.io.Serializable</fo:inline> interface. If you declare a
field to be of type <fo:inline font-family="monospace">Serializable</fo:inline>, OpenJPA lumps it
together with <fo:inline font-family="monospace">java.lang.Object</fo:inline> fields and other
non-interface, unrecognized field types, which are all assigned level 3 support.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
With OpenJPA's type family of metadata extensions, you can control the level of
support given to your unknown/interface-typed fields. Setting the value of this
extension to <fo:inline font-family="monospace">Entity</fo:inline> indicates that the
field value will always be some persistent object, and gives level 2 support.
Setting the value of this extension to the class of a concrete persistent type
is even better; it gives you level 1 support (just as if you had declared your
field to be of that type in the first place). Setting this extension to
<fo:inline font-family="monospace">Object</fo:inline> uses level 3 support. This is useful when you have
an interface relation that may <fo:inline font-weight="bold">not</fo:inline> hold other
persistent objects (recall that OpenJPA assumes interface fields will always
hold persistent instances by default).
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This extension is also used with OpenJPA's externalization feature, described in
<fo:basic-link internal-destination="ref_guide_pc_extern"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.5.5, “
Externalization
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_extern"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_extern"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA defines the following type annotations for field values, collection,
array, and map elements, and map keys, respectively:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e23556"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23557"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/Type.html"><fo:inline font-family="monospace">
org.apache.openjpa.persistence.Type</fo:inline></fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23564"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/ElementType.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.ElementType</fo:inline></fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23572"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/KeyType.html"><fo:inline font-family="monospace">
org.apache.openjpa.persistence.KeyType</fo:inline></fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="externalizer"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">6.3.2.7. 
Externalizer
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23582"><!--
metadata
,
extensions
,
externalizer
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The OpenJPA
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/Externalizer.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.Externalizer</fo:inline></fo:basic-link>
annotation names a method to transform a field value into a value of
another type. See <fo:basic-link internal-destination="ref_guide_pc_extern"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.5.5, “
Externalization
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_extern"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_extern"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="factory"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">6.3.2.8. 
Factory
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23603"><!--
metadata
,
extensions
,
factory
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The OpenJPA
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/Factory.html"><fo:inline font-family="monospace">
org.apache.openjpa.persistence.Factory</fo:inline></fo:basic-link> annotation
names a method to re-create a field value from its externalized form. See
<fo:basic-link internal-destination="ref_guide_pc_extern"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.5.5, “
Externalization
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_extern"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_extern"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block><fo:block id="external-values"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">6.3.2.9. 
External Values
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23623"><!--
metadata
,
extensions
,
external values
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The OpenJPA
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/ExternalValues.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.ExternalValues</fo:inline></fo:basic-link>
annotation declares values for transformation of simple fields to
different constant values in the datastore. See
<fo:basic-link internal-destination="ref_guide_pc_extern_values"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.5.5.1, “
External Values
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_extern_values"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_extern_values"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:block></fo:block><fo:block id="ref_guide_meta_example"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Example
</fo:marker><fo:block font-size="17.28pt">6.3.3. 
Example
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following example shows you how to specify extensions in metadata.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_metaex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 6.3. 
OpenJPA Metadata Extensions
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e23649">
import org.apache.openjpa.persistence.*;
@Entity
@DataCache(enabled=false)
public class Magazine
{
@ManyToMany
@LRS
private Collection&lt;Subscriber&gt; subscribers;
@ExternalValues({"true=1", "false=2"})
@Type(int.class)
private boolean weekly;
...
}
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Mapping
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Mapping
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="ref_guide_mapping"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 7. 
Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23655"><!--
mapping metadata
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The JPA Overview's <fo:basic-link internal-destination="jpa_overview_mapping"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 12, <fo:inline font-style="italic">
Mapping Metadata
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping"/>]</fo:inline></fo:basic-link> explains
object-relational mapping under JPA. This chapter reviews the mapping utilities
OpenJPA provides and examines OpenJPA features that go beyond the JPA
specification.
</fo:block><fo:block id="ref_guide_mapping_mappingtool"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Forward Mapping
</fo:marker><fo:block font-size="20.735999999999997pt">7.1. 
Forward Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23665"><!--
forward mapping
--></fo:wrapper><fo:wrapper id="d0e23668"><!--
mapping tool
--></fo:wrapper><fo:wrapper id="d0e23673"><!--
mapping metadata
,
forward mapping
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">Forward mapping</fo:inline> is the process of creating mappings and
their corresponding database schema from your object model. OpenJPA supports
forward mapping through the <fo:inline font-style="italic">mapping tool</fo:inline>. The next section
presents several common mapping tool use cases. You can invoke the tool through
its Java class,
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/meta/MappingTool"><fo:inline font-family="monospace">
org.apache.openjpa.jdbc.meta.MappingTool</fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e23692"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:basic-link internal-destination="ref_guide_integration_mappingtool"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.1.4, “
Mapping Tool Ant Task
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_integration_mappingtool"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_integration_mappingtool"/>]</fo:inline></fo:basic-link> describes the mapping
tool Ant task.
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_mapping_mappingtool_typical"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.1. 
Using the Mapping Tool
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e23700">
java org.apache.openjpa.jdbc.meta.MappingTool Magazine.java
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In addition to the universal flags of the
<fo:basic-link internal-destination="ref_guide_conf_devtools"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">configuration framework</fo:inline></fo:basic-link>, the
mapping tool accepts the following command line arguments:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e23707"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23708"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-schemaAction/-sa &lt;add | refresh | drop | build | retain | reflect | createDB | dropDB | import | export | none&gt;
</fo:inline>: The action to take on the schema. These options correspond to the
same-named actions on the schema tool described in
<fo:basic-link internal-destination="ref_guide_schema_schematool"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.12, “
Schema Tool
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_schema_schematool"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_schema_schematool"/>]</fo:inline></fo:basic-link>. Actions can be composed in a
comma-separated list. Unless you are running the mapping tool on all of
your persistent types at once or dropping a mapping, we strongly
recommend you use the default <fo:inline font-family="monospace">add</fo:inline> action or the
<fo:inline font-family="monospace">build</fo:inline> action. Otherwise you may end up inadvertently
dropping schema components that are used by classes you are not
currently running the tool over.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23722"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-schemaFile/-sf &lt;stdout | output file&gt;</fo:inline>: Use this
option to write the planned schema to an XML document rather than modify the
database. The document can then be manipulated and committed to the database
with the <fo:basic-link internal-destination="ref_guide_schema_schematool"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"> schema tool</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23731"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-sqlFile/-sql &lt;stdout | output file&gt;</fo:inline>: Use this option
to write the planned schema modifications to a SQL script rather than modify the
database. Combine this with a <fo:inline font-family="monospace">schemaAction</fo:inline> of <fo:inline font-family="monospace">build
</fo:inline> to generate a script that recreates the schema for the current
mappings, even if the schema already exists.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23743"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-dropTables/-dt &lt;true/t | false/f&gt;</fo:inline>: Corresponds to the
same-named option on the schema tool.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23749"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-dropSequences/-dsq &lt;true/t | false/f&gt;</fo:inline>: Corresponds to
the same-named option on the schema tool.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23755"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-openjpaTables/-ot &lt;true/t | false/f&gt;</fo:inline>: Corresponds to
the same-named option on the schema tool.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23761"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-ignoreErrors/-i &lt;true/t | false/f&gt;</fo:inline>: Corresponds to
the same-named option on the schema tool.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23767"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-schemas/-s &lt;schema and table names&gt;</fo:inline>: Corresponds to
the same-named option on the schema tool. This option is ignored if <fo:inline font-family="monospace">
readSchema</fo:inline> is not set to <fo:inline font-family="monospace">true</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23779"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-readSchema/-rs &lt;true/t | false/f&gt;</fo:inline>: Set this option to
<fo:inline font-family="monospace">true</fo:inline> to read the entire existing schema when the tool runs.
Reading the existing schema ensures that OpenJPA does not generate any mappings
that use table, index, primary key, or foreign key names that conflict with
existing names. Depending on the JDBC driver, though, it can be a slow process
for large schemas.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23788"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-primaryKeys/-pk &lt;true/t | false/f&gt;</fo:inline>: Whether to read
and manipulate primary key information of existing tables. Defaults to false.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23794"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-foreignKeys/-fk &lt;true/t | false/f&gt;</fo:inline>: Whether to read
and manipulate foreign key information of existing tables. Defaults to false.
This means that to add any new foreign keys to a class that has already been
mapped, you must explicitly set this flag to true.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23800"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-indexes/-ix &lt;true/t | false/f&gt;</fo:inline>: Whether to read and
manipulate index information of existing tables. Defaults to false. This means
that to add any new indexes to a class that has already been mapped once, you
must explicitly set this flag to true.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23806"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-sequences/-sq &lt;true/t | false/f&gt;</fo:inline>: Whether to
manipulate sequences. Defaults to true.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23812"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-meta/-m &lt;true/t | false/f&gt;</fo:inline>: Whether the given action
applies to metadata rather than or in addition to mappings.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The mapping tool also uses an <fo:inline font-family="monospace">-action/-a</fo:inline> argument to specify
the action to take on each class. The available actions are:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e23823"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23824"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">buildSchema</fo:inline>: This is the default action. It
makes the database schema match your existing mappings. If your provided
mappings conflict with your class definitions, OpenJPA will fail with an
informative exception.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23830"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">validate</fo:inline>: Ensure that the mappings for the given classes are
valid and that they match the schema. No mappings or tables will be changed. An
exception is thrown if any mappings are invalid.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Each additional argument to the tool should be one of:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e23838"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23839"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The full name of a persistent class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23842"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The .java file for a persistent class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e23845"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The <fo:inline font-family="monospace">.class</fo:inline> file of a persistent class.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If you do not supply any arguments to the mapping tool, it will run on the
classes in your persistent classes list (see
<fo:basic-link internal-destination="ref_guide_pc_pcclasses"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.1, “
Persistent Class List
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_pcclasses"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_pcclasses"/>]</fo:inline></fo:basic-link>).
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The mappings generated by the mapping tool are stored by the system <fo:inline font-style="italic">
mapping factory</fo:inline>. <fo:basic-link internal-destination="ref_guide_mapping_factory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.5, “
Mapping Factory
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_factory"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_factory"/>]</fo:inline></fo:basic-link>
discusses your mapping factory options.
</fo:block><fo:block id="ref_guide_mapping_mappingtool_examples"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Using the Mapping Tool
</fo:marker><fo:block font-size="17.28pt">7.1.1. 
Using the Mapping Tool
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23865"><!--
mapping tool
,
use cases
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The JPA specification defines a comprehensive set of defaults for missing
mapping information. Thus, forward mapping in JPA is virtually automatic. After
using the mapping annotations covered in <fo:basic-link internal-destination="jpa_overview_mapping"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 12, <fo:inline font-style="italic">
Mapping Metadata
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping"/>]</fo:inline></fo:basic-link>
of the JPA Overview to override any unsatisfactory defaults, run the
mapping tool on your persistent classes. The default <fo:inline font-family="monospace">buildSchema
</fo:inline> mapping tool action manipulates the database schema to
match your mappings. It fails if any of your mappings don't match your object
model.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_mapping_mappingtool_buildschema"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.2. 
Creating the Relational Schema from Mappings
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e23880">
java org.apache.openjpa.jdbc.meta.MappingTool Magazine.java
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To drop the schema for a persistent class, set the mapping tool's <fo:inline font-family="monospace">
schemaAction</fo:inline> to <fo:inline font-family="monospace">drop</fo:inline>.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_mapping_mappingtool_cleanup_tables"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.3. 
Refreshing entire schema and cleaning out tables
</fo:block><fo:wrapper id="d0e23893"><!--
testing
,
Rebuild mappings and clean tables
--></fo:wrapper><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e23898">
java org.apache.openjpa.jdbc.meta.MappingTool -schemaAction add,deleteTableContents
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_mapping_mappingtool_dropschema"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.4. 
Dropping Mappings and Association Schema
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e23903">
java org.apache.openjpa.jdbc.meta.MappingTool -schemaAction drop Magazine.java
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_ddl_examples"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Generating DDL SQL
</fo:marker><fo:block font-size="17.28pt">7.1.2. 
Generating DDL SQL
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23908"><!--
mapping tool
,
DDL generation
--></fo:wrapper><fo:wrapper id="d0e23913"><!--
DDL
,
with mapping tool
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The examples below show how to use the mapping tool to generate DDL SQL scripts,
rather than modifying the database directly.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guid_mapping_ddl_full_ddl"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.5. 
Create DDL for Current Mappings
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This example uses your existing mappings to determine the needed schema, then
writes the SQL to create that schema to <fo:inline font-family="monospace">create.sql</fo:inline>.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e23928">
java org.apache.openjpa.jdbc.meta.MappingTool -schemaAction build -sql create.sql Magazine.java
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guid_mapping_ddl_part_ddl"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.6. 
Create DDL to Update Database for Current Mappings
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This example uses your existing mappings to determine the needed schema. It then
writes the SQL to add any missing tables and columns to the current schema to
<fo:inline font-family="monospace">update.sql</fo:inline>.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e23938">
java org.apache.openjpa.jdbc.meta.MappingTool -sql update.sql Magazine.java
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_mapping_synch"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Runtime Forward Mapping
</fo:marker><fo:block font-size="17.28pt">7.1.3. 
Runtime Forward Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23943"><!--
forward mapping
,
automatic runtime mapping
--></fo:wrapper><fo:wrapper id="d0e23948"><!--
mapping metadata
,
automatic runtime mapping
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can configure OpenJPA to automatically run the mapping tool at runtime
through the <fo:basic-link internal-destination="openjpa.jdbc.SynchronizeMappings"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.jdbc.SynchronizeMappings</fo:inline></fo:inline></fo:basic-link> configuration property. Using
this property saves you the trouble of running the mapping tool manually, and is
meant for use during rapid test/debug cycles.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In order to enable automatic runtime mapping, you must first list all your
persistent classes as described in <fo:basic-link internal-destination="ref_guide_pc_pcclasses"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.1, “
Persistent Class List
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_pcclasses"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_pcclasses"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA will run the mapping tool on these classes when your application obtains
its first <fo:inline font-family="monospace">EntityManager</fo:inline>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">openjpa.jdbc.SynchronizeMappings</fo:inline> property is a plugin
string (see <fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) where the class
name is the mapping tool action to invoke, and the properties are the
<fo:inline font-family="monospace">MappingTool</fo:inline> class' JavaBean properties. These properties
correspond go the long versions of the tool's command line flags.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_mapping_synchex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.7. 
Configuring Runtime Forward Mapping
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e23981">
&lt;property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/&gt;
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The setting above corresponds to running the following command:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e23985">
java org.apache.openjpa.jdbc.meta.MappingTool -action buildSchema -foreignKeys true
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_pc_reverse"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Reverse Mapping
</fo:marker><fo:block font-size="20.735999999999997pt">7.2. 
Reverse Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e23990"><!--
reverse mapping
--></fo:wrapper><fo:wrapper id="d0e23993"><!--
reverse mapping tool
--></fo:wrapper><fo:wrapper id="d0e23998"><!--
mapping metadata
,
reverse mapping
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA includes a <fo:inline font-style="italic">reverse mapping</fo:inline> tool for generating
persistent class definitions, complete with metadata, from an existing database
schema. You do not have to use the reverse mapping tool to access an existing
schema; you are free to write your classes and mappings yourself, as described
in <fo:basic-link internal-destination="ref_guide_mapping_middle"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.3, “
Meet-in-the-Middle Mapping
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_middle"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_middle"/>]</fo:inline></fo:basic-link>. The reverse mapping tool,
however, can give you an excellent starting point from which to grow your
persistent classes.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To use the reverse mapping tool, follow the steps below:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.2em" id="d0e24014"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24015"><fo:list-item-label end-indent="label-end()"><fo:block>1.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Use the <fo:basic-link internal-destination="ref_guide_schema_schematool"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"> schema tool</fo:inline></fo:basic-link> to
export your current schema to an XML schema file. You can skip this step and the
next step if you want to run the reverse mapping tool directly against the
database.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_pc_reverse_schemagen"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.8. 
Reflection with the Schema Tool
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e24024">
java org.apache.openjpa.jdbc.schema.SchemaTool -a reflect -f schema.xml
</fo:block></fo:block></fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24026"><fo:list-item-label end-indent="label-end()"><fo:block>2.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Examine the generated schema file. JDBC drivers often provide incomplete or
faulty metadata, in which case the file will not exactly match the actual
schema. Alter the XML file to match the true schema. The XML format for the
schema file is described in <fo:basic-link internal-destination="ref_guide_schema_xml"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.13, “
XML Schema Format
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_schema_xml"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_schema_xml"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
After fixing any errors in the schema file, modify the XML to include foreign
keys between all relations. The schema tool will have automatically detected
existing foreign key constraints; many schemas, however, do not employ database
foreign keys for every relation. By manually adding any missing foreign keys,
you will give the reverse mapping tool the information it needs to generate the
proper relations between the persistent classes it creates.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24033"><fo:list-item-label end-indent="label-end()"><fo:block>3.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Run the reverse mapping tool on the finished schema file. If you do not supply
the schema file to reverse map, the tool will run directly against the schema in
the database. The tool can be run via its Java class,
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/meta/ReverseMappingTool">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.meta.ReverseMappingTool</fo:inline></fo:basic-link>.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_pc_reverse_reversemappingtool"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.9. 
Using the Reverse Mapping Tool
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e24044">
java org.apache.openjpa.jdbc.meta.ReverseMappingTool -pkg com.xyz -d ~/src -cp customizer.properties schema.xml
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In addition to OpenJPA's <fo:basic-link internal-destination="ref_guide_conf_devtools"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">standard
configuration flags</fo:inline></fo:basic-link>, including
<fo:basic-link internal-destination="ref_guide_conf_devtools_format"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">code formatting options</fo:inline></fo:basic-link>,
the reverse mapping tool recognizes the following command line arguments:
</fo:block><fo:list-block provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e24054"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24055"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-schemas/-s &lt;schema and table names&gt;</fo:inline>: A
comma-separated list of schema and table names to reverse map, if no XML schema
file is supplied. Each element of the list must follow the naming conventions
for the <fo:inline font-family="monospace">openjpa.jdbc.Schemas</fo:inline> property described in
<fo:basic-link internal-destination="ref_guide_schema_info_list"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.11.1, “
Schemas List
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_schema_info_list"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_schema_info_list"/>]</fo:inline></fo:basic-link>. In fact, if this flag is
omitted, it defaults to the value of the <fo:inline font-family="monospace">Schemas</fo:inline> property. If
the <fo:inline font-family="monospace">Schemas</fo:inline> property is not defined, all schemas will be
reverse-mapped.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24072"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-package/-pkg &lt;package name&gt;</fo:inline>: The package name of the
generated classes. If no package name is given, the generated code will not
contain package declarations.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24078"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-directory/-d &lt;output directory&gt;</fo:inline>: All generated code
and metadata will be written to the directory at this path. If the path does not
match the package of a class, the package structure will be created beneath this
directory. Defaults to the current directory.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24084"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-metadata/-md &lt;class | package | none&gt;</fo:inline>: Specify the
level the metadata should be generated at. Defaults to generating a single
package-level metadata file. Set to <fo:inline font-family="monospace">none</fo:inline> to disable orm.xml
generation.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24093"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-annotations/-ann &lt;true/t | false/f&gt;</fo:inline>: Set to true to
generate JPA annotations in generated java classes.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24099"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-accessType/-access &lt;field | property&gt;</fo:inline>: Change access
type for generated annotations. Defaults to field access.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24105"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-useSchemaName/-sn &lt;true/t | false/f&gt;</fo:inline>: Set this flag
to <fo:inline font-family="monospace">true</fo:inline> to include the schema as well as table name in the
name of each generated class. This can be useful when dealing with multiple
schemas with same-named tables.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24114"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-useForeignKeyName/-fkn &lt;true/t | false/f&gt;</fo:inline>: Set this
flag to <fo:inline font-family="monospace">true</fo:inline> if you would like field names for relations to
be based on the database foreign key name. By default, relation field names are
derived from the name of the related class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24123"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-nullableAsObject/-no &lt;true/t | false/f&gt;</fo:inline>: By default,
all non-foreign key columns are mapped to primitives. Set this flag to <fo:inline font-family="monospace">
true</fo:inline> to generate primitive wrapper fields instead for columns that
allow null values.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24132"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-blobAsObject/-bo &lt;true/t | false/f&gt;</fo:inline>: By default, all
binary columns are mapped to <fo:inline font-family="monospace">byte[]</fo:inline> fields. Set this flag
to <fo:inline font-family="monospace">true</fo:inline> to map them to <fo:inline font-family="monospace">Object</fo:inline> fields
instead. Note that when mapped this way, the column is presumed to contain a
serialized Java object.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24147"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-primaryKeyOnJoin/-pkj &lt;true/t | false/f&gt;</fo:inline>: The
standard reverse mapping tool behavior is to map all tables with primary keys to
persistent classes. If your schema has primary keys on many-many join tables as
well, set this flag to <fo:inline font-family="monospace">true</fo:inline> to avoid creating classes for
those tables.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24156"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-inverseRelations/-ir &lt;true/t | false/f&gt;</fo:inline>: Set to
<fo:inline font-family="monospace">false</fo:inline> to prevent the creation of inverse 1-many/1-1 relations
for every many-1/1-1 relation detected.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24165"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-useGenericCollections/-gc &lt;true/t | false/f&gt;</fo:inline>: Set to
true to use generic collections on OneToMany and ManyToMany relations (requires
JDK 1.5 or higher).
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24171"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-useDatastoreIdentity/-ds &lt;true/t | false/f&gt;</fo:inline>: Set to
<fo:inline font-family="monospace">true</fo:inline> to use datastore identity for tables that have single
numeric primary key columns. The tool typically uses application identity for
all generated classes.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24180"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-useBuiltinIdentityClass/-bic &lt;true/t | false/f&gt;</fo:inline>: Set
to <fo:inline font-family="monospace">false</fo:inline> to prevent the tool from using built-in application
identity classes when possible. This will force the tool to to create custom
application identity classes even when there is only one primary key column.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24189"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-innerIdentityClasses/-inn &lt;true/t | false/f&gt;</fo:inline>: Set to
<fo:inline font-family="monospace">true</fo:inline> to have any generated application identity classes be
created as static inner classes within the persistent classes. Defaults to
<fo:inline font-family="monospace">false</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24201"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-identityClassSuffix/-is &lt;suffix&gt;</fo:inline>: Suffix to append to
class names to form application identity class names, or for inner identity
classes, the inner class name. Defaults to <fo:inline font-family="monospace">Id</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24210"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-typeMap/-typ &lt;type mapping&gt;</fo:inline>: A string that specifies
the default Java classes to generate for each SQL type that is seen in the
schema. The format is <fo:inline font-family="monospace"> SQLTYPE1=JavaClass1,SQLTYPE2=JavaClass2
</fo:inline>. The SQL type name first looks for a customization based on <fo:inline font-family="monospace">
SQLTYPE(SIZE,PRECISION)</fo:inline>, then <fo:inline font-family="monospace">SQLTYPE(SIZE)</fo:inline>, then
<fo:inline font-family="monospace">SQLTYPE(SIZE,PRECISION)</fo:inline>. So if a column whose type name is
<fo:inline font-family="monospace">CHAR</fo:inline> is found, it will first look for the <fo:inline font-family="monospace">
CHAR(50,0)</fo:inline> type name specification, then it will look for <fo:inline font-family="monospace">
CHAR(50)</fo:inline>, and finally it will just look for <fo:inline font-family="monospace">CHAR</fo:inline>.
For example, to generate a char array for every <fo:inline font-family="monospace">CHAR</fo:inline> column
whose size is exactly 50, and to generate a <fo:inline font-family="monospace">short</fo:inline> for every
type name of <fo:inline font-family="monospace">INTEGER</fo:inline>, you might specify: <fo:inline font-family="monospace">
CHAR(50)=char[],INTEGER=short</fo:inline>. Note that since various databases
report different type names differently, one database's type name specification
might not work for another database. Enable <fo:inline font-family="monospace">TRACE</fo:inline> level
logging on the <fo:inline font-family="monospace">MetaData</fo:inline> channel to track which type names
OpenJPA is examining.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24258"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-customizerClass/-cc &lt;class name&gt;</fo:inline>: The full class name
of a
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/meta/ReverseCustomizer.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.meta.ReverseCustomizer</fo:inline></fo:basic-link>
customization plugin. If you do not specify a reverse customizer of your own,
the system defaults to a
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/meta/PropertiesReverseCustomizer.html">
<fo:inline font-family="monospace">PropertiesReverseCustomizer</fo:inline></fo:basic-link>. This customizer
allows you to specify simple customization options in the properties file given
with the <fo:inline font-family="monospace">-customizerProperties</fo:inline> flag below. We present the
available property keys <fo:basic-link internal-destination="ref_guide_pc_reverse_custom"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">
below</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24280"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-customizerProperties/-cp &lt;properties file or resource&gt;</fo:inline>
: The path or resource name of a properties file to pass to the reverse
customizer on initialization.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24286"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-customizer./-c.&lt;property name&gt; &lt;property value&gt;</fo:inline>
: The given property name will be matched with the corresponding Java bean
property in the specified reverse customizer, and set to the given value.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Running the tool will generate <fo:inline font-family="monospace">.java</fo:inline> files for each
generated class (and its application identity class, if applicable), along with
JPA annotations (if enabled by setting <fo:inline font-family="monospace">-annotations true</fo:inline>),
or an <fo:inline font-family="monospace">orm.xml</fo:inline> file (if not disabled with <fo:inline font-family="monospace">
-metadata none</fo:inline>) containing the corresponding persistence metadata.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24306"><fo:list-item-label end-indent="label-end()"><fo:block>4.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Examine the generated class, metadata, and mapping information, and modify it as
necessary. Remember that the reverse mapping tool only provides a starting
point, and you are free to make whatever modifications you like to the code it
generates.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
After you are satisfied with the generated classes and their mappings, you
should first compile the classes with <fo:inline font-family="monospace">javac</fo:inline>, <fo:inline font-family="monospace">
jikes</fo:inline>, or your favorite Java compiler. Make sure the classes are
located in the directory corresponding to the <fo:inline font-family="monospace">-package</fo:inline> flag
you gave the reverse mapping tool. Next, if you have generated an <fo:inline font-family="monospace">
orm.xml</fo:inline>, move that file to a <fo:inline font-family="monospace">META-INF</fo:inline> directory
within a directory in your classpath. Finally, enhance the classes
if necessary (see <fo:basic-link internal-destination="ref_guide_pc_enhance"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2, “
Enhancement
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_enhance"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_enhance"/>]</fo:inline></fo:basic-link>).
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Your persistent classes are now ready to access your existing schema.
</fo:block><fo:block id="ref_guide_pc_reverse_custom"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Customizing Reverse Mapping
</fo:marker><fo:block font-size="17.28pt">7.2.1. 
Customizing Reverse Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">org.apache.openjpa.jdbc.meta.ReverseCustomizer</fo:inline> plugin
interface allows you to customze the reverse mapping process. See the class
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/meta/ReverseCustomizer.html">
Javadoc</fo:basic-link> for details on the hooks that this interface provides. Specify
the concrete plugin implementation to use with the <fo:inline font-family="monospace">
-customizerClass/-cc</fo:inline> command-line flag, described in the preceding
section.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
By default, the reverse mapping tool uses a
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/meta/PropertiesReverseCustomizer.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.meta.PropertiesReverseCustomizer</fo:inline>
</fo:basic-link>. This customizer allows you to perform relatively simple
customizations through the properties file named with the <fo:inline font-family="monospace">
-customizerProperties</fo:inline> tool flag. The customizer recognizes the
following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e24355"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24356"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">&lt;table name&gt;.table-type &lt;type&gt;</fo:inline>: Override the
default type of the table with name <fo:inline font-family="monospace">&lt;table name&gt;</fo:inline>.
Legal values are:
</fo:block><fo:list-block provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e24365"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24366"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">base</fo:inline>: Primary table for a base class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24372"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">secondary</fo:inline>: Secondary table for a class. The table must have
a foreign key joining to a class table.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24378"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">secondary-outer</fo:inline>: Outer-joined secondary table for a class.
The table must have a foreign key joining to a class table.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24384"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">association</fo:inline>: Association table. The table must have two
foreign keys to class tables.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24390"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">collection</fo:inline>: Collection table. The table must have one
foreign key to a class table and one data column.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24396"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">subclass</fo:inline>: A joined subclass table. The table must have a
foreign key to the superclass' table.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24402"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">none</fo:inline>: The table should not be reverse-mapped.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24408"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">&lt;class name&gt;.rename &lt;new class name&gt;</fo:inline>: Override
the given tool-generated name <fo:inline font-family="monospace">&lt;class name&gt;</fo:inline> with a new
value. Use full class names, including package. You are free to rename a class
to a new package. Specify a value of <fo:inline font-family="monospace">none</fo:inline> to reject the class
and leave the corresponding table unmapped.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24420"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">&lt;table name&gt;.class-name &lt;new class name&gt;</fo:inline>: Assign
the given fully-qualified class name to the type created from the table with
name <fo:inline font-family="monospace">&lt;table name&gt;</fo:inline>. Use a value of <fo:inline font-family="monospace">none
</fo:inline> to prevent reverse mapping this table. This property can be used in
place of the <fo:inline font-family="monospace">rename</fo:inline> property.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24435"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">&lt;class name&gt;.identity &lt;datastore | builtin | identity class
name&gt;</fo:inline>: Set this property to <fo:inline font-family="monospace">datastore</fo:inline> to use
datastore identity for the class <fo:inline font-family="monospace">&lt;class name&gt;</fo:inline>,
<fo:inline font-family="monospace">builtin</fo:inline> to use a built-in identity class, or the desired
application identity class name. Give full class names, including package. You
are free to change the package of the identity class this way. If the persistent
class has been renamed, use the new class name for this property key. Remember
that datastore identity requires a table with a single numeric primary key
column, and built-in identity requires a single primary key column of any type.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24450"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">&lt;class name&gt;.&lt;field name&gt;.rename &lt;new field name&gt;
</fo:inline>: Override the tool-generated <fo:inline font-family="monospace">&lt;field name&gt;</fo:inline> in
class <fo:inline font-family="monospace">&lt;class name&gt;</fo:inline> with the given name. Use the field
owner's full class name in the property key. If the field owner's class was
renamed, use the new class name. The property value should be the new field
name, without the preceding class name. Use a value of <fo:inline font-family="monospace">none</fo:inline>
to reject the generated mapping and remove the field from the class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24465"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">&lt;table name&gt;.&lt;column name&gt;.field-name &lt;new field
name&gt;</fo:inline>: Set the generated field name for the <fo:inline font-family="monospace">&lt;table
name&gt;</fo:inline> table's <fo:inline font-family="monospace">&lt;column name&gt;</fo:inline> column. If
this is a multi-column mapping, any of the columns can be used. Use a value of
<fo:inline font-family="monospace">none</fo:inline> to prevent the column and its associated columns from
being reverse-mapped.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24480"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">&lt;class name&gt;.&lt;field name&gt;.type &lt;field type&gt;</fo:inline>
: The type to give the named field. Use full class names. If the field or the
field's owner class has been renamed, use the new name.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24486"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">&lt;class name&gt;.&lt;field name&gt;.value</fo:inline>: The initial
value for the named field. The given string will be placed as-is in the
generated Java code, so be sure it is valid Java. If the field or the field's
owner class has been renamed, use the new name.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
All property keys are optional; if not specified, the customizer keeps the
default value generated by the reverse mapping tool.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_pc_reverse_custom_ex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.10. 
Customizing Reverse Mapping with Properties
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e24497">
java org.apache.openjpa.jdbc.meta.ReverseMappingTool -pkg com.xyz -cp custom.properties schema.xml
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Example <fo:inline font-family="monospace">custom.properties</fo:inline>:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e24504">
com.xyz.TblMagazine.rename: com.xyz.Magazine
com.xyz.TblArticle.rename: com.xyz.Article
com.xyz.TblPubCompany.rename: com.xyz.pub.Company
com.xyz.TblSysInfo.rename: none
com.xyz.Magazine.allArticles.rename: articles
com.xyz.Magazine.articles.type: java.util.Collection
com.xyz.Magazine.articles.value: new TreeSet()
com.xyz.Magazine.identity: datastore
com.xyz.pub.Company.identity: com.xyz.pub.CompanyId
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_mapping_middle"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Meet-in-the-Middle Mapping
</fo:marker><fo:block font-size="20.735999999999997pt">7.3. 
Meet-in-the-Middle Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e24509"><!--
meet-in-the-middle mapping
--></fo:wrapper><fo:wrapper id="d0e24512"><!--
reverse mapping tool
--></fo:wrapper><fo:wrapper id="d0e24517"><!--
mapping metadata
,
meet-in-the-middle mapping
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In the <fo:inline font-style="italic">meet-in-the-middle</fo:inline>
mapping approach, you control both the relational model and the object model. It
is up to you to define the mappings between these models. The mapping
tool's <fo:inline font-family="monospace">validate</fo:inline> action is useful to meet-in-the-middle
mappers. This action verifies that the mapping information for a class matches
the class definition and the existing schema. It throws an informative exception
when your mappings are incorrect.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_mapping_mappingtool_validate"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.11. 
Validating Mappings
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e24535">
java org.apache.openjpa.jdbc.meta.MappingTool -action validate Magazine.java
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">buildSchema</fo:inline> action we discussed in
<fo:basic-link internal-destination="ref_guide_mapping_mappingtool"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.1, “
Forward Mapping
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_mappingtool"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_mappingtool"/>]</fo:inline></fo:basic-link> is also somewhat useful
during meet-in-the-middle mapping. Unlike the <fo:inline font-family="monospace">validate</fo:inline>
action, which throws an exception if your mapping data does not match the
existing schema, the <fo:inline font-family="monospace">buildSchema</fo:inline> action assumes your mapping
data is correct, and modifies the schema to match your mappings. This lets you
modify your mapping data manually, but saves you the hassle of using your
database's tools to bring the schema up-to-date.
</fo:block></fo:block><fo:block id="ref_guide_mapping_defaults"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Mapping Defaults
</fo:marker><fo:block font-size="20.735999999999997pt">7.4. 
Mapping Defaults
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e24553"><!--
MappingDefaults
--></fo:wrapper><fo:wrapper id="d0e24556"><!--
mapping metadata
,
defaults
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The previous sections showed how to use the mapping tool to generate default
mappings. But how does the mapping tool know what mappings to generate? The
answer lies in the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/meta/MappingDefaults.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.meta.MappingDefaults</fo:inline></fo:basic-link>
interface. OpenJPA uses an instance of this interface to decide how to name
tables and columns, where to put foreign keys, and generally how to create a
schema that matches your object model.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e24570"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Important</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA relies on foreign key constraint information at runtime to order SQL
appropriately. Be sure to set your mapping defaults to reflect your existing
database constraints, set the schema factory to reflect on the database for
constraint information (see <fo:basic-link internal-destination="ref_guide_schema_info_factory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.11.2, “
Schema Factory
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_schema_info_factory"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_schema_info_factory"/>]</fo:inline></fo:basic-link>),
or use explicit foreign key mappings as described in
<fo:basic-link internal-destination="ref_guide_mapping_jpa_fk"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.7.9.2, “
Foreign Keys
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_jpa_fk"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_jpa_fk"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:basic-link internal-destination="openjpa.jdbc.MappingDefaults"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.jdbc.MappingDefaults</fo:inline></fo:inline></fo:basic-link> configuration property controls
the <fo:inline font-family="monospace">MappingDefaults</fo:inline> interface implementation in use. This
is a plugin property (see <fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>), so
you can substitute your own implementation or configure the existing ones.
OpenJPA includes the following standard implementations:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e24588"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24589"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">jpa</fo:inline>: Provides defaults in compliance with the JPA standard.
This is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/PersistenceMappingDefaults.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.PersistenceMappingDefaults
</fo:inline></fo:basic-link> class. This class extends the <fo:inline font-family="monospace">
MappingDefaultsImpl</fo:inline> class described below, so it has all the same
properties (though with different default values), as well as:
</fo:block><fo:list-block provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e24603"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24604"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">PrependFieldNameToJoinTableInverseJoinColumns</fo:inline>: Whether to
prepend the owning field name to the names of inverse join columns in join
tables. Defaults to true per the JPA specification. Set to false for
compatibility with older OpenJPA versions which did not prepend the field name.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24610"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">default</fo:inline>: This is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/meta/MappingDefaultsImpl.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.meta.MappingDefaultsImpl</fo:inline></fo:basic-link>
class. This default implementation is highly configurable. It has the following
properties:
</fo:block><fo:list-block provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e24621"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24622"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">DefaultMissingInfo</fo:inline>: Whether to default missing column and
table names rather than throw an exception. If set to false, full explicit
mappings are required at runtime and when using mapping tool actions like
<fo:inline font-family="monospace">buildSchema</fo:inline> and <fo:inline font-family="monospace">validate</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24634"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">BaseClassStrategy</fo:inline>: The default mapping strategy for base
classes. You can specify a built-in strategy alias or the full class name of a
<fo:basic-link internal-destination="ref_guide_mapping_custom_class"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">custom class strategy</fo:inline></fo:basic-link>.
You can also use OpenJPA's plugin format (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) to pass arguments to the
strategy instance. See the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/meta/strats/package-summary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.meta.strats</fo:inline></fo:basic-link> package for
available strategies.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24650"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">SubclassStrategy</fo:inline>: The default mapping strategy for
subclasses. You can specify a builtin strategy alias or the full class name of a
<fo:basic-link internal-destination="ref_guide_mapping_custom_class"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"> custom class strategy</fo:inline></fo:basic-link>.
You can also use OpenJPA's plugin format (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) to pass arguments to the
strategy instance. Common strategies are <fo:inline font-family="monospace">vertical</fo:inline> and
<fo:inline font-family="monospace">flat</fo:inline>, the default. See the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/meta/strats/package-summary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.meta.strats</fo:inline></fo:basic-link> package for all
available strategies.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24672"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">VersionStrategy</fo:inline>: The default version strategy for classes
without a version field. You can specify a builtin strategy alias or the full
class name of a <fo:basic-link internal-destination="ref_guide_mapping_custom_versdiscrim"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"> custom
version strategy</fo:inline></fo:basic-link>. You can also use OpenJPA's plugin format (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) to pass arguments to the
strategy instance. Common strategies are <fo:inline font-family="monospace">none</fo:inline>, <fo:inline font-family="monospace">
state-comparison</fo:inline>, <fo:inline font-family="monospace"> timestamp</fo:inline>, and <fo:inline font-family="monospace">
version-number</fo:inline>, the default. See the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/meta/strats/package-summary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.meta.strats</fo:inline></fo:basic-link> package for all
available strategies.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24700"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">DiscriminatorStrategy</fo:inline>: The default discriminator strategy
when no discriminator value is given. You can specify a builtin strategy alias
or the full class name of a
<fo:basic-link internal-destination="ref_guide_mapping_custom_versdiscrim"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"> custom discriminator
strategy</fo:inline></fo:basic-link>. You can also use OpenJPA's plugin format (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) to pass arguments to the
strategy instance. Common strategies are <fo:inline font-family="monospace">final</fo:inline> for a base
class without subclasses, <fo:inline font-family="monospace">none</fo:inline> to use joins to subclass
tables rather than a discriminator column, and <fo:inline font-family="monospace"> class-name</fo:inline>,
the default. See the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/meta/strats/package-summary.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.meta.strats</fo:inline></fo:basic-link> package for all
available strategies.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24725"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">FieldStrategies</fo:inline>: This property associates field types with
custom strategies. The format of this property is similar to that of plugin
strings (see <fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link> ), without the class
name. It is a comma-separated list of key/value pairs, where each key is a
possible field type, and each value is itself a plugin string describing the
strategy for that type. We present an example below. See
<fo:basic-link internal-destination="ref_guide_mapping_custom_field"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.10.3, “
Custom Field Mapping
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_custom_field"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_custom_field"/>]</fo:inline></fo:basic-link> for information on custum
field strategies.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24735"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">ForeignKeyDeleteAction</fo:inline>: The default delete action of foreign
keys representing relations to other objects. Recognized values include
<fo:inline font-family="monospace">restrict</fo:inline>, <fo:inline font-family="monospace">cascade</fo:inline>, <fo:inline font-family="monospace">null</fo:inline>
, <fo:inline font-family="monospace">default</fo:inline>. These values correspond exactly to the standard
database foreign key actions of the same names.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The value <fo:inline font-family="monospace">none</fo:inline> tells OpenJPA not to create database foreign
keys on relation columns. This is the default.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24758"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">JoinForeignKeyDeleteAction</fo:inline>: The defualt delete action of
foreign keys that join join secondary, collection, map, or subclass tables to
the primary table. Accepts the same values as the <fo:inline font-family="monospace">
ForeignKeyDeleteAction</fo:inline> property above.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24767"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">DeferConstraints</fo:inline>: Whether to use deferred database
constraints if possible. Defaults to false.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24773"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">IndexLogicalForeignKeys</fo:inline>: Boolean property controlling
whether to create indexes on logical foreign keys. Logical foreign keys are
columns that represent a link between tables, but have been configured through
the <fo:inline font-family="monospace">ForeignKey</fo:inline> properties above not to use a physical
database foreign key. Defaults to true.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24782"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">DataStoreIdColumnName</fo:inline>: The default name of datastore
identity columns.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24788"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">DiscriminatorColumnName</fo:inline>: The default name of discriminator
columns.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24794"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">IndexDiscriminator</fo:inline>: Whether to index the discriminator
column. Defaults to true.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24800"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">VersionColumnName</fo:inline>: The default name of version columns.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24806"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">IndexVersion</fo:inline>: Whether to index the version column. Defaults
to false.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24812"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">AddNullIndicator</fo:inline>: Whether to create a synthetic null
indicator column for embedded mappings. The null indicator column allows OpenJPA
to distinguish between a null embedded object and one with default values for
all persistent fields.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24818"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">NullIndicatorColumnName</fo:inline>: The default name of synthetic null
indicator columns for embedded objects.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24824"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">OrderLists</fo:inline>: Whether to create a database ordering column for
maintaining the order of persistent lists and arrays.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24830"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">OrderColumnName</fo:inline>: The default name of collection and array
ordering columns.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24836"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">StoreEnumOrdinal</fo:inline>: Set to true to store enum fields as
numeric ordinal values in the database. The default is to store the enum value
name as a string, which is more robust if the Java enum declaration might be
rearranged.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24842"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">StoreUnmappedObjectIdString</fo:inline>: Set to true to store the
stringified identity of related objects when the declared related type is
unmapped. By default, OpenJPA stores the related object's primary key value(s).
However, this breaks down if different subclasses of the related type use
incompatible primary key structures. In that case, stringifying the identity
value is the better choice.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The example below turns on foreign key generation during schema creation and
associates the <fo:inline font-family="monospace">org.mag.data.InfoStruct</fo:inline> field type with
the custom <fo:inline font-family="monospace">org.mag.mapping.InfoStructHandler</fo:inline> value
handler.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_mapping_defaults_conf"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.12. 
Configuring Mapping Defaults
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e24859">
&lt;property name="openjpa.jdbc.MappingDefaults"
value="ForeignKeyDeleteAction=restrict,
FieldStrategies='org.mag.data.InfoStruct=org.mag.mapping.InfoStructHandler'"/&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_mapping_factory"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Mapping Factory
</fo:marker><fo:block font-size="20.735999999999997pt">7.5. 
Mapping Factory
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e24864"><!--
MappingFactory
--></fo:wrapper><fo:wrapper id="d0e24867"><!--
mapping metadata
,
loading and storing
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
An important decision in the object-relational mapping process is how and where
to store the data necessary to map your persistent classes to the database
schema.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:basic-link internal-destination="ref_guide_meta_factory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 6.1, “
Metadata Factory
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_meta_factory"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_meta_factory"/>]</fo:inline></fo:basic-link> introduced OpenJPA's <fo:inline font-family="monospace">
MetaDataFactory</fo:inline> interface. OpenJPA uses this same interface to
abstract the storage and retrieval of mapping information. OpenJPA includes the
built-in mapping factories below, and you can create your own factory if you
have custom needs. You control which mapping factory OpenJPA uses with the
<fo:basic-link internal-destination="openjpa.jdbc.MappingFactory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.jdbc.MappingFactory</fo:inline></fo:inline></fo:basic-link> configuration property.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The bundled mapping factories are:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e24889"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e24890"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">-</fo:inline>: Leaving the <fo:inline font-family="monospace"> openjpa.jdbc.MappingFactory
</fo:inline> property unset allows your metadata factory to take over mappings as
well. If you are using the default <fo:inline font-family="monospace">jpa</fo:inline> metadata factory,
OpenJPA will read mapping information from your annotations and
<fo:inline font-family="monospace">orm.xml</fo:inline> when you leave the mapping factory unspecified.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_mapping_factory_jpa"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.13. 
Standard JPA Configuration
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In the standard JPA configuration, the mapping factory is left unset.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e24910">
&lt;property name="openjpa.MetaDataFactory" value="jpa"/&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_mapping_notes_nonstdjoins"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Non-Standard Joins
</fo:marker><fo:block font-size="20.735999999999997pt">7.6. 
Non-Standard Joins
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e24915"><!--
joins
,
non-standard
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The JPA Overview's <fo:basic-link internal-destination="jpa_overview_mapping"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 12, <fo:inline font-style="italic">
Mapping Metadata
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping"/>]</fo:inline></fo:basic-link> explains join
mapping. All of the examples in that document, however, use "standard" joins, in
that there is one foreign key column for each primary key column in the target
table. OpenJPA supports additional join patterns, including partial primary key
joins, non-primary key joins, and joins using constant values.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e24926"><!--
joins
,
partial primary key
--></fo:wrapper>
In a partial primary key join, the source table only has foreign key columns for
a subset of the primary key columns in the target table. So long as this subset
of columns correctly identifies the proper row(s) in the referenced table,
OpenJPA will function properly. There is no special syntax for expressing a
partial primary key join - just do not include column definitions for missing
foreign key columns.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e24934"><!--
joins
,
non-primary key
--></fo:wrapper>
In a non-primary key join, at least one of the target columns is not a primary
key. Once again, OpenJPA supports this join type with the same syntax as a
primary key join. There is one restriction, however: each non-primary key column
you are joining to must be controlled by a field mapping that implements the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/meta/Joinable.html"><fo:inline font-family="monospace">
org.apache.openjpa.jdbc.meta.Joinable</fo:inline></fo:basic-link> interface. All built
in basic mappings implement this interface, including basic fields of embedded
objects. OpenJPA will also respect any custom mappings that implement this
interface. See <fo:basic-link internal-destination="ref_guide_mapping_custom"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.10, “
Custom Mappings
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_custom"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_custom"/>]</fo:inline></fo:basic-link> for an
examination of custom mappings.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e24948"><!--
joins
,
constant
--></fo:wrapper>
Not all joins consist of only links between columns. In some cases you might
have a schema in which one of the join criteria is that a column in the source
or target table must have some constant value. OpenJPA calls joins involving
constant values <fo:inline font-style="italic">constant joins</fo:inline>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To form a constant join in JPA mapping, first set the <fo:inline font-family="monospace">JoinColumn
</fo:inline>'s <fo:inline font-family="monospace">name</fo:inline> attribute to the name of the column. If the
column with the constant value is the target of the join, give its fully
qualified name in the form <fo:inline font-family="monospace">&lt;table name&gt;.&lt;column name&gt;
</fo:inline>. Next, set the <fo:inline font-family="monospace">referencedColumnName</fo:inline> attribute to
the constant value. If the constant value is a string, place it in single quotes
to differentiate it from a column name.
</fo:block><fo:block id="d0e24971"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/joins-constant.png" width="285px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Consider the tables above. First, we want to join row <fo:inline font-family="monospace">T1.R1</fo:inline>
to row <fo:inline font-family="monospace">T2.R1</fo:inline>. If we just join column <fo:inline font-family="monospace">T1.FK</fo:inline>
to <fo:inline font-family="monospace">T2.PK1</fo:inline>, we will wind up matching both <fo:inline font-family="monospace">T2.R1
</fo:inline> and <fo:inline font-family="monospace"> T2.R2</fo:inline>. So in addition to joining <fo:inline font-family="monospace">
T1.FK</fo:inline> to <fo:inline font-family="monospace">T2.PK1</fo:inline>, we also have to specify that
<fo:inline font-family="monospace">T2.PK2</fo:inline> has the value <fo:inline font-family="monospace">a</fo:inline>. Here is how we'd
accomplish this in mapping metadata.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e25007">
@Entity
@Table(name="T1")
public class ... {
@ManyToOne
@JoinColumns({
@JoinColumn(name="FK" referencedColumnName="PK1"),
@JoinColumn(name="T2.PK2" referencedColumnName="'a'")
});
private ...;
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Notice that we had to fully qualify the name of column <fo:inline font-family="monospace">PK2</fo:inline>
because it is in the target table. Also notice that we put single quotes around
the constant value so that it won't be confused with a column name. You do not
need single quotes for numeric constants. For example, the syntax to join
<fo:inline font-family="monospace">T1.R2</fo:inline> to <fo:inline font-family="monospace">T2.R4</fo:inline> is:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e25020">
@Entity
@Table(name="T1")
public class ... {
@ManyToOne
@JoinColumns({
@JoinColumn(name="FK" referencedColumnName="PK2"),
@JoinColumn(name="T2.PK1" referencedColumnName="2")
});
private ...;
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Finally, from the inverse direction, these joins would look like this:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e25024">
@Entity
@Table(name="T2")
public class ... {
@ManyToOne
@JoinColumns({
@JoinColumn(name="T1.FK" referencedColumnName="PK1"),
@JoinColumn(name="PK2" referencedColumnName="'a'")
});
private ...;
@ManyToOne
@JoinColumns({
@JoinColumn(name="T1.FK" referencedColumnName="PK2"),
@JoinColumn(name="PK1" referencedColumnName="2")
});
private ...;
}
</fo:block></fo:block><fo:block id="ref_guide_mapping_jpa"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Additional JPA Mappings
</fo:marker><fo:block font-size="20.735999999999997pt">7.7. 
Additional JPA Mappings
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e25029"><!--
mapping metadata
,
JPA additions
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA supports many persistence strategies beyond those of the JPA
specification. <fo:basic-link internal-destination="ref_guide_meta_jpa"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 6.2, “
Additional JPA Metadata
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_meta_jpa"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_meta_jpa"/>]</fo:inline></fo:basic-link> covered the logical
metadata for OpenJPA's additional persistence strategies. We now demonstrate how
to map entities using these strategies to the database.
</fo:block><fo:block id="ref_guide_mapping_jpa_datastoreid"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Datastore Identity Mapping
</fo:marker><fo:block font-size="17.28pt">7.7.1. 
Datastore Identity Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e25041"><!--
datastore identity
,
mapping
--></fo:wrapper><fo:wrapper id="d0e25046"><!--
mapping metadata
,
datastore identity
--></fo:wrapper><fo:wrapper id="d0e25053"><!--
DataStoreIdColumn
--></fo:wrapper><fo:wrapper id="d0e25058"><!--
primary key
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:basic-link internal-destination="ref_guide_pc_oid"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.3, “
Object Identity
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_oid"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_oid"/>]</fo:inline></fo:basic-link> describes how to use datastore identity
in JPA. OpenJPA requires a single numeric primary key column to hold datastore
identity values. The
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/DataStoreIdColumn.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.DataStoreIdColumn</fo:inline>
</fo:basic-link> annotation customizes the datastore identity column. This annotation
has the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e25071"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25072"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String name</fo:inline>: Defaults to <fo:inline font-family="monospace">ID</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25081"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">int precision</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25087"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String columnDefinition</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25093"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean insertable</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25099"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean updatable</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
All properties correspond exactly to the same-named properties on the standard
<fo:inline font-family="monospace">Column</fo:inline> annotation, described in
<fo:basic-link internal-destination="jpa_overview_mapping_column"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.3, “
Column
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_column"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_column"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_mapping_jpa_datastoreidex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.14. 
Datastore Identity Mapping
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e25115">
import org.apache.openjpa.persistence.*;
import org.apache.openjpa.persistence.jdbc.*;
@Entity
@Table(name="LOGS")
@DataStoreIdColumn(name="ENTRY")
public class LogEntry {
@Lob
private String content;
...
}
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_mapping_jpa_version"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Surrogate Version Mapping
</fo:marker><fo:block font-size="17.28pt">7.7.2. 
Surrogate Version Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e25120"><!--
version
,
mapping
--></fo:wrapper><fo:wrapper id="d0e25125"><!--
mapping metadata
,
version
--></fo:wrapper><fo:wrapper id="d0e25132"><!--
VersionColumn
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA supports version fields as defined by the JPA specification, but allows
you to use a surrogate version column in place of a version field if you like.
You map the surrogate version column with the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/VersionColumn.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.VersionColumn</fo:inline></fo:basic-link>
annotation. You can also use the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/VersionColumns.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.VersionColumns</fo:inline>
</fo:basic-link> annotation to declare an array of <fo:inline font-family="monospace">VersionColumn</fo:inline>
values. Each <fo:inline font-family="monospace">VersionColumn</fo:inline> has the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e25156"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25157"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String name</fo:inline>: Defaults to <fo:inline font-family="monospace">VERSN</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25166"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">int length</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25172"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">int precision</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25178"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">int scale</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25184"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String columnDefinition</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25190"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean nullable</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25196"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean insertable</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25202"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean updatable</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
All properties correspond exactly to the same-named properties on the standard
<fo:inline font-family="monospace">Column</fo:inline> annotation, described in
<fo:basic-link internal-destination="jpa_overview_mapping_column"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.3, “
Column
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_column"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_column"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
By default, OpenJPA assumes that surrogate versioning uses a version number
strategy. You can choose a different strategy with the <fo:inline font-family="monospace">
VersionStrategy</fo:inline> annotation described in
<fo:basic-link internal-destination="version-strategy"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.9.1.4, “
Version Strategy
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="version-strategy"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="version-strategy"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block><fo:block id="ref_guide_mapping_jpa_columns"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Multi-Column Mappings
</fo:marker><fo:block font-size="17.28pt">7.7.3. 
Multi-Column Mappings
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e25225"><!--
mapping metadata
,
column
--></fo:wrapper><fo:wrapper id="d0e25230"><!--
mapping metadata
,
multi-column mappings
--></fo:wrapper><fo:wrapper id="d0e25235"><!--
Columns
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA makes it easy to create multi-column
<fo:basic-link internal-destination="ref_guide_mapping_custom_field"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">custom mappings</fo:inline></fo:basic-link>. The JPA
specification includes a <fo:inline font-family="monospace">Column</fo:inline> annotation, but is
missing a way to declare multiple columns for a single field. OpenJPA remedies
this with the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/Columns.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.Columns</fo:inline></fo:basic-link>
annotation, which contains an array of <fo:inline font-family="monospace">Column</fo:inline> values.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Remember to annotate custom field types with <fo:inline font-family="monospace">Persistent</fo:inline>,
as described in <fo:basic-link internal-destination="ref_guide_meta_jpa_persistent"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 6.2.3, “
Persistent Field Values
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_meta_jpa_persistent"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_meta_jpa_persistent"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block><fo:block id="ref_guide_mapping_jpa_fieldjoin"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Join Column Attribute Targets
</fo:marker><fo:block font-size="17.28pt">7.7.4. 
Join Column Attribute Targets
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:basic-link internal-destination="jpa_overview_mapping_rel"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.8.4, “
Direct Relations
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_rel"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_rel"/>]</fo:inline></fo:basic-link> in the JPA Overview introduced
you to the <fo:inline font-family="monospace">JoinColumn</fo:inline> annotation. A <fo:inline font-family="monospace">
JoinColumn</fo:inline>'s <fo:inline font-family="monospace"> referencedColumnName</fo:inline> property
declares which column in the table of the related type this join column links
to. Suppose, however, that the related type is unmapped, or that it is part of a
table-per-class inheritance hierarchy. Each subclass that might be assigned to
the field could reside in a different table, and could use entirely different
names for its primary key columns. It becomes impossible to supply a single
<fo:inline font-family="monospace">referencedColumnName</fo:inline> that works for all subclasses.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA rectifies this by allowing you to declare which <fo:inline font-style="italic">attribute
</fo:inline> in the related type each join column links to, rather than which
column. If the attribute is mapped differently in various subclass tables,
OpenJPA automatically forms the proper join for the subclass record at hand. The
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/XJoinColumn.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.XJoinColumn</fo:inline></fo:basic-link>
annotation has all the same properties as the standard <fo:inline font-family="monospace">JoinColumn
</fo:inline> annotation, but adds an additional <fo:inline font-family="monospace">
referencedAttributeName</fo:inline> property for this purpose. Simply use a
<fo:inline font-family="monospace">XJoinColumn</fo:inline> in place of a <fo:inline font-family="monospace">JoinColumn
</fo:inline> whenever you need to access this added functionality.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
For compound keys, use the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/XJoinColumns.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.XJoinColumns</fo:inline></fo:basic-link>
annotation. The value of this annotation is an array of individual <fo:inline font-family="monospace">
XJoinColumn</fo:inline>s.
</fo:block></fo:block><fo:block id="ref_guide_mapping_jpa_embed"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Embedded Mapping
</fo:marker><fo:block font-size="17.28pt">7.7.5. 
Embedded Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
JPA uses the <fo:inline font-family="monospace">AttributeOverride</fo:inline> annotation to override the
default mappings of an embeddable class. The JPA Overview details this process
in <fo:basic-link internal-destination="jpa_overview_mapping_embed"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.8.3, “
Embedded Mapping
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_embed"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_embed"/>]</fo:inline></fo:basic-link>. <fo:inline font-family="monospace">
AttributeOverride</fo:inline>s suffice for simple mappings, but do not allow
you to override complex mappings. Also, JPA has no way to differentitate between
a null embedded object and one with default values for all of its fields.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA overcomes these shortcomings with the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/EmbeddedMapping.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.EmbeddedMapping</fo:inline>
</fo:basic-link> annotation. This annotation has the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e25335"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25336"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String nullIndicatorColumnName</fo:inline>: If the named column's value
is <fo:inline font-family="monospace">NULL</fo:inline>, then the embedded object is assumed to be null. If
the named column has a non- <fo:inline font-family="monospace">NULL</fo:inline> value, then the embedded
object will get loaded and populated with data from the other embedded fields.
This property is entirely optional. By default, OpenJPA always assumes the
embedded object is non-null, just as in standard JPA mapping.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If the column you name does not belong to any fields of the embedded object,
OpenJPA will create a synthetic null-indicator column with this name. In fact,
you can specify a value of <fo:inline font-family="monospace">true</fo:inline> to simply indicate that you
want a synthetic null-indicator column, without having to come up with a name
for it. A value of <fo:inline font-family="monospace">false</fo:inline> signals that you explicitly do not
want a null-indicator column created for this mapping (in case you have
configured your <fo:basic-link internal-destination="ref_guide_mapping_defaults"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">mapping defaults
</fo:inline></fo:basic-link> to create one by default).
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25359"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String nullIndicatorFieldName</fo:inline>: Rather than name a null
indicator column, you can name a field of the embedded type. OpenJPA will use
the column of this field as the null-indicator column.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25365"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">MappingOverride[] overrides</fo:inline>: This array allows you to
override any mapping of the embedded object.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">EmbeddedMapping</fo:inline>'s <fo:inline font-family="monospace">overrides</fo:inline> array
serves the same purpose as standard JPA's <fo:inline font-family="monospace">AttributeOverride
</fo:inline>s and <fo:inline font-family="monospace">AssociationOverride</fo:inline> s. In fact, you can
also use the <fo:inline font-family="monospace">MappingOverride</fo:inline> annotation on an entity
class to override a complex mapping of its mapped superclass, just as you can
with <fo:inline font-family="monospace"> AttributeOverride</fo:inline> and <fo:inline font-family="monospace">
AssociationOverride</fo:inline> s. The <fo:inline font-family="monospace">MappingOverrides</fo:inline>
annotation, whose value is an array of <fo:inline font-family="monospace">MappingOverride</fo:inline> s,
allows you to overide multiple mapped superclass mappings.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Each
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/MappingOverride.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.MappingOverride</fo:inline>
</fo:basic-link> annotation has the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e25408"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25409"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String name</fo:inline>: The name of the field that is being overridden.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25415"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Column[] columns</fo:inline>: Columns for the new field mapping.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25421"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">XJoinColumn[] joinColumns</fo:inline>: Join columns for the new field
mapping, if it is a relation field.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25427"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">ContainerTable containerTable</fo:inline>: Table for the new collection
or map field mapping. We cover collection mappings in
<fo:basic-link internal-destination="ref_guide_mapping_jpa_coll"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.7.6, “
Collections
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_jpa_coll"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_jpa_coll"/>]</fo:inline></fo:basic-link>, and map mappings in
<fo:basic-link internal-destination="ref_guide_mapping_jpa_map"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.7.8, “
Maps
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_jpa_map"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_jpa_map"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25437"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">ElementJoinColumn[] elementJoinColumns</fo:inline>: Element join columns
for the new collection or map field mapping. You will see how to use element
join columns in <fo:basic-link internal-destination="ref_guide_mapping_jpa_coll_joincols"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.7.6.2, “
Element Join Columns
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_jpa_coll_joincols"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_jpa_coll_joincols"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following example defines an embeddable <fo:inline font-family="monospace"> PathCoordinate
</fo:inline> class with a custom mapping of a <fo:inline font-family="monospace">java.awt.Point
</fo:inline> field to two columns. It then defines an entity which embeds a
<fo:inline font-family="monospace"> PointCoordinate</fo:inline> and overrides the default mapping for
the point field. The entity also declares that if the <fo:inline font-family="monospace">PathCoordinate
</fo:inline>'s <fo:inline font-family="monospace">siteName</fo:inline> field column is null, it means that
no <fo:inline font-family="monospace">PathCoordinate</fo:inline> is stored in the embedded record; the
owning field will load as null.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_mapping_jpa_embedex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.15. 
Overriding Complex Mappings
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e25468">
import org.apache.openjpa.persistence.jdbc.*;
@Embeddable
public class PathCoordinate {
private String siteName;
@Persistent
@Strategy("com.xyz.openjpa.PointValueHandler")
private Point point;
...
}
@Entity
public class Path {
@Embedded
@EmbeddedMapping(nullIndicatorFieldName="siteName", overrides={
@MappingOverride(name="siteName", columns=@Column(name="START_SITE")),
@MappingOverride(name="point", columns={
@Column(name="START_X"),
@Column(name="START_Y")
})
})
private PathCoordinate start;
...
}
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_mapping_jpa_coll"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Collections
</fo:marker><fo:block font-size="17.28pt">7.7.6. 
Collections
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e25473"><!--
mapping metadata
,
collections
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In <fo:basic-link internal-destination="ref_guide_meta_jpa_persistent_coll"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 6.2.4, “Persistent Collection Fields”</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_meta_jpa_persistent_coll"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_meta_jpa_persistent_coll"/>]</fo:inline></fo:basic-link>, we explored the
<fo:inline font-family="monospace">PersistentCollection</fo:inline> annotation for persistent collection
fields that aren't a standard <fo:inline font-family="monospace">OneToMany</fo:inline> or <fo:inline font-family="monospace">
ManyToMany</fo:inline> relation. To map these non-standard collections, combine
OpenJPA's <fo:inline font-family="monospace">ContainerTable</fo:inline> annotation with
<fo:inline font-family="monospace">ElementJoinColumn</fo:inline>s.
We explore the annotations below.
</fo:block><fo:block id="ref_guide_mapping_jpa_coll_table"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">7.7.6.1. 
Container Table
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e25500"><!--
ContainerTable
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/ContainerTable.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.ContainerTable</fo:inline>
</fo:basic-link> annotation describes a database table that holds collection (or map)
elements. This annotation has the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e25513"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25514"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String name</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25520"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String catalog</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25526"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String schema</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25532"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">XJoinColumn[] joinColumns</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25538"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">ForeignKey joinForeignKey</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25544"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Index joinIndex</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">name</fo:inline>, <fo:inline font-family="monospace">catalog</fo:inline>, <fo:inline font-family="monospace">schema
</fo:inline>, and <fo:inline font-family="monospace">joinColumns</fo:inline> properties describe the container
table and how it joins to the owning entity's table. These properties correspond
to the same-named properties on the standard <fo:inline font-family="monospace"> JoinTable</fo:inline>
annotation, described in <fo:basic-link internal-destination="jpa_overview_mapping_assoccoll"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.8.5, “
Join Table
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_assoccoll"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_assoccoll"/>]</fo:inline></fo:basic-link>
. If left unspecified, the name of the table defaults to the first five
characters of the entity table name, plus an underscore, plus the field name.
The <fo:inline font-family="monospace">joinForeignKey</fo:inline> and <fo:inline font-family="monospace"> joinIndex</fo:inline>
properties override default foreign key and index generation for the join
columns. We explore foreign keys and indexes later in this chapter.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You may notice that the container table does not define how to store the
collection elements. That is left to separate annotations, which are the subject
of the next sections.
</fo:block></fo:block><fo:block id="ref_guide_mapping_jpa_coll_joincols"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">7.7.6.2. 
Element Join Columns
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e25580"><!--
ElementJoinColumn
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Element join columns are equivalent to standard JPA join columns, except that
they represent a join to a collection or map element entity rather than a direct
relation. You represent an element join column with OpenJPA's
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/ElementJoinColumn.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.ElementJoinColumn</fo:inline>
</fo:basic-link> annotation. To declare a compound join, enclose an array of <fo:inline font-family="monospace">
ElementJoinColumn</fo:inline>s in the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/ElementJoinColumns.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.ElementJoinColumns</fo:inline>
</fo:basic-link> annotation.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
An <fo:inline font-family="monospace">ElementJoinColumn</fo:inline> always resides in a container table,
so it does not have the <fo:inline font-family="monospace"> table</fo:inline> property of a standard
<fo:inline font-family="monospace"> JoinColumn</fo:inline>. Like <fo:inline font-family="monospace"> XJoinColumn</fo:inline>s
above, <fo:inline font-family="monospace"> ElementJoinColumn</fo:inline>s can reference a linked
attribute rather than a static linked column. Otherwise, the <fo:inline font-family="monospace">
ElementJoinColumn</fo:inline> and standard <fo:inline font-family="monospace">JoinColumn</fo:inline>
annotations are equivalent. See <fo:basic-link internal-destination="jpa_overview_mapping_rel"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.8.4, “
Direct Relations
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_rel"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_rel"/>]</fo:inline></fo:basic-link>
in the JPA Overview for a review of the <fo:inline font-family="monospace">JoinColumn</fo:inline>
annotation.
</fo:block></fo:block><fo:block id="ref_guide_mapping_jpa_coll_order"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">7.7.6.3. 
Order Column
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e25633"><!--
OrderColumn
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Relational databases do not guarantee that records are returned in insertion
order. If you want to make sure that your collection elements are loaded in the
same order they were in when last stored, you must declare an order column.
OpenJPA's
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/OrderColumn">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.OrderColumn</fo:inline></fo:basic-link>
annotation has the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e25645"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25646"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String name</fo:inline>: Defaults to <fo:inline font-family="monospace">ORDR</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25655"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean enabled</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25661"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">int precision</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25667"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String columnDefinition</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25673"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean insertable</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25679"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean updatable</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Order columns are always in the container table. You can explicitly turn off
ordering (if you have enabled it by default via your
<fo:basic-link internal-destination="ref_guide_mapping_defaults"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"> mapping defaults</fo:inline></fo:basic-link>) by setting
the <fo:inline font-family="monospace">enabled</fo:inline> property to <fo:inline font-family="monospace">false</fo:inline>. All other
properties correspond exactly to the same-named properties on the standard
<fo:inline font-family="monospace">Column</fo:inline> annotation, described in
<fo:basic-link internal-destination="jpa_overview_mapping_column"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.3, “
Column
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_column"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_column"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:block><fo:block id="ref_guide_mapping_jpa_onemany"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
One-Sided One-Many Mapping
</fo:marker><fo:block font-size="17.28pt">7.7.7. 
One-Sided One-Many Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e25704"><!--
mapping metadata
,
collections
,
JPA one-sided one-many
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The previous section covered the use of <fo:inline font-family="monospace">ElementJoinColumn</fo:inline>
annotations in conjunction with a <fo:inline font-family="monospace">ContainerTable</fo:inline> for
mapping collections to dedicate tables. <fo:inline font-family="monospace">ElementJoinColumn</fo:inline>
s, however, have one additional use: to create a one-sided one-many mapping.
Standard JPA supports <fo:inline font-family="monospace">OneToMany</fo:inline> fields without a
<fo:inline font-family="monospace">mappedBy</fo:inline> inverse, but only by mapping these fields to a
<fo:inline font-family="monospace">JoinTable</fo:inline> (see
<fo:basic-link internal-destination="jpa_overview_mapping_assoccoll"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.8.5, “
Join Table
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_assoccoll"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_assoccoll"/>]</fo:inline></fo:basic-link> in the JPA Overview for
details). Often, you'd like to create a one-many association based on an inverse
foreign key (logical or actual) in the table of the related type.
</fo:block><fo:block id="d0e25733"><fo:external-graphic src="/Users/mprudhom/java/src/openjpa-1.0.0/1.0.0/openjpa-project/src/doc/manual/img/inv-key-coll.png" width="261px" height="auto" content-width="scale-to-fit" content-height="scale-to-fit"/></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Consider the model above. <fo:inline font-family="monospace">Subscription</fo:inline> has a collection
of <fo:inline font-family="monospace">LineItem</fo:inline> s, but <fo:inline font-family="monospace">LineItem</fo:inline> has
no inverse relation to <fo:inline font-family="monospace">Subscription</fo:inline>. To retrieve all of
the <fo:inline font-family="monospace">LineItem</fo:inline> records for a <fo:inline font-family="monospace">Subscription
</fo:inline>, we join the <fo:inline font-family="monospace">SUB_ID</fo:inline> inverse foreign key column
in the <fo:inline font-family="monospace">LINE_ITEM</fo:inline> table to the primary key column of the
<fo:inline font-family="monospace">SUB</fo:inline> table. The example below shows how to represent this
model in mapping annotations. Note that OpenJPA automatically assumes an inverse
foreign key mapping when element join columns are given, but no container or
join table is given.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_mapping_jpa_onemanyex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.16. 
One-Sided One-Many Mapping
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e25769">
package org.mag.subscribe;
import org.apache.openjpa.persistence.jdbc.*;
@Entity
@Table(name="LINE_ITEM", schema="CNTRCT")
public class LineItem {
...
}
@Entity
@Table(name="SUB", schema="CNTRCT")
public class Subscription {
@Id private long id;
@OneToMany
@ElementJoinColumn(name="SUB_ID", target="ID")
private Collection&lt;LineItem&gt; items;
...
}
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_mapping_jpa_map"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Maps
</fo:marker><fo:block font-size="17.28pt">7.7.8. 
Maps
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e25774"><!--
mapping metadata
,
maps
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
We detailed the <fo:inline font-family="monospace">ContainerTable</fo:inline> annotation in
<fo:basic-link internal-destination="ref_guide_mapping_jpa_coll_table"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.7.6.1, “
Container Table
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_jpa_coll_table"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_jpa_coll_table"/>]</fo:inline></fo:basic-link>. Custom map mappings may
also use this annotation to represent a map table.
</fo:block></fo:block><fo:block id="ref_guide_mapping_jpa_constraints"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Indexes and Constraints
</fo:marker><fo:block font-size="17.28pt">7.7.9. 
Indexes and Constraints
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA uses index information during schema generation to index the proper
columns. OpenJPA uses foreign key and unique constraint information during
schema creation to generate the proper database constraints, and also at runtime
to order SQL statements to avoid constraint violations while maximizing SQL
batch size.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA assumes certain columns have indexes or constraints based on your
mapping defaults, as detailed in <fo:basic-link internal-destination="ref_guide_mapping_defaults"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.4, “
Mapping Defaults
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_defaults"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_defaults"/>]</fo:inline></fo:basic-link>.
You can override the configured defaults on individual joins, field
values, collection elements, map keys, or map values using the annotations
presented in the following sections.
</fo:block><fo:block id="ref_guide_mapping_jpa_index"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">7.7.9.1. 
Indexes
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e25798"><!--
mapping metadata
,
indexes
--></fo:wrapper><fo:wrapper id="d0e25803"><!--
indexes
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/Index.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.Index</fo:inline></fo:basic-link>
annotation represents an index on the columns of a field. It is also used within
the <fo:basic-link internal-destination="ref_guide_mapping_jpa_coll_table"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">ContainerTable
</fo:inline></fo:inline></fo:basic-link> annotation to index join columns.
To index the columns of a collection element, use the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/ElementIndex.html">
<fo:inline font-family="monospace"> org.apache.openjpa.persistence.jdbc.ElementIndex</fo:inline></fo:basic-link>
annotation. These annotations have the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e25822"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25823"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean enabled</fo:inline>: Set this property to <fo:inline font-family="monospace">false
</fo:inline> to explicitly tell OpenJPA not to index these columns, when OpenJPA
would otherwise do so.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25832"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String name</fo:inline>: The name of the index. OpenJPA will choose a
name if you do not provide one.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25838"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean unique</fo:inline>: Whether to create a unique index. Defaults
to false.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="ref_guide_mapping_jpa_fk"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">7.7.9.2. 
Foreign Keys
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e25847"><!--
mapping metadata
,
foreign keys
--></fo:wrapper><fo:wrapper id="d0e25852"><!--
foreign keys
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/ForeignKey.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.ForeignKey</fo:inline></fo:basic-link>
annotation represents a foreign key on the columns of a field. It is also used
within the <fo:basic-link internal-destination="ref_guide_mapping_jpa_coll_table"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
ContainerTable</fo:inline></fo:inline></fo:basic-link> annotation to set a database foreign key on
join columns. To set a constraint to the columns of a collection element, use
the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/ElementForeignKey.html">
<fo:inline font-family="monospace"> org.apache.openjpa.persistence.jdbc.ElementForeignKey</fo:inline>
</fo:basic-link> annotation. These annotations have the following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e25872"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25873"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean enabled</fo:inline>: Set this property to <fo:inline font-family="monospace">false
</fo:inline> to explicitly tell OpenJPA not to set a foreign key on these columns,
when OpenJPA would otherwise do so.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25882"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String name</fo:inline>: The name of the foreign key. OpenJPA will
choose a name if you do not provide one, or will create an anonymous key.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25888"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean deferred</fo:inline>: Whether to create a deferred key if
supported by the database.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25894"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">ForeignKeyAction deleteAction</fo:inline>: Value from the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/ForeignKeyAction.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.ForeignKeyAction</fo:inline>
</fo:basic-link> enum identifying the desired delete action. Defaults to <fo:inline font-family="monospace">
RESTRICT</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25909"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">ForeignKeyAction updateAction</fo:inline>: Value from the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/ForeignKeyAction.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.ForeignKeyAction</fo:inline>
</fo:basic-link> enum identifying the desired update action. Defaults to <fo:inline font-family="monospace">
RESTRICT</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Keep in mind that OpenJPA uses foreign key information at runtime to avoid
constraint violations; it is important, therefore, that your
<fo:basic-link internal-destination="ref_guide_mapping_defaults"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">mapping defaults</fo:inline></fo:basic-link> and foreign
key annotations combine to accurately reflect your existing database
constraints, or that you configure OpenJPA to reflect on your database schema
to discover existing foreign keys (see
<fo:basic-link internal-destination="ref_guide_schema_info_factory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.11.2, “
Schema Factory
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_schema_info_factory"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_schema_info_factory"/>]</fo:inline></fo:basic-link>).
</fo:block></fo:block><fo:block id="ref_guide_mapping_jpa_unique"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">7.7.9.3. 
Unique Constraints
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e25934"><!--
mapping metadata
,
unique constraints
--></fo:wrapper><fo:wrapper id="d0e25939"><!--
unique constraints
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/Unique.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.Unique</fo:inline></fo:basic-link>
annotation represents a unqiue constraint on the columns of a field. It is more
convenient than using the <fo:inline font-family="monospace">uniqueConstraints</fo:inline> property of
standard JPA <fo:inline font-family="monospace">Table</fo:inline> and <fo:inline font-family="monospace">SecondaryTable
</fo:inline> annotations, because you can apply it directly to the constrained
field. The <fo:inline font-family="monospace">Unique</fo:inline> annotation has the following
properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e25961"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25962"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean enabled</fo:inline>: Set this property to <fo:inline font-family="monospace">false
</fo:inline> to explicitly tell OpenJPA not to constrain these columns, when
OpenJPA would otherwise do so.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25971"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">String name</fo:inline>: The name of the constraint. OpenJPA will choose
a name if you do not provide one, or will create an anonymous constraint.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e25977"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">boolean deferred</fo:inline>: Whether to create a deferred constraint if
supported by the database.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="ref_guide_xmlmapping"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
XML Column Mapping
</fo:marker><fo:block font-size="17.28pt">7.7.10. 
XML Column Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e25986"><!--
mapping metadata
,
xml column mapping
--></fo:wrapper><fo:wrapper id="d0e25991"><!--
xml mapping column
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
DB2, Oracle and SQLServer support XML column types and
XPath queries and indexes over these columns.OpenJPA supports mapping of an
entity property mapped to an XML column.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Annotate the entity property using the XMLValueHandler strategy:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e25998">
@Persistent
@Strategy("org.apache.openjpa.jdbc.meta.strats.XMLValueHandler")
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The default fetch type is EAGER but can be changed to LAZY by using:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e26002">
@Persistence(fetch=FetchType.LAZY)
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The entity property class is required to have
jaxb binding annotations. This is produced when the classes are generated
from an xml schema using the jaxb generator XJC.Ensure that <fo:inline font-family="monospace">@XmlRootElement</fo:inline>
appears in the root class. In some case this annotation needs to be added manually if it is missing.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The jaxb jar files must be on the application classpath (jaxb-api.jar,
jaxb-impl.jar, jsr173_1.0_api.jar or equivalent).
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
EJB Query path expressions can navigate into the mapped class and its
subfields to any level.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The path expression is rewritten into an equivalent XPATH expression using SQL
XML functions.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The path expression must be single valued.Path expressions over xml
mapped classes can only be used in WHERE as an operand to a simple predicate
(= &lt;&gt; &lt; &gt; &gt;= &lt;=).
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Path expressions over XML mapped fields can not be:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e26019"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26020"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
an input to a EJB query scalar function
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26023"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
an operand of BETWEEN, IS NULL, LIKE or IN predicate
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26026"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
used to project out subfields in the SELECT clause
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26029"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
used in the FROM , GROUP BY, HAVING, ORDER BY clauses
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
XML schema must not contain namespace declarations. The EJB query path
expressions can not refer to java fields generated from XML ANY type or
XML mixed element types.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The datatype generated by JAXB must be a valid EJB query type
to use the property in an EJB query predicate.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Shown below is a sample XML schema <fo:basic-link internal-destination="ref_guide_xmlmapping_myaddress"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">myaddress.xsd</fo:inline></fo:basic-link>,
in which the JPA entity Order has <fo:inline font-family="monospace">&lt;shipAddress&gt;</fo:inline> persistent field that maps to an XML column.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_xmlmapping_myaddress"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.17. 
myaddress.xsd
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e26047">
&lt;?xml version="1.0" ?&gt;
&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" &gt;
&lt;xs:complexType name="Address"&gt;
&lt;xs:sequence&gt;
&lt;xs:element name="Name" type="xs:string" /&gt;
&lt;xs:element name="Street" type="xs:string"
minOccurs="1" maxOccurs="3" /&gt;
&lt;xs:element name="City" type="xs:string" /&gt;
&lt;/xs:sequence&gt;
&lt;/xs:complexType&gt;
&lt;xs:complexType name="CAN_Address"&gt;
&lt;xs:complexContent&gt;
&lt;xs:extension base="Address"&gt;
&lt;xs:sequence&gt;
&lt;xs:element name="Province" type="xs:string" /&gt;
&lt;xs:element name="PostalCode" type="xs:string" /&gt;
&lt;/xs:sequence&gt;
&lt;/xs:extension&gt;
&lt;/xs:complexContent&gt;
&lt;/xs:complexType&gt;
&lt;xs:simpleType name="USPS_ZIP"&gt;
&lt;xs:restriction base="xs:integer"&gt;
&lt;xs:minInclusive value="01000" /&gt;
&lt;xs:maxInclusive value="99999" /&gt;
&lt;/xs:restriction&gt;
&lt;/xs:simpleType&gt;
&lt;xs:complexType name="USA_Address"&gt;
&lt;xs:complexContent&gt;
&lt;xs:extension base="Address"&gt;
&lt;xs:sequence&gt;
&lt;xs:element name="State" type="xs:string" /&gt;
&lt;xs:element name="ZIP" type="USPS_ZIP" /&gt;
&lt;/xs:sequence&gt;
&lt;/xs:extension&gt;
&lt;/xs:complexContent&gt;
&lt;/xs:complexType&gt;
&lt;xs:element name="MailAddress" type="Address" /&gt;
&lt;xs:element name="AddrCAN" type="CAN_Address"
substitutionGroup="MailAddress" /&gt;
&lt;xs:element name="AddrUSA" type="USA_Address"
substitutionGroup="MailAddress" /&gt;
&lt;/xs:schema&gt;
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Java classes <fo:basic-link internal-destination="ref_guide_xmlmapping_address"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Address</fo:inline></fo:basic-link>,
<fo:basic-link internal-destination="ref_guide_xmlmapping_usaaddress"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">USAAddress</fo:inline></fo:basic-link> and
<fo:basic-link internal-destination="ref_guide_xmlmapping_canaddress"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">CANAddress</fo:inline></fo:basic-link>
are produced using jaxb XJC generator from myaddress schema.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_xmlmapping_address"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.18. 
Address.Java
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e26063">
...
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Address", propOrder = {
"name",
"street",
"city"
})
public class Address {
@XmlElement(name = "Name", required = true)
protected String name;
@XmlElement(name = "Street", required = true)
protected List&lt;String&gt; street;
@XmlElement(name = "City", required = true)
protected String city;
/**
* Getter and Setter methods.
*
*/
...
}
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_xmlmapping_usaaddress"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.19. 
USAAddress.java
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e26068">
...
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "USA_Address", propOrder = {
"state",
"zip"
})
public class USAAddress
extends Address
{
@XmlElement(name = "State")
protected String state;
@XmlElement(name = "ZIP")
protected int zip;
/**
* Getter and Setter methods.
*
*/
...
}
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_xmlmapping_canaddress"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.20. 
CANAddress.java
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e26073">
...
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CAN_Address", propOrder = {
"province",
"postalCode"
})
public class CANAddress
extends Address
{
@XmlElement(name = "Province")
protected String province;
@XmlElement(name = "PostalCode")
protected String postalCode;
/**
* Getter and Setter methods.
*
*/
...
}
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_xmlmapping_annorder"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.21. 
Showing annotated Order entity with XML mapping strategy
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e26078">
@Entity
public class Order {
@Id private into id;
@Persistent
@Strategy ("org.apache.openjpa.jdbc.meta.strats.XMLValueHandler")
private Address shipAddress;
...
}
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_xmlmapping_createorder"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.22. 
Showing creation of Order Entity having shipAddress mapped to XML column
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e26083">
...
myaddress.ObjectFactory addressFactory = new myaddress.ObjectFactory();
Customer c1 = new Customer();
c1.setCid( new Customer.CustomerKey("USA", 1) );
c1.setName("Harry's Auto");
Order o1 = new Order( 850, false, c1);
USAAddress addr1 = addressFactory.createUSAAddress();
addr1.setCity("San Jose");
addr1.setState("CA");
addr1.setZIP(new Integer("95141"));
addr1.getStreet().add("12500 Monterey");
addr1.setName( c1.getName());
o1.setShipAddress(addr1);
em.persist(o1);
...
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_xmlmapping_ejbquery"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.23. 
Sample EJB Queries for XML Column mapping
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e26088">
. select o from Order o where o.shipAddress.city = "San Jose" or
o.shipAddress.city = "San Francisco" (OK)
. select o.shipaAddress from Order o (OK)
. select o.shipAddress.city from Order o (INVALID)
. select o from Order o where o.shipAddress.street = "San Jose" (INVALID multi valued)
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_mapping_limits"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Mapping Limitations
</fo:marker><fo:block font-size="20.735999999999997pt">7.8. 
Mapping Limitations
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e26093"><!--
mapping metadata
,
limitations
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following sections outline the limitations OpenJPA places on specific
mapping strategies.
</fo:block><fo:block id="ref_guide_mapping_limits_tpc"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Table Per Class
</fo:marker><fo:block font-size="17.28pt">7.8.1. 
Table Per Class
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e26103"><!--
mapping metadata
,
limitations
,
table-per-class
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Table-per-class inheritance mapping has the following limitations:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e26112"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26113"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
You cannot traverse polymorphic relations to non-leaf classes in a
table-per-class inheritance hierarchy in queries.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26116"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
You cannot map a one-sided polymorphic relation to a non-leaf class in a
table-per-class inheritance hierarchy using an inverse foreign key.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26119"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
You cannot use an order column in a polymorphic relation to a non-leaf class in
a table-per-class inheritance hierarchy mapped with an inverse foreign key.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26122"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Table-per-class hierarchies impose limitations on eager fetching. See
<fo:basic-link internal-destination="ref_guide_perfpack_eager_consider"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.7.2, “
Eager Fetching Considerations and Limitations
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_perfpack_eager_consider"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_perfpack_eager_consider"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e26127"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Non-polymorphic relations do not suffer from these limitations. You can declare
a non-polymorphic relation using the extensions described in
<fo:basic-link internal-destination="nonpolymorphic"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.9.2.2, “
Nonpolymorphic
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="nonpolymorphic"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="nonpolymorphic"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_mapping_ext"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Mapping Extensions
</fo:marker><fo:block font-size="20.735999999999997pt">7.9. 
Mapping Extensions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Mapping extensions allow you to access OpenJPA-specific functionality from your
mappings. Note that all extensions below are specific to mappings. If you store
your mappings separately from your persistence metadata, these extensions must
be specified along with the mapping information, not the persistence metadata
information.
</fo:block><fo:block id="ref_guide_mapping_ext_cls"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Class Extensions
</fo:marker><fo:block font-size="17.28pt">7.9.1. 
Class Extensions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA recognizes the following class extensions.
</fo:block><fo:block id="subclass-fetch-mode"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">7.9.1.1. 
Subclass Fetch Mode
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e26145"><!--
mapping metadata
,
extensions
,
subclass fetch mode
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This extension specifies how to eagerly fetch subclass state. It overrides the
global <fo:basic-link internal-destination="openjpa.jdbc.SubclassFetchMode"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.jdbc.SubclassFetchMode</fo:inline></fo:inline></fo:basic-link> property. Set the JPA
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/SubclassFetchMode.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.SubclassFetchMode</fo:inline>
</fo:basic-link> annotation to a value from the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/EagerFetchType.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.EagerFetchType</fo:inline>
</fo:basic-link> enum: <fo:inline font-family="monospace">JOIN</fo:inline>, <fo:inline font-family="monospace">PARALLEL</fo:inline>, or
<fo:inline font-family="monospace">NONE</fo:inline>. See <fo:basic-link internal-destination="ref_guide_perfpack_eager"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.7, “
Eager Fetching
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_perfpack_eager"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_perfpack_eager"/>]</fo:inline></fo:basic-link>
for a discussion of eager fetching.
</fo:block></fo:block><fo:block id="class-strategy"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">7.9.1.2. 
Strategy
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e26186"><!--
mapping metadata
,
extensions
,
strategy
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/Strategy.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.Strategy</fo:inline></fo:basic-link>
class annotation allows you to specify a custom mapping strategy for your class.
See <fo:basic-link internal-destination="ref_guide_mapping_custom"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.10, “
Custom Mappings
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_custom"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_custom"/>]</fo:inline></fo:basic-link> for information on custom
mappings.
</fo:block></fo:block><fo:block id="discriminator-strategy"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">7.9.1.3. 
Discriminator Strategy
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e26207"><!--
mapping metadata
,
extensions
,
discriminator strategy
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/DiscriminatorStrategy.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.DiscriminatorStrategy</fo:inline>
</fo:basic-link> class annotation allows you to specify a custom discriminator strategy.
See <fo:basic-link internal-destination="ref_guide_mapping_custom"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.10, “
Custom Mappings
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_custom"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_custom"/>]</fo:inline></fo:basic-link> for information on custom
mappings.
</fo:block></fo:block><fo:block id="version-strategy"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">7.9.1.4. 
Version Strategy
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e26229"><!--
mapping metadata
,
extensions
,
version strategy
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/VersionStrategy.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.VersionStrategy</fo:inline>
</fo:basic-link> class annotation allows you to specify a custom version strategy. See
<fo:basic-link internal-destination="ref_guide_mapping_custom"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.10, “
Custom Mappings
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_custom"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_custom"/>]</fo:inline></fo:basic-link> for information on custom
mappings.
</fo:block></fo:block></fo:block><fo:block id="ref_guide_mapping_ext_field"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Field Extensions
</fo:marker><fo:block font-size="17.28pt">7.9.2. 
Field Extensions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA recognizes the following field extensions.
</fo:block><fo:block id="eager-fetch-mode"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">7.9.2.1. 
Eager Fetch Mode
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e26256"><!--
mapping metadata
,
extensions
,
eager fetch mode
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This extension specifies how to eagerly fetch related objects. It overrides the
global <fo:basic-link internal-destination="openjpa.jdbc.EagerFetchMode"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.jdbc.EagerFetchMode</fo:inline></fo:inline></fo:basic-link> property. Set the JPA
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/EagerFetchMode.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.EagerFetchMode</fo:inline>
</fo:basic-link> annotation to a value from the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/EagerFetchType.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.EagerFetchType</fo:inline>
</fo:basic-link> enum: <fo:inline font-family="monospace">JOIN</fo:inline>, <fo:inline font-family="monospace">PARALLEL</fo:inline>, or
<fo:inline font-family="monospace">NONE</fo:inline>. See <fo:basic-link internal-destination="ref_guide_perfpack_eager"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.7, “
Eager Fetching
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_perfpack_eager"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_perfpack_eager"/>]</fo:inline></fo:basic-link>
for a discussion of eager fetching.
</fo:block></fo:block><fo:block id="nonpolymorphic"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">7.9.2.2. 
Nonpolymorphic
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e26297"><!--
mapping metadata
,
extensions
,
nonpolymorphic
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
All fields in Java are polymorphic. If you declare a field of type <fo:inline font-family="monospace">T
</fo:inline>, you can assign any subclass of <fo:inline font-family="monospace">T</fo:inline> to the field as
well. This is very convenient, but can make relation traversal very inefficient
under some inheritance strategies. It can even make querying across the field
impossible. Often, you know that certain fields do not need to be entirely
polymorphic. By telling OpenJPA about such fields, you can improve the
efficiency of your relations.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e26312"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA also includes the <fo:inline font-family="monospace">type</fo:inline> metadata extension for
narrowing the declared type of a field. See <fo:basic-link internal-destination="type"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 6.3.2.6, “
Type
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="type"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="type"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA defines the following extensions for nonpolymorphic values:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e26322"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26323"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/Nonpolymorphic.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.Nonpolymorphic</fo:inline>
</fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26332"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/ElementNonpolymorphic.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.ElementNonpolymorphic</fo:inline>
</fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The value of these extensions is a constant from the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/NonpolymorphicType.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.NonpolymorphicType</fo:inline>
</fo:basic-link> enumeration. The default value, <fo:inline font-family="monospace">EXACT</fo:inline>, indicates
that the relation will always be of the exact declared type. A value of
<fo:inline font-family="monospace">JOINABLE</fo:inline>, on the other hand, means that the relation might
be to any joinable subclass of the declared type. This value only excludes
table-per-class subclasses.
</fo:block></fo:block><fo:block id="class-criteria"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">7.9.2.3. 
Class Criteria
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e26358"><!--
mapping metadata
,
extensions
,
class criteria
--></fo:wrapper><fo:wrapper id="d0e26367"><!--
joins
,
class criteria
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This family of boolean extensions determines whether OpenJPA will use the
expected class of related objects as criteria in the SQL it issues to load a
relation field. Typically, this is not needed. The foreign key values uniquely
identify the record for the related object. Under some rare mappings, however,
you may need to consider both foreign key values and the expected class of the
related object - for example, if you have an inverse relation that shares the
foreign key with another inverse relation to an object of a different subclass.
In these cases, set the proper class critera extension to <fo:inline font-family="monospace">true
</fo:inline> to force OpenJPA to append class criteria to its select SQL.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA defines the following class criteria annotations for field relations and
array or collection element relations, respectively:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e26379"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26380"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/ClassCriteria.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.ClassCriteria</fo:inline></fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26388"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/ElementClassCriteria.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.ElementClassCriteria</fo:inline>
</fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="strategy"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">7.9.2.4. 
Strategy
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e26400"><!--
mapping metadata
,
extensions
,
strategy
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA's
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/Strategy.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.Strategy</fo:inline></fo:basic-link>
extension allows you to specify a custom mapping
strategy or value handler for a field. See
<fo:basic-link internal-destination="ref_guide_mapping_custom"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.10, “
Custom Mappings
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_custom"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_custom"/>]</fo:inline></fo:basic-link> for information on custom
mappings.
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_mapping_custom"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Custom Mappings
</fo:marker><fo:block font-size="20.735999999999997pt">7.10. 
Custom Mappings
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e26421"><!--
custom mapping
--></fo:wrapper><fo:wrapper id="d0e26424"><!--
mapping metadata
,
custom mapping
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In OpenJPA, you are not limited to the set of standard mappings defined by the
specification. OpenJPA allows you to define custom class, discriminator,
version, and field mapping strategies with all the power of OpenJPA's built-in
strategies.
</fo:block><fo:block id="ref_guide_mapping_custom_class"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Custom Class Mapping
</fo:marker><fo:block font-size="17.28pt">7.10.1. 
Custom Class Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To create a custom class mapping, write an implementation of the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/meta/ClassStrategy.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.meta.ClassStrategy</fo:inline></fo:basic-link>
interface. You will probably want to extend one of the existing abstract or
concrete strategies in the <fo:inline font-family="monospace">org.apache.openjpa.jdbc.meta.strats
</fo:inline> package.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/Strategy.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.Strategy</fo:inline></fo:basic-link>
annotation allows you to declare a custom class mapping strategy in JPA mapping
metadata. Set the value of the annotation to the full class name of your custom
strategy. You can configure your strategy class' bean properties using
OpenJPA's plugin syntax, detailed in <fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block><fo:block id="ref_guide_mapping_custom_versdiscrim"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Custom Discriminator and Version Strategies
</fo:marker><fo:block font-size="17.28pt">7.10.2. 
Custom Discriminator and Version Strategies
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To define a custom discriminator or version strategy, implement the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/meta/DiscriminatorStrategy.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.meta.DiscriminatorStrategy</fo:inline>
</fo:basic-link> or
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/meta/VersionStrategy.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.meta.VersionStrategy</fo:inline></fo:basic-link>
interface, respectively. You might extend one of the existing abstract or
concrete strategies in the <fo:inline font-family="monospace">org.apache.openjpa.jdbc.meta.strats
</fo:inline> package.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA includes the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/DiscriminatorStrategy.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.DiscriminatorStrategy</fo:inline>
</fo:basic-link> and
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/VersionStrategy.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.VersionStrategy</fo:inline>
</fo:basic-link> class annotations for declaring a custom discriminator or version
strategy in JPA mapping metadata. Set the string value of these annotations to
the full class name of your implementation, or to the class name or alias of an
existing OpenJPA implementation.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
As with custom class mappings, you can configure your strategy class' bean
properties using OpenJPA's plugin syntax, detailed in
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block><fo:block id="ref_guide_mapping_custom_field"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Custom Field Mapping
</fo:marker><fo:block font-size="17.28pt">7.10.3. 
Custom Field Mapping
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e26495"><!--
custom mapping
,
field mapping
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
While custom class, discriminator, and version mapping can be useful, custom
field mappings are far more common. OpenJPA offers two types of custom field
mappings: value handlers, and full custom field strategies. The following
sections examine each.
</fo:block><fo:block id="ref_guide_mapping_custom_vhandler"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">7.10.3.1. 
Value Handlers
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e26505"><!--
custom mapping
,
field mapping
,
value handler
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Value handlers make it trivial to map any type that you can break down into one
or more simple values. All value handlers implement the <fo:inline font-family="monospace">
org.apache.openjpa.jdbc.meta.ValueHandler</fo:inline> interface; see its
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/meta/ValueHandler.html"> Javadoc
</fo:basic-link> for details. Also, examine the built-in handlers in the <fo:inline font-family="monospace">
src/openjpa/jdbc/meta/strats</fo:inline> directory of your OpenJPA source
distribution. Use these functional implementations as examples when you
create your own value handlers.
</fo:block></fo:block><fo:block id="ref_guide_mapping_custom_fieldstrat"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">7.10.3.2. 
Field Strategies
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e26526"><!--
custom mapping
,
field mapping
,
field strategy
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA interacts with persistent fields through the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/meta/FieldStrategy"><fo:inline font-family="monospace">
org.apache.openjpa.jdbc.meta.FieldStrategy</fo:inline></fo:basic-link> interface. You
can implement this interface yourself to create a custom field strategy, or
extend one of the existing abstract or concrete strategies in the <fo:inline font-family="monospace">
org.apache.openjpa.jdbc.meta.strats</fo:inline> package. Creating a custom field
strategy is more difficult than writing a custom value handler, but gives you
more freedom in how you interact with the database.
</fo:block></fo:block><fo:block id="ref_guide_mapping_custom_field_conf"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">7.10.3.3. 
Configuration
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e26545"><!--
custom mapping
,
field mapping
,
configuration
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA gives you two ways to configure your custom field mappings. The
<fo:inline font-family="monospace">FieldStrategies</fo:inline> property of the built-in <fo:inline font-family="monospace">
MappingDefaults</fo:inline> implementations allows you to globally associate
field types with their corresponding custom value handler or strategy. OpenJPA
will automatically use your custom strategies when it encounters a field of the
associated type. OpenJPA will use your custom value handlers whenever it
encounters a field of the associated type.
<fo:basic-link internal-destination="ref_guide_mapping_defaults"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 7.4, “
Mapping Defaults
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_mapping_defaults"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_mapping_defaults"/>]</fo:inline></fo:basic-link> described mapping
defaults in detail.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Your other option is to explicitly install a custom value handler or strategy on
a particular field. To do so, specify the full name of your implementation class
in the proper mapping metadata extension. OpenJPA includes the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/Strategy.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.Strategy</fo:inline></fo:basic-link>
annotation. You can configure the named strategy or handler's bean
properties in these extensions using OpenJPA's plugin format (see
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>).
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_orphan"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Orphaned Keys
</fo:marker><fo:block font-size="20.735999999999997pt">7.11. 
Orphaned Keys
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Unless you apply database foreign key constraints extensively, it is possible to
end up with orphaned keys in your database. For example, suppose <fo:inline font-family="monospace">
Magazine</fo:inline><fo:inline font-family="monospace">m</fo:inline> has a reference to <fo:inline font-family="monospace">Article
</fo:inline><fo:inline font-family="monospace">a</fo:inline>. If you delete <fo:inline font-family="monospace">a</fo:inline> without
nulling <fo:inline font-family="monospace">m</fo:inline>'s reference, <fo:inline font-family="monospace">m</fo:inline>'s database
record will wind up with an orphaned key to the non-existent <fo:inline font-family="monospace">a
</fo:inline> record.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e26598"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
One way of avoiding orphaned keys is to use <fo:inline font-style="italic">dependent</fo:inline>
fields.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA's <fo:basic-link internal-destination="openjpa.OrphanedKeyAction"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.OrphanedKeyAction</fo:inline></fo:inline></fo:basic-link> configuration property controls what
action to take when OpenJPA encounters an orphaned key. You can set this plugin
string (see <fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) to a custom
implementation of the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/event/OrphanedKeyAction.html">
<fo:inline font-family="monospace"> org.apache.openjpa.event.OrphanedKeyAction</fo:inline></fo:basic-link>
interface, or use one of the built-in options:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e26617"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26618"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">log</fo:inline>: This is the default setting. This option logs a message
for each orphaned key. It is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/event/LogOrphanedKeyAction.html">
<fo:inline font-family="monospace">org.apache.openjpa.event.LogOrphanedKeyAction</fo:inline></fo:basic-link>
class, which has the following additional properties:
</fo:block><fo:list-block provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e26629"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26630"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Channel</fo:inline>: The channel to log to. Defaults to <fo:inline font-family="monospace">
openjpa.Runtime</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26639"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Level</fo:inline>: The level to log at. Defaults to <fo:inline font-family="monospace">WARN
</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26648"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">exception</fo:inline>: Throw an <fo:inline font-family="monospace">
EntityNotFoundException</fo:inline> when OpenJPA discovers an
orphaned key. This is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/event/ExceptionOrphanedKeyAction.html">
<fo:inline font-family="monospace">org.apache.openjpa.event.ExceptionOrphanedKeyAction</fo:inline>
</fo:basic-link> class.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26663"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">none</fo:inline>: Ignore orphaned keys. This is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/event/NoneOrphanedKeyAction.html">
<fo:inline font-family="monospace">org.apache.openjpa.event.NoneOrphanedKeyAction</fo:inline></fo:basic-link>
class.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_orphan_logex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 7.24. 
Custom Logging Orphaned Keys
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e26677">
&lt;property name="openjpa.OrphanedKeyAction" value="log(Channel=Orphans, Level=DEBUG)"/&gt;
</fo:block></fo:block></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Deployment
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Deployment
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="ref_guide_deploy"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 8. 
Deployment
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA deployment includes choosing a factory deployment strategy, and in a
managed environment, optionally integrating with your application server's
managed and XA transactions. This chapter examines each aspect of deployment in
turn.
</fo:block><fo:block id="ref_guide_deploy_factory"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Factory Deployment
</fo:marker><fo:block font-size="20.735999999999997pt">8.1. 
Factory Deployment
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA offers two <fo:inline font-family="monospace">EntityManagerFactory</fo:inline>
deployment options.
</fo:block><fo:block id="ref_guide_deploy_factory_standalone"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Standalone Deployment
</fo:marker><fo:block font-size="17.28pt">8.1.1. 
Standalone Deployment
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e26696"><!--
deployment
,
standalone
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The JPA Overview describes the <fo:inline font-family="monospace">javax.persistence.Persistence
</fo:inline> class. You can use <fo:inline font-family="monospace">Persistence</fo:inline> to obtain
<fo:inline font-family="monospace">EntityManagerFactory</fo:inline> instances, as demonstrated in
<fo:basic-link internal-destination="jpa_overview_persistence"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 6, <fo:inline font-style="italic">
Persistence
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_persistence"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_persistence"/>]</fo:inline></fo:basic-link>. OpenJPA also extends
<fo:inline font-family="monospace">Persistence</fo:inline> to add additional <fo:inline font-family="monospace">
EntityManagerFactory</fo:inline> creation methods. The <fo:inline font-family="monospace">
org.apache.openjpa.persistence.OpenJPAPersistence</fo:inline> class
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/OpenJPAPersistence.html">
Javadoc</fo:basic-link> details these extensions.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
After obtaining the factory, you can cache it for all <fo:inline font-family="monospace">
EntityManager</fo:inline> creation duties. OpenJPA factories support being
bound to JNDI as well.
</fo:block></fo:block><fo:block id="ref_guide_deploy_inject"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
EntityManager Injection
</fo:marker><fo:block font-size="17.28pt">8.1.2. 
EntityManager Injection
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Java EE 5 application servers allow you to <fo:inline font-style="italic">inject</fo:inline>
entity managers into your session beans using the <fo:inline font-family="monospace">PersistenceContext
</fo:inline> annotation. See your application server documentation for details.
</fo:block></fo:block></fo:block><fo:block id="ref_guide_enterprise_trans"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Integrating with the Transaction Manager
</fo:marker><fo:block font-size="20.735999999999997pt">8.2. 
Integrating with the Transaction Manager
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e26747"><!--
transactions
,
managed
--></fo:wrapper><fo:wrapper id="d0e26752"><!--
TransactionManager
,
integration
--></fo:wrapper><fo:wrapper id="d0e26757"><!--
managed transactions
--></fo:wrapper><fo:wrapper id="d0e26762"><!--
TransactionMode
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA <fo:inline font-family="monospace">EntityManager</fo:inline>s have the ability to automatically
synchronize their transactions with an external transaction manager. Whether
or not <fo:inline font-family="monospace">EntityManager</fo:inline>s from a given <fo:inline font-family="monospace">
EntityManagerFactory</fo:inline> exhibit this behavior by default depends on
the transaction type you set for the factory's persistence unit in
your <fo:inline font-family="monospace">persistence.xml</fo:inline> file. OpenJPA uses the given
transaction type internally to set the
<fo:basic-link internal-destination="openjpa.TransactionMode"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">openjpa.TransactionMode
</fo:inline></fo:inline></fo:basic-link> configuration property. This property accepts the following
modes:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e26783"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26784"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">local</fo:inline>: Perform transaction operations locally.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26790"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">managed</fo:inline>: Integrate with the application server's managed
global transactions.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can override the global transaction mode setting when you obtain an
<fo:inline font-family="monospace">EntityManager</fo:inline> using the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api/javax/persistence/EntityManagerFactory.html">
<fo:inline font-family="monospace">EntityManagerFactory</fo:inline></fo:basic-link>'s
<fo:inline font-family="monospace">createEntityManager(Map props)</fo:inline> method. Simply set the
<fo:inline font-family="monospace">openjpa.TransactionMode</fo:inline> key of the given <fo:inline font-family="monospace">Map
</fo:inline> to the desired value.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e26815"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can also override the <fo:inline font-family="monospace">openjpa.ConnectionUserName</fo:inline>,
<fo:inline font-family="monospace">openjpa.ConnectionPassword</fo:inline>, and <fo:inline font-family="monospace">
openjpa.ConnectionRetainMode</fo:inline> settings using the given <fo:inline font-family="monospace">
Map</fo:inline>.
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e26832"><!--ManagedRuntime--></fo:wrapper>
In order to use global transactions, OpenJPA must be able to access the
application server's <fo:inline font-family="monospace">
javax.transaction.TransactionManager</fo:inline>. OpenJPA can automatically
discover the transaction manager for most major application servers.
Occasionally, however, you might have to point OpenJPA to the transaction
manager for an unrecognized or non-standard application server setup. This is
accomplished through the <fo:basic-link internal-destination="openjpa.ManagedRuntime"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.ManagedRuntime</fo:inline></fo:inline></fo:basic-link> configuration property. This
property describes an
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/ee/ManagedRuntime.html"><fo:inline font-family="monospace">
org.apache.openjpa.ee.ManagedRuntime</fo:inline></fo:basic-link> implementation to use
for transaction manager discovery. You can specify your own implementation,
or use one of the built-ins:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e26847"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26848"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">auto</fo:inline>: This is the default. It is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/ee/AutomaticManagedRuntime.html">
<fo:inline font-family="monospace">org.apache.openjpa.ee.AutomaticManagedRuntime</fo:inline></fo:basic-link>
class. This managed runtime is able to automatically integrate with several
common application servers.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26859"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">invocation</fo:inline>: An alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/ee/InvocationManagedRuntime.html">
<fo:inline font-family="monospace">org.apache.openjpa.ee.InvocationManagedRuntime</fo:inline></fo:basic-link>
class. You can configure this runtime to invoke any static
method in order to obtain the appserver's transaction manager.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26870"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">jndi</fo:inline>: An alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/ee/JNDIManagedRuntime.html">
<fo:inline font-family="monospace">org.apache.openjpa.ee.JNDIManagedRuntime</fo:inline></fo:basic-link>
class. You can configure this runtime to look up the transaction manager at
any JNDI location.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
See the Javadoc for of each class for details on the bean properties
you can pass to these plugins in your configuration string.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_enterprise_transex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 8.1. Configuring Transaction Manager Integration</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e26886">
&lt;property name="openjpa.TransactionMode" value="managed"/&gt;
&lt;property name="openjpa.ManagedRuntime" value="jndi(TransactionManagerName=java:/TransactionManager)"/&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_enterprise_xa"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
XA Transactions
</fo:marker><fo:block font-size="20.735999999999997pt">8.3. 
XA Transactions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e26891"><!--
transactions
,
XA
--></fo:wrapper><fo:wrapper id="d0e26896"><!--
XA transactions
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The X/Open Distributed Transaction Processing (X/Open DTP) model, designed by
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://www.xopen.org">Open Group</fo:basic-link> (a vendor consortium),
defines a standard communication architecture that provides the following:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e26906"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26907"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Concurrent execution of applications on shared resources.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26910"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Coordination of transactions across applications.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26913"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Components, interfaces, and protocols that define the architecture and provide
portability of applications.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26916"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Atomicity of transaction systems.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26919"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Single-thread control and sequential function-calling.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The X/Open DTP XA standard defines the application programming interfaces that a
resource manager uses to communicate with a transaction manager. The XA
interfaces enable resource managers to join transactions, to perform two-phase
commit, and to recover in-doubt transactions following a failure.
</fo:block><fo:block id="ref_guide_enterprise_xa_req"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Using OpenJPA with XA Transactions
</fo:marker><fo:block font-size="17.28pt">8.3.1. 
Using OpenJPA with XA Transactions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA supports XA-compliant transactions when used in a properly configured
managed environment. The following components are required:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e26929"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26930"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
A managed environment that provides an XA compliant transaction manager.
Examples of this are application servers such as WebLogic or JBoss.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26933"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Instances of a <fo:inline font-family="monospace">javax.sql.XADataSource</fo:inline> for each of the
<fo:inline font-family="monospace">DataSource</fo:inline>s that OpenJPA will use.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Given these components, setting up OpenJPA to participate in distributed
transactions is a simple two-step process:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.2em" id="d0e26944"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26945"><fo:list-item-label end-indent="label-end()"><fo:block>1.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Integrate OpenJPA with your application server's transaction manager, as
detailed in <fo:basic-link internal-destination="ref_guide_enterprise_trans"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 8.2, “
Integrating with the Transaction Manager
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_enterprise_trans"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_enterprise_trans"/>]</fo:inline></fo:basic-link> above.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26950"><fo:list-item-label end-indent="label-end()"><fo:block>2.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Point OpenJPA at an enlisted <fo:inline font-family="monospace">XADataSource</fo:inline>, and configure
a second non-enlisted data source. See
<fo:basic-link internal-destination="ref_guide_dbsetup_thirdparty_enlist"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.2.1, “
Managed and XA DataSources
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_thirdparty_enlist"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_thirdparty_enlist"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Runtime Extensions
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Runtime Extensions
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="ref_guide_runtime"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 9. 
Runtime Extensions
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This chapter describes OpenJPA extensions to the standard JPA
interfaces, and outlines some additional features of the OpenJPA runtime.
</fo:block><fo:block id="ref_guide_runtime_arch"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Architecture
</fo:marker><fo:block font-size="20.735999999999997pt">9.1. 
Architecture
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Internally, OpenJPA does not adhere to any persistence specification. The
OpenJPA kernel has its own set of APIs and components. Specifications like JPA
and JDO are simply different "personalities" that can OpenJPA's native kernel
can adopt.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
As a OpenJPA user, you will not normally see beneath
OpenJPA's JPA personality. OpenJPA allows you to access its feature set without
leaving the comfort of JPA. Where OpenJPA goes beyond standard JPA
functionality, we have crafted JPA-specific APIs to each OpenJPA extension for
as seamless an experience as possible.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When writing OpenJPA plugins or otherwise extending the OpenJPA runtime,
however, you will use OpenJPA's native APIs. So that you won't feel lost, the
list below associates each specification interface with its backing native
OpenJPA component:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e26973"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26974"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">javax.persistence.EntityManagerFactory</fo:inline>: <fo:inline font-style="italic">
<fo:inline font-family="monospace">org.apache.openjpa.kernel.BrokerFactory</fo:inline></fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26985"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">javax.persistence.EntityManager</fo:inline>: <fo:inline font-style="italic"><fo:inline font-family="monospace">
org.apache.openjpa.kernel.Broker</fo:inline></fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e26995"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">javax.persistence.Query</fo:inline>: <fo:inline font-style="italic"><fo:inline font-family="monospace">
org.apache.openjpa.kernel.Query</fo:inline></fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27005"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">org.apache.openjpa.persistence.Extent</fo:inline>: <fo:inline font-style="italic">
<fo:inline font-family="monospace">org.apache.openjpa.kernel.Extent</fo:inline></fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27016"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">org.apache.openjpa.persistence.StoreCache</fo:inline>: <fo:inline font-style="italic">
<fo:inline font-family="monospace">org.apache.openjpa.datacache.DataCache</fo:inline></fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27027"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">org.apache.openjpa.persistence.QueryResultCache</fo:inline>:
<fo:inline font-style="italic"><fo:inline font-family="monospace">org.apache.openjpa.datacache.QueryCache</fo:inline>
</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27038"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">org.apache.openjpa.persistence.FetchPlan</fo:inline>: <fo:inline font-style="italic">
<fo:inline font-family="monospace">org.apache.openjpa.kernel.FetchConfiguration</fo:inline></fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27049"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">org.apache.openjpa.persistence.Generator</fo:inline>: <fo:inline font-style="italic">
<fo:inline font-family="monospace">org.apache.openjpa.kernel.Seq</fo:inline></fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:basic-link internal-destination="ref_guide_runtime_openjpapersistence"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
org.apache.openjpa.persistence.OpenJPAPersistence</fo:inline></fo:inline></fo:basic-link> helper
allows you to convert between <fo:inline font-family="monospace">EntityManagerFactories</fo:inline> and
<fo:inline font-family="monospace">BrokerFactories</fo:inline>, <fo:inline font-family="monospace">EntityManager</fo:inline>s
and <fo:inline font-family="monospace">Broker</fo:inline>s.
</fo:block><fo:block id="ref_guide_runtime_broker_finalization"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Broker Finalization
</fo:marker><fo:block font-size="17.28pt">9.1.1. 
Broker Finalization
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27081"><!--
EntityManager
,
finalizing
,
clean-up
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Outside of a Java EE 5 application server or other JPA persistence container
environment, the default OpenJPAEntityManager implementation automatically
closes itself during instance finalization. This guards against accidental
resource leaks that may occur if a developer fails to explicitly close
EntityManagers when finished with them, but it also incurs a scalability
bottleneck, since the JVM must perform synchronization during instance creation,
and since the finalizer thread will have more instances to monitor. To avoid
this overhead, set the
<fo:basic-link internal-destination="openjpa.BrokerImpl"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">openjpa.BrokerImpl</fo:inline></fo:inline></fo:basic-link>
configuration property to <fo:inline font-family="monospace">non-finalizing</fo:inline>.
</fo:block></fo:block><fo:block id="ref_guide_runtime_broker_extension"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Broker Customization and Finalization
</fo:marker><fo:block font-size="17.28pt">9.1.2. 
Broker Customization and Finalization
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27100"><!--
OpenJPAEntityManager
,
extending
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
As a <fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">plugin string</fo:inline></fo:basic-link>, this property
can be used to configure the <fo:inline font-family="monospace"> BrokerImpl</fo:inline> with the
following properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e27113"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27114"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">EvictFromDataCache</fo:inline>: When evicting an object through the
<fo:inline font-family="monospace">OpenJPAEntityManager.evict</fo:inline> methods, whether to also
evict it from the OpenJPA's <fo:basic-link internal-destination="ref_guide_cache"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">data cache</fo:inline></fo:basic-link>.
Defaults to <fo:inline font-family="monospace">false</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_runtime_pm_evictex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 9.1. 
Evict from Data Cache
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e27132">
&lt;property name="openjpa.BrokerImpl" value="EvictFromDataCache=true"/&gt;
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Additionally, some advanced users may want to add capabilities to OpenJPA's
internal <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/BrokerImpl.html">
<fo:inline font-family="monospace">org.apache.openjpa.kernel.BrokerImpl</fo:inline></fo:basic-link>. You can
configure OpenJPA to use a custom subclass of <fo:inline font-family="monospace">BrokerImpl</fo:inline>
with the <fo:basic-link internal-destination="openjpa.BrokerImpl"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">openjpa.BrokerImpl
</fo:inline></fo:inline></fo:basic-link> configuration property. Set this property to the full class
name of your custom subclass. When implementing your subclass, consider the
finalization issues mentioned in
<fo:basic-link internal-destination="ref_guide_runtime_broker_finalization"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">???</fo:inline></fo:basic-link>. It may be appropriate
to create a subtype of both
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/BrokerImpl.html">
<fo:inline font-family="monospace">org.apache.openjpa.kernel.BrokerImpl</fo:inline></fo:basic-link> and
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/FinalizingBrokerImpl.html">
<fo:inline font-family="monospace">org.apache.openjpa.kernel.FinalizingBrokerImpl</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:block><fo:block id="ref_guide_runtime_jpa"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
JPA Extensions
</fo:marker><fo:block font-size="20.735999999999997pt">9.2. 
JPA Extensions
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following sections outline the runtime interfaces you can use to access
OpenJPA-specific functionality from JPA. Each interface contains services and
convenience methods missing from the JPA specification. OpenJPA strives to use
the same naming conventions and API patterns as standard JPA methods in all
extensions, so that OpenJPA JDO APIs feel as much as possible like standard JPA.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You may have noticed the examples throughout this document using the
<fo:inline font-family="monospace">OpenJPAPersistence.cast</fo:inline> methods to cast from standard
JPA interfaces to OpenJPA extended interfaces. This is the recommended practice.
Some application server vendors may proxy OpenJPA's JPA implementation,
preventing a straight cast. <fo:inline font-family="monospace">OpenJPAPersistence</fo:inline>'s
<fo:inline font-family="monospace">cast</fo:inline> methods work around these proxies.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e27176">
public static OpenJPAEntityManagerFactory cast(EntityManagerFactory emf);
public static OpenJPAEntityManager cast(EntityManager em);
public static OpenJPAQuery cast(Query q);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
We provide additional information on the <fo:inline font-family="monospace">OpenJPAPersistence
</fo:inline> helper <fo:basic-link internal-destination="ref_guide_runtime_openjpapersistence"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">
below</fo:inline></fo:basic-link>.
</fo:block><fo:block id="ref_guide_runtime_emfactory"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
OpenJPAEntityManagerFactory
</fo:marker><fo:block font-size="17.28pt">9.2.1. 
OpenJPAEntityManagerFactory
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27189"><!--
OpenJPAEntityManagerFactory
--></fo:wrapper><fo:wrapper id="d0e27192"><!--
EntityManagerFactory
,
OpenJPA extensions
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">org.apache.openjpa.persistence.OpenJPAEntityManagerFactory
</fo:inline> interface extends the basic <fo:inline font-family="monospace">
javax.persistence.EntityManagerFactory</fo:inline> with OpenJPA-specific
features. The <fo:inline font-family="monospace">OpenJPAEntityManagerFactory</fo:inline> offers APIs to
access the OpenJPA data and query caches and to perform other OpenJPA-specific
operations. See the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/OpenJPAEntityManagerFactory.html">
interface Javadoc</fo:basic-link> for details.
</fo:block></fo:block><fo:block id="ref_guide_runtime_em"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
OpenJPAEntityManager
</fo:marker><fo:block font-size="17.28pt">9.2.2. 
OpenJPAEntityManager
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27216"><!--
OpenJPAEntityManager
--></fo:wrapper><fo:wrapper id="d0e27219"><!--
EntityManager
,
OpenJPA extensions
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
All OpenJPA <fo:inline font-family="monospace">EntityManager</fo:inline>s implement the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/OpenJPAEntityManager.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.OpenJPAEntityManager</fo:inline>
</fo:basic-link> interface. This interface extends the standard <fo:inline font-family="monospace">
javax.persistence.EntityManager</fo:inline>. Just as the standard <fo:inline font-family="monospace">
EntityManager</fo:inline> is the primary window into JPA services, the
<fo:inline font-family="monospace">OpenJPAEntityManager</fo:inline> is the primary window from JPA into
OpenJPA-specific functionality. We strongly encourage you to investigate the API
extensions this interface contains.
</fo:block></fo:block><fo:block id="ref_guide_runtime_jpaquery"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
OpenJPAQuery
</fo:marker><fo:block font-size="17.28pt">9.2.3. 
OpenJPAQuery
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27249"><!--
OpenJPAQuery
--></fo:wrapper><fo:wrapper id="d0e27252"><!--
Query
,
OpenJPA extensions
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA extends JPA's standard query functionality with the <fo:inline font-family="monospace">
org.apache.openjpa.persistence.OpenJPAQuery</fo:inline> interface. See its
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/OpenJPAQuery.html">Javadoc
</fo:basic-link> for details on the convenience methods it provides.
</fo:block></fo:block><fo:block id="ref_guide_runtime_jpaextent"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Extent
</fo:marker><fo:block font-size="17.28pt">9.2.4. 
Extent
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27270"><!--
Extent
--></fo:wrapper><fo:wrapper id="d0e27273"><!--
Extent
,
OpenJPA extensions
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
An <fo:inline font-family="monospace">Extent</fo:inline> is a logical view of all persistent instances
of a given entity class, possibly including subclasses. OpenJPA adds the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/Extent.html"><fo:inline font-family="monospace">
org.apache.openjpa.persistence.Extent</fo:inline></fo:basic-link> class to the set of
Java Persistence APIs. The following code illustrates iterating over all
instances of the <fo:inline font-family="monospace">Magazine</fo:inline> entity, without subclasses:
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_runtime_jpaextentex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 9.2. 
Using a JPA Extent
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e27295">
import org.apache.openjpa.persistence.*;
...
OpenJPAEntityManager kem = OpenJPAPersistence.cast(em);
Extent&lt;Magazine&gt; mags = kem.getExtent(Magazine.class, false);
for (Magazine m : mags)
processMagazine (m);
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_runtime_jpacache"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
StoreCache
</fo:marker><fo:block font-size="17.28pt">9.2.5. 
StoreCache
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27300"><!--
StoreCache
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In addition to the <fo:inline font-family="monospace">EntityManager</fo:inline> object cache mandated by
the JPA specification, OpenJPA includes a flexible datastore-level cache. You
can access this cache from your JPA code using the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/StoreCache.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.StoreCache</fo:inline></fo:basic-link> facade.
<fo:basic-link internal-destination="ref_guide_cache"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.1, “
Data Cache
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_cache"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_cache"/>]</fo:inline></fo:basic-link> has detailed information on OpenJPA's
data caching system, including the <fo:inline font-family="monospace">StoreCache</fo:inline> facade.
</fo:block></fo:block><fo:block id="ref_guide_runtime_jpaquerycache"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
QueryResultCache
</fo:marker><fo:block font-size="17.28pt">9.2.6. 
QueryResultCache
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27321"><!--
QueryResultCache
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA can cache query results as well as persistent object data. The
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/QueryResultCache.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.QueryResultCache</fo:inline></fo:basic-link>
is an JPA-flavored facade to OpenJPA's internal query cache. See
<fo:basic-link internal-destination="ref_guide_cache_query"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.1.3, “
Query Cache
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_cache_query"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_cache_query"/>]</fo:inline></fo:basic-link> for details on query caching in
OpenJPA.
</fo:block></fo:block><fo:block id="ref_guide_runtime_jpafetch"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
FetchPlan
</fo:marker><fo:block font-size="17.28pt">9.2.7. 
FetchPlan
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27336"><!--
FetchPlan
--></fo:wrapper><fo:wrapper id="d0e27339"><!--
eager fetching
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Many of the aforementioned OpenJPA interfaces give you access to an <fo:inline font-family="monospace">
org.apache.openjpa.persistence.FetchPlan</fo:inline> instance. The <fo:inline font-family="monospace">
FetchPlan</fo:inline> allows you to exercise some control over how objects are
fetched from the datastore, including <fo:basic-link internal-destination="ref_guide_dbsetup_lrs"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">
large result set support</fo:inline></fo:basic-link>, <fo:basic-link internal-destination="ref_guide_fetch"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">custom fetch
groups</fo:inline></fo:basic-link>, and <fo:basic-link internal-destination="ref_guide_locking"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">lock levels</fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA goes one step further, extending <fo:inline font-family="monospace">FetchPlan</fo:inline> with
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/jdbc/JDBCFetchPlan.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.jdbc.JDBCFetchPlan</fo:inline></fo:basic-link>
to add additional JDBC-specific tuning methods. Unless you have customized
OpenJPA to use a non-relational back-end (see
<fo:basic-link internal-destination="ref_guide_enterprise_abstractstore"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 9.8, “
Non-Relational Stores
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_enterprise_abstractstore"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_enterprise_abstractstore"/>]</fo:inline></fo:basic-link> ), all <fo:inline font-family="monospace">
FetchPlan</fo:inline>s in OpenJPA implement <fo:inline font-family="monospace">
JDBCFetchPlan</fo:inline>, so feel free to cast to this interface.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Fetch plans pass on from parent components to child components. The <fo:inline font-family="monospace">
EntityManagerFactory</fo:inline> settings (via your configuration properties)
for things like the fetch size, result set type, and custom fetch groups are
passed on to the fetch plan of the <fo:inline font-family="monospace">EntityManager</fo:inline>s it
produces. The settings of each <fo:inline font-family="monospace">EntityManager</fo:inline>, in turn,
are passed on to each <fo:inline font-family="monospace">Query</fo:inline> and <fo:inline font-family="monospace">Extent
</fo:inline> it returns. Note that the opposite, however, is not true. Modifying
the fetch plan of a <fo:inline font-family="monospace">Query</fo:inline> or <fo:inline font-family="monospace">Extent
</fo:inline> does not affect the <fo:inline font-family="monospace">EntityManager</fo:inline>'s
configuration. Likewise, modifying an <fo:inline font-family="monospace">EntityManager</fo:inline>'s
configuration does not affect the <fo:inline font-family="monospace"> EntityManagerFactory</fo:inline>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:basic-link internal-destination="ref_guide_fetch"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.6, “
Fetch Groups
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_fetch"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_fetch"/>]</fo:inline></fo:basic-link> includes examples using <fo:inline font-family="monospace">
FetchPlan</fo:inline>s.
</fo:block></fo:block><fo:block id="ref_guide_runtime_openjpapersistence"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
OpenJPAPersistence
</fo:marker><fo:block font-size="17.28pt">9.2.8. 
OpenJPAPersistence
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27421"><!--
OpenJPAPersistence
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/OpenJPAPersistence.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.OpenJPAPersistence</fo:inline></fo:basic-link>
is a static helper class that adds OpenJPA-specific utility methods to
<fo:inline font-family="monospace">javax.persistence.Persistence</fo:inline>.
</fo:block></fo:block></fo:block><fo:block id="ref_guide_locking"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Object Locking
</fo:marker><fo:block font-size="20.735999999999997pt">9.3. 
Object Locking
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27437"><!--
locking
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Controlling how and when objects are locked is an important part of maximizing
the performance of your application under load. This section describes OpenJPA's
APIs for explicit locking, as well as its rules for implicit locking.
</fo:block><fo:block id="ref_guide_locking_default"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Configuring Default Locking
</fo:marker><fo:block font-size="17.28pt">9.3.1. 
Configuring Default Locking
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27445"><!--
locking
,
defaults configuration
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e27452"><!--
locking
,
levels
--></fo:wrapper>
<fo:wrapper id="d0e27458"><!--
ReadLockLevel
--></fo:wrapper>
<fo:wrapper id="d0e27462"><!--
WriteLockLevel
--></fo:wrapper>
You can control OpenJPA's default transactional read and write lock levels
through the <fo:basic-link internal-destination="openjpa.ReadLockLevel"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.ReadLockLevel</fo:inline></fo:inline></fo:basic-link> and
<fo:basic-link internal-destination="openjpa.WriteLockLevel"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">openjpa.WriteLockLevel</fo:inline>
</fo:inline></fo:basic-link> configuration properties. Each property accepts a value of <fo:inline font-family="monospace">
none</fo:inline>, <fo:inline font-family="monospace">read</fo:inline>, <fo:inline font-family="monospace">write</fo:inline>, or a number
corresponding to a lock level defined by the
<fo:basic-link internal-destination="ref_guide_locking_lockmgr"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">lock manager</fo:inline></fo:basic-link> in use. These
properties apply only to non-optimistic transactions; during optimistic
transactions, OpenJPA never locks objects by default.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e27489"><!--
LockTimeout
--></fo:wrapper>
<fo:wrapper id="d0e27493"><!--
locking
,
timeout
--></fo:wrapper>
You can control the default amount of time OpenJPA will wait when trying to
obtain locks through the <fo:basic-link internal-destination="openjpa.LockTimeout"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.LockTimeout</fo:inline></fo:inline></fo:basic-link> configuration property. Set this property
to the number of milliseconds you are willing to wait for a lock before OpenJPA
will throw an exception, or to -1 for no limit. It defaults to -1.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_locking_default_conf"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 9.3. 
Setting Default Lock Levels
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e27506">
&lt;property name="openjpa.ReadLockLevel" value="none"/&gt;
&lt;property name="openjpa.WriteLockLevel" value="write"/&gt;
&lt;property name="openjpa.LockTimeout" value="30000"/&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_locking_runtime"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Configuring Lock Levels at Runtime
</fo:marker><fo:block font-size="17.28pt">9.3.2. 
Configuring Lock Levels at Runtime
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27511"><!--
locking
,
runtime configuration
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
At runtime, you can override the default lock levels through the <fo:inline font-family="monospace">
FetchPlan</fo:inline> interface described above. At the beginning of each
datastore transaction, OpenJPA initializes the <fo:inline font-family="monospace"> EntityManager
</fo:inline>'s fetch plan with the default lock levels and timeouts described
in the previous section. By changing the fetch plan's locking properties, you
can control how objects loaded at different points in the transaction are
locked. You can also use the fetch plan of an individual <fo:inline font-family="monospace">Query
</fo:inline> to apply your locking changes only to objects loaded through that
<fo:inline font-family="monospace">Query</fo:inline>.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e27530">
public LockModeType getReadLockMode();
public FetchPlan setReadLockMode(LockModeType mode);
public LockModeType getWriteLockMode();
public FetchPlan setWriteLockMode(LockModeType mode);
long getLockTimeout();
FetchPlan setLockTimeout(long timeout);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Controlling locking through these runtime APIs works even during optimistic
transactions. At the end of the transaction, OpenJPA resets the fetch plan's
lock levels to <fo:inline font-family="monospace">none</fo:inline>. You cannot lock objects outside of a
transaction.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_locking_fetch"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 9.4. 
Setting Runtime Lock Levels
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e27540">
import org.apache.openjpa.persistence.*;
...
EntityManager em = ...;
em.getTransaction().begin();
// load stock we know we're going to update at write lock mode
Query q = em.createQuery("select s from Stock s where symbol = :s");
q.setParameter("s", symbol);
OpenJPAQuery oq = OpenJPAPersistence.cast(q);
FetchPlan fetch = oq.getFetchPlan ();
fetch.setReadLockMode(LockModeType.WRITE);
fetch.setLockTimeout(3000); // 3 seconds
Stock stock = (Stock) q.getSingleResult();
// load an object we don't need locked at none lock mode
fetch = OpenJPAPersistence.cast(em).getFetchPlan();
fetch.setReadLockMode(null);
Market market = em.find(Market.class, marketId);
stock.setPrice(market.calculatePrice(stock));
em.getTransaction().commit();
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_locking_apis"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Object Locking APIs
</fo:marker><fo:block font-size="17.28pt">9.3.3. 
Object Locking APIs
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27545"><!--
locking
,
runtime APIs
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In addition to allowing you to control implicit locking levels, OpenJPA provides
explicit APIs to lock objects and to retrieve their current lock level.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e27552">
public LockModeType OpenJPAEntityManager.getLockMode(Object pc);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Returns the level at which the given object is currently locked.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In addition to the standard
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api/javax/persistence/EntityManager.html">
<fo:inline font-family="monospace">EntityManager.lock(Object, LockModeType)</fo:inline></fo:basic-link>
method, the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/OpenJPAEntityManager.html">
<fo:inline font-family="monospace">OpenJPAEntityManager</fo:inline></fo:basic-link> exposes the following
methods to lock objects explicitly:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e27568">
public void lock(Object pc);
public void lock(Object pc, LockModeType mode, long timeout);
public void lockAll(Object... pcs);
public void lockAll(Object... pcs, LockModeType mode, long timeout);
public void lockAll(Collection pcs);
public void lockAll(Collection pcs, LockModeType mode, long timeout);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Methods that do not take a lock level or timeout parameter default to the
current fetch plan. The example below demonstrates these methods in action.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_locking_explicit"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 9.5. 
Locking APIs
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e27575">
import org.apache.openjpa.persistence.*;
// retrieve the lock level of an object
OpenJPAEntityManager oem = OpenJPAPersistence.cast(em);
Stock stock = ...;
LockModeType level = oem.getLockMode(stock);
if (level == OpenJPAModeType.WRITE) ...
...
oem.setOptimistic(true);
oem.getTransaction().begin ();
// override default of not locking during an opt trans to lock stock object
oem.lock(stock, LockModeType.WRITE, 1000);
stock.setPrice(market.calculatePrice(stock));
oem.getTransaction().commit();
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_locking_lockmgr"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Lock Manager
</fo:marker><fo:block font-size="17.28pt">9.3.4. 
Lock Manager
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27580"><!--
locking
,
LockManager
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e27587"><!--
LockManager
--></fo:wrapper>
OpenJPA delegates the actual work of locking objects to the system's
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/LockManager.html"><fo:inline font-family="monospace">
org.apache.openjpa.kernel.LockManager</fo:inline></fo:basic-link>. This plugin is
controlled by the <fo:basic-link internal-destination="openjpa.LockManager"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.LockManager</fo:inline></fo:inline></fo:basic-link> configuration property. You can write your
own lock manager, or use one of the bundled options:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e27599"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27600"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">pessimistic</fo:inline>: This is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/kernel/PessimisticLockManager.html">
<fo:inline font-family="monospace">o
rg.apache.openjpa.jdbc.kernel.PessimisticLockManager</fo:inline></fo:basic-link>, which
uses SELECT FOR UPDATE statements (or the database's equivalent) to lock the
database rows corresponding to locked objects. This lock
manager does not distinguish between read locks and write locks; all locks are
write locks.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">pessimistic</fo:inline> LockManager can be configued to additionally
perform the version checking and incrementing behavior of the <fo:inline font-family="monospace">version
</fo:inline> lock manager described below by setting its <fo:inline font-family="monospace">
VersionCheckOnReadLock</fo:inline> and <fo:inline font-family="monospace">VersionUpdateOnWriteLock</fo:inline>
properties:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e27625">
&lt;property name="openjpa.LockManager" value="pessimistic(VersionCheckOnReadLock=true,VersionUpdateOnWriteLock=true)"/&gt;
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27627"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">none</fo:inline>: An alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/NoneLockManager.html">
<fo:inline font-family="monospace">org.apache.openjpa.kernel.NoneLockManager</fo:inline></fo:basic-link>, which
does not perform any locking at all.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27638"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">version</fo:inline>: An alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/VersionLockManager.html">
<fo:inline font-family="monospace">org.apache.openjpa.kernel.VersionLockManager</fo:inline></fo:basic-link>.
This lock manager does not perform any exclusive locking, but instead ensures
read consistency by verifying that the version of all read-locked instances is
unchanged at the end of the transaction. Furthermore, a write lock will force an
increment to the version at the end of the transaction, even if the object is
not otherwise modified. This ensures read consistency with non-blocking
behavior.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This is the default <fo:inline font-family="monospace">openjpa.LockManager</fo:inline> setting in JPA.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e27654"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In order for the <fo:inline font-family="monospace">version</fo:inline> lock manager to prevent the dirty
read phenomenon, the underlying data store's transaction isolation level must be
set to the equivalent of "read committed" or higher.
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_locking_disable"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 9.6. 
Disabling Locking
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e27663">
&lt;property name="openjpa.LockManager" value="none"/&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_locking_rules"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Rules for Locking Behavior
</fo:marker><fo:block font-size="17.28pt">9.3.5. 
Rules for Locking Behavior
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27668"><!--
locking
,
behavior
--></fo:wrapper><fo:wrapper id="d0e27673"><!--
lazy loading
,
locking behavior
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Advanced persistence concepts like lazy-loading and object uniquing create
several locking corner-cases. The rules below outline OpenJPA's implicit locking
behavior in these cases.
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.2em" id="d0e27680"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27681"><fo:list-item-label end-indent="label-end()"><fo:block>1.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
When an object's state is first read within a transaction, the object is locked
at the fetch plan's current read lock level. Future reads of additional lazy
state for the object will use the same read lock level, even if the fetch plan's
level has changed.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27684"><fo:list-item-label end-indent="label-end()"><fo:block>2.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
When an object's state is first modified within a transaction, the object is
locked at the write lock level in effect when the object was first read, even if
the fetch plan's level has changed. If the object was not read previously, the
current write lock level is used.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27687"><fo:list-item-label end-indent="label-end()"><fo:block>3.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
When objects are accessed through a persistent relation field, the related
objects are loaded with the fetch plan's current lock levels, not the lock
levels of the object owning the field.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27690"><fo:list-item-label end-indent="label-end()"><fo:block>4.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Whenever an object is accessed within a transaction, the object is re-locked at
the current read lock level. The current read and write lock levels become those
that the object "remembers" according to rules one and two above.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27693"><fo:list-item-label end-indent="label-end()"><fo:block>5.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If you lock an object explicitly through the APIs demonstrated above, it is
re-locked at the specified level. This level also becomes both the read and
write level that the object "remembers" according to rules one and two above.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27696"><fo:list-item-label end-indent="label-end()"><fo:block>6.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
When an object is already locked at a given lock level, re-locking at a lower
level has no effect. Locks cannot be downgraded during a transaction.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="ref_guide_locking_issues"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Known Issues and Limitations
</fo:marker><fo:block font-size="17.28pt">9.3.6. 
Known Issues and Limitations
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27702"><!--
locking
,
caveats
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Due to performance concerns and database limitations, locking cannot be perfect.
You should be aware of the issues outlined in this section, as they may affect
your application.
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e27709"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27710"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Typically, during optimistic transactions OpenJPA does not start an actual
database transaction until you flush or the optimistic transaction commits. This
allows for very long-lived transactions without consuming database resources.
When using the pessimistic lock manager, however, OpenJPA must begin a database
transaction whenever you decide to lock an object during an optimistic
transaction. This is because the pessimistic lock manager uses database locks,
and databases cannot lock rows without a transaction in progress. OpenJPA will
log an INFO message to the <fo:inline font-family="monospace">openjpa.Runtime</fo:inline> logging channel
when it begins a datastore transaction just to lock an object.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27716"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
In order to maintain reasonable performance levels when loading object state,
OpenJPA can only guarantee that an object is locked at the proper lock level
<fo:inline font-style="italic">after</fo:inline> the state has been retrieved from the database. This
means that it is technically possible for another transaction to "sneak in" and
modify the database record after OpenJPA retrieves the state, but before it
locks the object. The only way to positively guarantee that the object is locked
and has the most recent state to refresh the object after locking it.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When using the pessimistic lock manager, the case above can only occur when
OpenJPA cannot issue the state-loading SELECT as a locking statement due to
database limitations. For example, some databases cannot lock SELECTs that use
joins. The pessimistic lock manager will log an INFO message to the <fo:inline font-family="monospace">
openjpa.Runtime</fo:inline> logging channel whenever it cannot lock the initial
SELECT due to database limitations. By paying attention to these log messages,
you can see where you might consider using an object refresh to guarantee that
you have the most recent state, or where you might rethink the way you load the
state in question to circumvent the database limitations that prevent OpenJPA
from issuing a locking SELECT in the first place.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="ref_guide_savepoints"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Savepoints
</fo:marker><fo:block font-size="20.735999999999997pt">9.4. 
Savepoints
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27730"><!--
savepoint
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Savepoints allow for fine grained control over the transactional behavior of
your application. OpenJPA's savepoint API allow you to set intermediate rollback
points in your transaction. You can then choose to rollback changes made only
after a specific savepoint, then commit or continue making new changes in the
transaction. This feature is useful for multi-stage transactions, such as
editing a set of objects over several web pages or user screens. Savepoints also
provide more flexibilty to conditional transaction behavior, such as choosing to
commit or rollback a portion of the transaction based on the results of the
changes. This chapter describes how to use and configure OpenJPA savepoints.
</fo:block><fo:block id="reg_guide_savepoints_using"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Using Savepoints
</fo:marker><fo:block font-size="17.28pt">9.4.1. 
Using Savepoints
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA's
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/OpenJPAEntityManager.html">
<fo:inline font-family="monospace">OpenJPAEntityManager</fo:inline></fo:basic-link> have the following
methods to control savepoint behavior. Note that the savepoints work in tandem
with the current transaction. This means that savepoints require an open
transaction, and that a rollback of the transaction will rollback all of the
changes in the transaction regardless of any savepoints set.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e27745">
void setSavepoint(String name);
void releaseSavepoint(String name);
void rollbackToSavepoint(String name);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To set a savepoint, simply call <fo:inline font-family="monospace">setSavepoint</fo:inline>, passing
in a symbolic savepoint name. This savepoint will define a point at which you
can preserve the state of transactional objects for the duration of the current
transaction.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Having set a named savepoint, you can rollback changes made after that point by
calling <fo:inline font-family="monospace">rollbackToSavepoint</fo:inline>. This method will keep the
current transaction active, while restoring all transactional instances back to
their saved state. Instances that were deleted after the save point will no
longer be marked for deletion. Similarly, transient instances that were made
persistent after the savepoint will become transient again. Savepoints made
after this savepoint will be released and no longer valid, although you can
still set new savepoints. Savepoints will also be cleared after the current
transaction is committed or rolled back.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If a savepoint is no longer needed, you can release any resources it is
consuming resources by calling <fo:inline font-family="monospace">releaseSavepoint</fo:inline>. This
method should not be called for savepoints that have been
released automatically through other means, such as commit of a transaction or
rollback to a prior savepoint. While savepoints made after this savepoint will
also be released, there are no other effects on the current transaction.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following simple example illustrates setting, releasing, and rolling back to
a savepoint.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_savepoints_example"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 9.7. 
Using Savepoints
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e27767">
import org.apache.openjpa.persistence.*;
...
OpenJPAEntityManager oem = OpenJPAPersistence.cast(em);
oem.getTransaction().begin();
Magazine mag = oem.find(Magazine.class, id);
mag.setPageCount(300);
oem.setSavepoint("pages");
mag.setPrice(mag.getPageCount() * pricePerPage);
// we decide to release "pages"...
oem.releaseSavepoint("pages");
// ... and set a new savepoint which includes all changes
oem.setSavepoint("price");
mag.setPrice(testPrice);
// we determine the test price is not good
oem.rollbackToSavepoint("price");
// had we chosen to not release "pages", we might have rolled back to
// "pages" instead
// the price is now restored to mag.getPageCount() * pricePerPage
oem.getTransaction().commit();
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_savepoints_conf"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Configuring Savepoints
</fo:marker><fo:block font-size="17.28pt">9.4.2. 
Configuring Savepoints
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA uses the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/SavepointManager">
<fo:inline font-family="monospace">org.apache.openjpa.kernel.SavepointManager</fo:inline></fo:basic-link>
<fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">plugin</fo:inline></fo:basic-link> to handle perserving the
savepoint state. OpenJPA includes the following <fo:inline font-family="monospace">SavepointManager
</fo:inline> plugins:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e27785"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27786"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">in-mem</fo:inline>: The default. This is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="org.apache.openjpa.kernel.InMemorySavepointManager"><fo:inline font-family="monospace">
org.apache.openjpa.kernel.InMemorySavepointManager</fo:inline></fo:basic-link>. This
plugin stores all state, including field values, in memory. Due to this
behavior, each set savepoint is designed for small to medium transactional
object counts.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27796"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">jdbc</fo:inline>: This is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="org.apache.openjpa.jdbc.kernel.JDBCSavepointManager"><fo:inline font-family="monospace">
org.apache.openjpa.jdbc.kernel.JDBCSavepointManager</fo:inline></fo:basic-link>. This
plugin requires <fo:inline font-family="monospace">JDBC 3</fo:inline> and <fo:inline font-family="monospace"> java.sql.Savepoint
</fo:inline> support to operate. Note that this plugin implements savepoints by
issuing a flush to the database.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27812"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">oracle</fo:inline>: This is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="org.apache.openjpa.jdbc.sql.OracleSavepointManager"><fo:inline font-family="monospace">
org.apache.openjpa.jdbc.sql.OracleSavepointManager</fo:inline></fo:basic-link>. This
plugin operates similarly to the <fo:inline font-family="monospace">JDBC</fo:inline> plugin; however, it
uses Oracle-specific calls. This plugin requires using the Oracle JDBC driver
and database, versions <fo:inline font-family="monospace">9.2</fo:inline> or higher. Note that this plugin
implements savepoints by issuing a flush to the database.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="ref_guide_enterprise_methodql"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
MethodQL
</fo:marker><fo:block font-size="20.735999999999997pt">9.5. 
MethodQL
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27832"><!--
MethodQL
--></fo:wrapper><fo:wrapper id="d0e27835"><!--
Query
,
MethodQL
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If JPQL and SQL queries do not match your needs, OpenJPA also allows you to name
a Java method to use to load a set of objects. In a <fo:inline font-style="italic">MethodQL
</fo:inline> query, the query string names a static method to invoke to determine
the matching objects:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e27847">
import org.apache.openjpa.persistence.*;
...
// the method query language is 'openjpa.MethodQL'.
// set the query string to the method to execute, including full class name; if
// the class is in the candidate class' package or in the query imports, you
// can omit the package; if the method is in the candidate class, you can omit
// the class name and just specify the method name
OpenJPAEntityManager oem = OpenJPAPersistence.cast(emf);
OpenJPAQuery q = oem.createQuery("openjpa.MethodQL", "com.xyz.Finder.getByName");
// set the type of objects that the method returns
q.setResultClass(Person.class);
// parameters are passed the same way as in standard queries
q.setParameter("firstName", "Fred").setParameter("lastName", "Lucas");
// this executes your method to get the results
List results = q.getResultList();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
For datastore queries, the method must have the following signature:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e27851">
public static <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/lib/rop/ResultObjectProvider.html">ResultObjectProvider</fo:basic-link> xxx(<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/StoreContext.html">StoreContext</fo:basic-link> ctx, <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/meta/ClassMetaData.html">ClassMetaData</fo:basic-link> meta, boolean subclasses, Map params, <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/FetchConfiguration.html">FetchConfiguration </fo:basic-link> fetch)
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The returned result object provider should produce objects of the candidate
class that match the method's search criteria. If the returned objects do not
have all fields in the given fetch configuration loaded, OpenJPA will make
additional trips to the datastore as necessary to fill in the data for the
missing fields.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In-memory execution is slightly different, taking in one object at a time and
returning a boolean on whether the object matches the query:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e27869">
public static boolean xxx(<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/StoreContext.html">StoreContext</fo:basic-link> ctx, <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/meta/ClassMetaData.html">ClassMetaData</fo:basic-link> meta, boolean subclasses, Object obj, Map params, <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/FetchConfiguration.html">FetchConfiguration</fo:basic-link> fetch)
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In both method versions, the given <fo:inline font-family="monospace">params</fo:inline> map contains the
names and values of all the parameters for the query.
</fo:block></fo:block><fo:block id="ref_guide_sequence"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Generators
</fo:marker><fo:block font-size="20.735999999999997pt">9.6. 
Generators
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e27889"><!--
generators
,
Seq interface
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The JPA Overview's <fo:basic-link internal-destination="jpa_overview_mapping"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 12, <fo:inline font-style="italic">
Mapping Metadata
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping"/>]</fo:inline></fo:basic-link> details using
generators to automatically populate identity fields in JPA.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA represents all generators internally with the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/Seq.html"><fo:inline font-family="monospace">
org.apache.openjpa.kernel.Seq</fo:inline></fo:basic-link> interface. This interface
supplies all the context you need to create your own custom generators,
including the current persistence environment, the JDBC <fo:inline font-family="monospace">DataSource
</fo:inline>, and other essentials. The
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/kernel/AbstractJDBCSeq.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq</fo:inline></fo:basic-link>
helps you create custom JDBC-based sequences. OpenJPA also supplies the
following built-in <fo:inline font-family="monospace">Seq</fo:inline>s:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e27915"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27916"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e27919"><!--
generators
,
table
--></fo:wrapper>
<fo:inline font-family="monospace">table</fo:inline>: This is OpenJPA's default implementation. It is an
alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.kernel.TableJDBCSeq</fo:inline></fo:basic-link>
class. The <fo:inline font-family="monospace">TableJDBCSeq</fo:inline> uses a special single-row table
to store a global sequence number. If the table does not already exist, it is
created the first time you run the
<fo:basic-link internal-destination="ref_guide_mapping_mappingtool"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">mapping tool</fo:inline></fo:basic-link> on a class
that requires it. You can also use the class's <fo:inline font-family="monospace">main</fo:inline>
method to manipulate the table; see the
<fo:inline font-family="monospace">TableJDBCSeq.main</fo:inline> method Javadoc for usage details.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This <fo:inline font-family="monospace">Seq</fo:inline> has the following properties:
</fo:block><fo:list-block provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e27950"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27951"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Table</fo:inline>: The name of the sequence number table to use.
Defaults to <fo:inline font-family="monospace">OPENJPA_SEQUENCE_TABLE</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27960"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">PrimaryKeyColumn</fo:inline>: The name of the primary key column for the
sequence table. Defaults to <fo:inline font-family="monospace">ID</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27969"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">SequenceColumn</fo:inline>: The name of the column that will hold the
current sequence value. Defaults to <fo:inline font-family="monospace">SEQUENCE_VALUE</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27978"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Allocate</fo:inline>: The number of values to allocate on each database
trip. Defaults to 50, meaning the class will set aside the next 50 numbers each
time it accesses the sequence table, which in turn means it only has to make a
database trip to get new sequence numbers once every 50 sequence number
requests.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e27984"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e27987"><!--
generators
,
class-table
--></fo:wrapper>
<fo:inline font-family="monospace">class-table</fo:inline>: This is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/kernel/ClassTableJDBCSeq.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.kernel.ClassTableJDBCSeq</fo:inline></fo:basic-link>
. This <fo:inline font-family="monospace">Seq</fo:inline> is like the <fo:inline font-family="monospace">TableJDBCSeq
</fo:inline> above, but maintains a separate table row, and therefore a separate
sequence number, for each base persistent class. It has all the properties of
the <fo:inline font-family="monospace">TableJDBCSeq</fo:inline>. Its table name defaults to <fo:inline font-family="monospace">
OPENJPA_SEQUENCES_TABLE</fo:inline>. It also adds the following properties:
</fo:block><fo:list-block provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e28013"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28014"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">IgnoreUnmapped</fo:inline>: Whether to ignore unmapped base classes, and
instead use one row per least-derived mapped class. Defaults to <fo:inline font-family="monospace">
false</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28023"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">UseAliases</fo:inline>: Whether to use each class' entity name as the
primary key value of each row, rather than the full class name. Defaults to
<fo:inline font-family="monospace">false</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
As with the <fo:inline font-family="monospace">TableJDBCSeq</fo:inline>, the <fo:inline font-family="monospace">
ClassTableJDBCSeq</fo:inline> creates its table automatically during mapping
tool runs. However, you can manually manipulate the table through the class'
<fo:inline font-family="monospace">main</fo:inline> method. See the Javadoc for the
<fo:inline font-family="monospace"> ClassTableJDBCSeq.main</fo:inline> method for usage details.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28046"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e28049"><!--
generators
,
value-table
--></fo:wrapper>
<fo:inline font-family="monospace">value-table</fo:inline>: This is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/kernel/ValueTableJDBCSeq.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.kernel.ValueTableJDBCSeq</fo:inline></fo:basic-link>
. This <fo:inline font-family="monospace">Seq</fo:inline> is like the <fo:inline font-family="monospace">ClassTableJDBCSeq
</fo:inline> above, but has an arbitrary number of rows for sequence values,
rather than a fixed pattern of one row per class. Its table defaults to
<fo:inline font-family="monospace">OPENJPA_SEQUENCES_TABLE</fo:inline>. It has all the properties of the
<fo:inline font-family="monospace">TableJDBCSeq</fo:inline>, plus:
</fo:block><fo:list-block provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e28075"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28076"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">PrimaryKeyValue</fo:inline>: The primary key value used by this instance.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
As with the <fo:inline font-family="monospace">TableJDBCSeq</fo:inline>, the <fo:inline font-family="monospace">
ValueTableJDBCSeq</fo:inline> creates its table automatically during mapping
tool runs. However, you can manually manipulate the table through the class'
<fo:inline font-family="monospace">main</fo:inline> method. See the Javadoc for the
<fo:inline font-family="monospace">ValueTableJDBCSeq.main</fo:inline> method for usage details.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28096"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e28099"><!--
generators
,
native
--></fo:wrapper>
<fo:inline font-family="monospace">native</fo:inline>: This is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/kernel/NativeJDBCSeq.html">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.kernel.NativeJDBCSeq</fo:inline></fo:basic-link>.
Many databases have a concept of "native sequences" - a built-in mechanism for
obtaining incrementing numbers. For example, in Oracle, you can create a
database sequence with a statement like <fo:inline font-family="monospace">CREATE SEQUENCE MYSEQUENCE
</fo:inline>. Sequence values can then be atomically obtained and incremented
with the statement <fo:inline font-family="monospace">SELECT MYSEQUENCE.NEXTVAL FROM DUAL</fo:inline>.
OpenJPA provides support for this common mechanism of sequence generation with
the <fo:inline font-family="monospace"> NativeJDBCSeq</fo:inline>, which accepts the following
properties:
</fo:block><fo:list-block provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e28122"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28123"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Sequence</fo:inline>: The name of the database sequence. Defaults to
<fo:inline font-family="monospace">OPENJPA_SEQUENCE</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28132"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">InitialValue</fo:inline>: The initial sequence value. Defaults to 1.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28138"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Increment</fo:inline>: The amount the sequence increments. Defaults to 1.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28144"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Allocate</fo:inline>: Some database can allocate values in-memory to
service subsequent sequence requests faster.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28150"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:wrapper id="d0e28153"><!--
generators
,
time
--></fo:wrapper>
<fo:inline font-family="monospace">time</fo:inline>: This is an alias for the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/TimeSeededSeq.html">
<fo:inline font-family="monospace">org.apache.openjpa.kernel.TimeSeededSeq</fo:inline></fo:basic-link>. This
type uses an in-memory static counter, initialized to the current time in
milliseconds and monotonically incremented for each value requested. It is only
suitable for single-JVM environments.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can use JPA <fo:inline font-family="monospace">SequenceGenerator</fo:inline>s to describe any built-in
<fo:inline font-family="monospace">Seq</fo:inline>s or your own <fo:inline font-family="monospace">Seq</fo:inline>
implementation. Set the <fo:inline font-family="monospace">sequenceName</fo:inline> attribute to a plugin
string describing your choice. See
<fo:basic-link internal-destination="jpa_overview_mapping_sequence"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 12.5, “
Generators
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_mapping_sequence"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_mapping_sequence"/>]</fo:inline></fo:basic-link> in the JPA Overview for
details on defining <fo:inline font-family="monospace">SequenceGenerator</fo:inline>s.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
See <fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link> for plugin string formatting.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_sequence_named"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 9.8. 
Named Seq Sequence
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28193">
@Entity
@Table(name="AUTO")
public class Author {
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="AuthorSeq")
@SequenceGenerator(name="AuthorSeq" sequence="table(Table=AUTO_SEQ, Increment=100)")
@Column(name="AID")
private long id;
...
}
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Note that if you want to use a plugin string without any arguments, you must
still suffix the plugin type with <fo:inline font-family="monospace">()</fo:inline> to differentiate it from
a sequence name in the <fo:inline font-family="monospace"> SequenceGenerator.sequence</fo:inline> attribute:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28203">
@SequenceGenerator(name="AuthorSeq", sequence="table()")
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA maintains a <fo:inline font-style="italic">system</fo:inline> sequence to generate datastore
identity values for classes that do not declare a specific datastore identity
strategy. You can configure the system sequence through the
<fo:basic-link internal-destination="openjpa.Sequence"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">openjpa.Sequence</fo:inline></fo:inline></fo:basic-link>
configuration property. This property accepts a plugin string describing a
<fo:inline font-family="monospace">Seq</fo:inline> instance.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_sequence_systemex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 9.9. 
System Sequence Configuration
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28220">
&lt;property name="openjpa.Sequence" value="table(Table=OPENJPASEQ, Increment=100)"/&gt;
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In JPA, set your <fo:inline font-family="monospace">GeneratedValue</fo:inline> annotation's <fo:inline font-family="monospace">
strategy</fo:inline> attribute to <fo:inline font-family="monospace">AUTO</fo:inline> to use the configured
system sequence. Or, because <fo:inline font-family="monospace">AUTO</fo:inline> is the default strategy,
use the annotation without attributes:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28236">
@GeneratedValue
private long id;
</fo:block><fo:block id="ref_guide_sequence_runtime"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Runtime Access
</fo:marker><fo:block font-size="17.28pt">9.6.1. 
Runtime Access
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e28241"><!--
Sequence
,
runtime access
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA allows you to access named generators at runtime through the
<fo:inline font-family="monospace">OpenJPAEntityManager.getNamedGenerator</fo:inline> method:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28251">
public Generator getNamedGenerator(String name);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The returned
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/Generator.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.Generator</fo:inline></fo:basic-link> is a
facade over an internal OpenJPA <fo:inline font-family="monospace">Seq</fo:inline>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">OpenJPAEntityManager</fo:inline> includes additional APIs to
retrieve the identity generator of any class, or the generator of any field.
With these APIs, you do not have to know the generator name. Additionally, they
allow you to access the implicit generator used by default for datastore
identity classes. See the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/OpenJPAEntityManager.html">
Javadoc</fo:basic-link> for the <fo:inline font-family="monospace"> OpenJPAEntityManager.getIdentityGenerator
</fo:inline> and <fo:inline font-family="monospace">OpenJPAEntityManager.getFieldGenerator
</fo:inline> methods for API details.
</fo:block></fo:block></fo:block><fo:block id="ref_guide_runtime_pm_event"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Transaction Events
</fo:marker><fo:block font-size="20.735999999999997pt">9.7. 
Transaction Events
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e28280"><!--
transactions
,
events
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The OpenJPA runtime supports broadcasting transaction-related events. By
registering one or more
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/event/TransactionListener.html">
<fo:inline font-family="monospace">org.apache.openjpa.event.TransactionListener</fo:inline></fo:basic-link> s,
you can receive notifications when transactions begin, flush, rollback, commit,
and more. Where appropriate, event notifications include the set of
persistence-capable objects participating in the transaction.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28292">
public void addTransactionListener(Object listener);
public void removeTransactionListener(Object listener);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
These <fo:inline font-family="monospace">OpenJPAEntityManager</fo:inline> methods allow you to add and
remove listeners.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
For details on the transaction framework, see the <fo:inline font-family="monospace">
org.apache.openjpa.event</fo:inline> package
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/event/package.html">Javadoc</fo:basic-link>.
Also see <fo:basic-link internal-destination="ref_guide_event"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 11.2, “
Remote Event Notification Framework
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_event"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_event"/>]</fo:inline></fo:basic-link> for a description of OpenJPA's
remote event support.
</fo:block></fo:block><fo:block id="ref_guide_enterprise_abstractstore"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Non-Relational Stores
</fo:marker><fo:block font-size="20.735999999999997pt">9.8. 
Non-Relational Stores
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
It is possible to adapt OpenJPA to access a non-relational datastore by creating
an implementation of the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/kernel/StoreManager.html"><fo:inline font-family="monospace">
org.apache.openjpa.kernel.StoreManager</fo:inline></fo:basic-link> interface. OpenJPA
provides an abstract <fo:inline font-family="monospace">StoreManager</fo:inline> implementation to
facilitate this process. See the <fo:inline font-family="monospace">org.apache.openjpa.abstractstore
</fo:inline> package <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/abstractstore">
Javadoc</fo:basic-link> for details.
</fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Caching
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Caching
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="ref_guide_caching"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 10. 
Caching
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA utilizes several configurable caches to maximize performance. This
chapter explores OpenJPA's data cache, query cache, and query compilation cache.
</fo:block><fo:block id="ref_guide_cache"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Data Cache
</fo:marker><fo:block font-size="20.735999999999997pt">10.1. 
Data Cache
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e28336"><!--
caching
,
data cache
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The OpenJPA data cache is an optional cache of persistent object data that
operates at the <fo:inline font-family="monospace">EntityManagerFactory</fo:inline> level. This cache is
designed to significantly increase performance while remaining in full
compliance with the JPA standard. This means that turning on the caching option
can transparently increase the performance of your application, with no changes
to your code.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA's data cache is not related to the <fo:inline font-family="monospace">EntityManager</fo:inline>
cache dictated by the JPA specification. The JPA specification mandates behavior
for the <fo:inline font-family="monospace">EntityManager</fo:inline> cache aimed at guaranteeing
transaction isolation when operating on persistent objects.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA's data cache is designed to provide significant performance increases
over cacheless operation, while guaranteeing that behavior will be identical in
both cache-enabled and cacheless operation.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
There are five ways to access data via the OpenJPA APIs: standard relation
traversal, large result set relation traversal, queries, looking up an object by
id, and iteration over an <fo:inline font-family="monospace">Extent</fo:inline>. OpenJPA's cache plugin
accelerates three of these mechanisms. It does not provide any caching of large
result set relations or <fo:inline font-family="monospace">Extent</fo:inline> iterators. If you find
yourself in need of higher-performance <fo:inline font-family="monospace">Extent</fo:inline> iteration,
see <fo:basic-link internal-destination="ref_guide_cache_limits_extent"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Example 10.13, “
Query Replaces Extent
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_cache_limits_extent"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_cache_limits_extent"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block xmlns:rx="http://www.renderx.com/XSL/Extensions" space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="d0e28369"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Table 10.1. 
Data access methods
</fo:block><fo:table border-before-width.conditionality="retain" border-collapse="collapse" border-left-style="solid" border-right-style="solid" border-top-style="solid" border-bottom-style="solid" border-left-width="0.5pt" border-right-width="0.5pt" border-top-width="0.5pt" border-bottom-width="0.5pt" border-left-color="black" border-right-color="black" border-top-color="black" border-bottom-color="black" table-layout="fixed" width="100%"><fo:table-column column-number="1"/><fo:table-column column-number="2"/><fo:table-header start-indent="0pt" end-indent="0pt"><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">Access method</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block font-weight="bold">Uses cache</fo:block></fo:table-cell></fo:table-row></fo:table-header><fo:table-body start-indent="0pt" end-indent="0pt"><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Standard relation traversal
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
Yes
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Large result set relation traversal
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>No</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>Query</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>Yes</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Lookups by object id
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>Yes</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Iteration over an <fo:inline font-family="monospace">Extent</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" text-align="left"><fo:block>No</fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When enabled, the cache is checked before making a trip to the datastore. Data
is stored in the cache when objects are committed and when persistent objects
are loaded from the datastore.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA's data cache can in both single-JVM and multi-JVM environments.
Multi-JVM caching is achieved through the use of the distributed event
notification framework described in <fo:basic-link internal-destination="ref_guide_event"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 11.2, “
Remote Event Notification Framework
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_event"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_event"/>]</fo:inline></fo:basic-link>, or
through custom integrations with a third-party distributed cache.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The single JVM mode of operation maintains and shares a data cache across all
<fo:inline font-family="monospace">EntityManager</fo:inline> instances obtained from a particular
<fo:inline font-family="monospace">EntityManagerFactory</fo:inline>. This is not appropriate for use in
a distributed environment, as caches in different JVMs or created from different
<fo:inline font-family="monospace">EntityManagerFactory</fo:inline> objects will not be synchronized.
</fo:block><fo:block id="ref_guide_cache_conf"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Data Cache Configuration
</fo:marker><fo:block font-size="17.28pt">10.1.1. 
Data Cache Configuration
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To enable the basic single-factory cache set the
<fo:basic-link internal-destination="openjpa.DataCache"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">openjpa.DataCache</fo:inline></fo:inline></fo:basic-link>
property to <fo:inline font-family="monospace">true</fo:inline>, and set the
<fo:basic-link internal-destination="openjpa.RemoteCommitProvider"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.RemoteCommitProvider</fo:inline></fo:inline></fo:basic-link> property to <fo:inline font-family="monospace">sjvm
</fo:inline>:
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_cache_conf_sjvm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 10.1. 
Single-JVM Data Cache
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28449">
&lt;property name="openjpa.DataCache" value="true"/&gt;
&lt;property name="openjpa.RemoteCommitProvider" value="sjvm"/&gt;
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To configure the data cache to remain up-to-date in a distributed environment,
set the <fo:basic-link internal-destination="openjpa.RemoteCommitProvider"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.RemoteCommitProvider</fo:inline></fo:inline></fo:basic-link> property appropriately, or
integrate OpenJPA with a third-party caching solution. Remote commit providers
are described in <fo:basic-link internal-destination="ref_guide_event"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 11.2, “
Remote Event Notification Framework
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_event"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_event"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e28461"><!--
caching
,
size
--></fo:wrapper>
OpenJPA's default implementation maintains a map of object
ids to cache data. By default, 1000 elements are kept in cache. When the cache
overflows, random entries are evicted. The maximum cache size can be
adjusted by setting the <fo:inline font-family="monospace">CacheSize</fo:inline> property in your plugin
string - see below for an example. Objects that are pinned into the cache are
not counted when determining if the cache size exceeds its maximum size.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Expired objects are moved to a soft reference map, so they may stick around for
a little while longer. You can control the number of soft references OpenJPA
keeps with the <fo:inline font-family="monospace">SoftReferenceSize</fo:inline> property. Soft references
are unlimited by default. Set to 0 to disable soft references completely.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_cache_conf_size"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 10.2. 
Data Cache Size
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28478">
&lt;property name="openjpa.DataCache" value="true(CacheSize=5000, SoftReferenceSize=0)"/&gt;
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e28482"><!--
caching
,
timeout
--></fo:wrapper>
You can specify a cache timeout value for a class by setting the timeout
<fo:basic-link internal-destination="ref_guide_meta_ext"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">metadata extension</fo:inline></fo:basic-link> to the amount of
time in milliseconds a class's data is valid. Use a value of -1 for no
expiration. This is the default value.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ex_timeout_cache"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 10.3. 
Data Cache Timeout
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Timeout <fo:inline font-family="monospace">Employee</fo:inline> objects after 10 seconds.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28499">
@Entity
@DataCache(timeout=10000)
public class Employee {
...
}
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
See the <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/DataCache.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.DataCache</fo:inline></fo:basic-link> Javadoc
for more information on the <fo:inline font-family="monospace">DataCache</fo:inline> annotation.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e28513"><!--
caching
,
cron-style invalidation
--></fo:wrapper>
A cache can specify that it should be cleared at certain times rather than using
data timeouts. The <fo:inline font-family="monospace">EvictionSchedule</fo:inline> property of OpenJPA's
cache implementation accepts a <fo:inline font-family="monospace">cron</fo:inline> style eviction schedule.
The format of this property is a whitespace-separated list of five tokens, where
the <fo:inline font-family="monospace">*</fo:inline> symbol (asterisk), indicates match all. The tokens are,
in order:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e28528"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28529"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Minute
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28532"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Hour of Day
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28535"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Day of Month
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28538"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Month
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28541"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Day of Week
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
For example, the following <fo:inline font-family="monospace">openjpa.DataCache</fo:inline> setting
schedules the default cache to evict values from the cache at 15 and 45 minutes
past 3 PM on Sunday.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28549">
true(EvictionSchedule='15,45 15 * * 1')
</fo:block></fo:block><fo:block id="ref_guide_cache_use"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Data Cache Usage
</fo:marker><fo:block font-size="17.28pt">10.1.2. 
Data Cache Usage
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">org.apache.openjpa.datacache</fo:inline> package defines OpenJPA's
data caching framework. While you may use this framework directly (see its
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/datacache/package-summary.html">
Javadoc</fo:basic-link> for details), its APIs are meant primarily for service
providers. In fact, <fo:basic-link internal-destination="ref_guide_cache_extension"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 10.1.4, “
Cache Extension
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_cache_extension"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_cache_extension"/>]</fo:inline></fo:basic-link> below has
tips on how to use this package to extend OpenJPA's caching service yourself.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Rather than use the low-level <fo:inline font-family="monospace">org.apache.openjpa.datacache</fo:inline>
package APIs, JPA users should typically access the data cache through OpenJPA's
high-level
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/StoreCache.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.StoreCache</fo:inline></fo:basic-link> facade.
This facade has methods to pin and unpin records, evict data from the cache, and
more.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28574">
public StoreCache getStoreCache();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You obtain the <fo:inline font-family="monospace">StoreCache</fo:inline> through the <fo:inline font-family="monospace">
OpenJPAEntityManagerFactory.getStoreCache</fo:inline> method.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_cache_access_jpa"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 10.4. 
Accessing the StoreCache
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28587">
import org.apache.openjpa.persistence.*;
...
OpenJPAEntityManagerFactory oemf = OpenJPAPersistence.cast(emf);
StoreCache cache = oemf.getStoreCache();
...
</fo:block></fo:block></fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28589">
public void evict(Class cls, Object oid);
public void evictAll();
public void evictAll(Class cls, Object... oids);
public void evictAll(Class cls, Collection oids);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">evict</fo:inline> methods tell the cache to release data. Each
method takes an entity class and one or more identity values, and releases the
cached data for the corresponding persistent instances. The <fo:inline font-family="monospace">
evictAll</fo:inline> method with no arguments clears the cache. Eviction is
useful when the datastore is changed by a separate process outside OpenJPA's
control. In this scenario, you typically have to manually evict the data from
the datastore cache; otherwise the OpenJPA runtime, oblivious to the changes,
will maintain its stale copy.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28599">
public void pin(Class cls, Object oid);
public void pinAll(Class cls, Object... oids);
public void pinAll(Class cls, Collection oids);
public void unpin(Class cls, Object oid);
public void unpinAll(Class cls, Object... oids);
public void unpinAll(Class cls, Collection oids);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Most caches are of limited size. Pinning an identity to the cache ensures that
the cache will will not kick the data for the corresponding instance out of the
cache, unless you manually evict it. Note that even after manual eviction, the
data will get pinned again the next time it is fetched from the store. You can
only remove a pin and make the data once again available for normal cache
overflow eviction through the <fo:inline font-family="monospace">unpin</fo:inline> methods. Use
pinning when you want a guarantee that a certain object will always be available
from cache, rather than requiring a datastore trip.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_cache_use_jpa"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 10.5. 
StoreCache Usage
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28609">
import org.apache.openjpa.persistence.*;
...
OpenJPAEntityManagerFactory oemf = OpenJPAPersistence.cast(emf);
StoreCache cache = oemf.getStoreCache();
cache.pin(Magazine.class, popularMag.getId());
cache.evict(Magazine.class, changedMag.getId());
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
See the <fo:inline font-family="monospace">StoreCache</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/StoreCache.html">
Javadoc</fo:basic-link> for information on additional functionality it provides. Also,
<fo:basic-link internal-destination="ref_guide_runtime"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Chapter 9, <fo:inline font-style="italic">
Runtime Extensions
</fo:inline></fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_runtime"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_runtime"/>]</fo:inline></fo:basic-link> discusses OpenJPA's other extensions
to the standard set of JPA runtime interfaces.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The examples above include calls to <fo:inline font-family="monospace">evict</fo:inline> to manually
remove data from the data cache. Rather than evicting objects from the data
cache directly, you can also configure OpenJPA to automatically evict objects
from the data cache when you use the <fo:inline font-family="monospace">
OpenJPAEntityManager</fo:inline>'s eviction APIs.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_cache_pmevict"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 10.6. 
Automatic Data Cache Eviction
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28632">
&lt;property name="openjpa.BrokerImpl" value="EvictFromDataCache=true"/&gt;
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28634">
import org.apache.openjpa.persistence.*;
...
OpenJPAEntityManager oem = OpenJPAPersistence.cast(em);
oem.evict(changedMag); // will evict from data cache also
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_cache_query"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Query Cache
</fo:marker><fo:block font-size="17.28pt">10.1.3. 
Query Cache
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e28639"><!--
caching
,
query cache
--></fo:wrapper><fo:wrapper id="d0e28644"><!--
Query
,
result caching
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In addition to the data cache, the <fo:inline font-family="monospace">org.apache.openjpa.datacache
</fo:inline> package defines service provider interfaces for a query cache. The
query cache is enabled by default when the data cache is enabled. The query
cache stores the object ids returned by query executions. When you run a query,
OpenJPA assembles a key based on the query properties and the parameters used at
execution time, and checks for a cached query result. If one is found, the
object ids in the cached result are looked up, and the resultant
persistence-capable objects are returned. Otherwise, the query is executed
against the database, and the object ids loaded by the query are put into the
cache. The object id list is not cached until the list returned at query
execution time is fully traversed.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA exposes a high-level interface to the query cache through the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/QueryResultCache.html">
<fo:inline font-family="monospace">org.apache.openjpa.persistence.QueryResultCache</fo:inline></fo:basic-link>
class. You can access this class through the <fo:inline font-family="monospace">
OpenJPAEntityManagerFactory</fo:inline>.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_cache_queryaccess"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 10.7. 
Accessing the QueryResultCache
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28667">
import org.apache.openjpa.persistence.*;
...
OpenJPAEntityManagerFactory oemf = OpenJPAPersistence.cast(emf);
QueryResultCache qcache = oemf.getQueryResultCache();
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The default query cache implementation caches 100 query executions in a
least-recently-used cache. This can be changed by setting the cache size in the
<fo:inline font-family="monospace">CacheSize</fo:inline> plugin property. Like the data cache, the query
cache also has a backing soft reference map. The <fo:inline font-family="monospace">SoftReferenceSize
</fo:inline> property controls the size of this map. It is disabled by default.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_cache_cachesize"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 10.8. 
Query Cache Size
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28680">
&lt;property name="openjpa.QueryCache" value="CacheSize=1000, SoftReferenceSize=100"/&gt;
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To disable the query cache completely, set the <fo:inline font-family="monospace">openjpa.QueryCache
</fo:inline> property to <fo:inline font-family="monospace">false</fo:inline>:
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_cache_disablequery"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 10.9. 
Disabling the Query Cache
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28693">
&lt;property name="openjpa.QueryCache" value="false"/&gt;
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
There are certain situations in which the query cache is bypassed:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e28697"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28698"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Caching is not used for in-memory queries (queries in which the candidates are a
collection instead of a class or <fo:inline font-family="monospace">Extent</fo:inline>).
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28704"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Caching is not used in transactions that have <fo:inline font-family="monospace">IgnoreChanges</fo:inline>
set to <fo:inline font-family="monospace">false</fo:inline> and in which modifications to classes in the
query's access path have occurred. If none of the classes in the access path
have been touched, then cached results are still valid and are used.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28713"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Caching is not used in pessimistic transactions, since OpenJPA must go to the
database to lock the appropriate rows.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28716"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Caching is not used when the the data cache does not have any cached data for an
id in a query result.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28719"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Queries that use persistence-capable objects as parameters are only cached if
the parameter is directly compared to field, as in:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28722">
select e from Employee e where e.company.address = :addr
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If you extract field values from the parameter in your query string, or if the
parameter is used in collection element comparisons, the query is not cached.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28726"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Queries that result in projections of custom field types or <fo:inline font-family="monospace">
BigDecimal</fo:inline> or <fo:inline font-family="monospace">BigInteger</fo:inline> fields are not
cached.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Cache results are removed from the cache when instances of classes in a cached
query's access path are touched. That is, if a query accesses data in class
<fo:inline font-family="monospace">A</fo:inline>, and instances of class <fo:inline font-family="monospace">A</fo:inline> are
modified, deleted, or inserted, then the cached query result is dropped from the
cache.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
It is possible to tell the query cache that a class has been altered. This is
only necessary when the changes occur via direct modification of the database
outside of OpenJPA's control. You can also evict individual queries, or clear
the entire cache.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28745">
public void evict(Query q);
public void evictAll(Class cls);
public void evictAll();
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
For JPA queries with parameters, set the desired parameter values into the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api/javax/persistence/Query.html">
<fo:inline font-family="monospace">Query</fo:inline></fo:basic-link> instance before calling the above methods.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_cache_query_classchange"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 10.10. 
Evicting Queries
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28757">
import org.apache.openjpa.persistence.*;
...
OpenJPAEntityManagerFactory oemf = OpenJPAPersistence.cast(emf);
QueryResultCache qcache = oemf.getQueryResultCache();
// evict all queries that can be affected by changes to Magazines
qcache.evictAll(Magazine.class);
// evict an individual query with parameters
EntityManager em = emf.createEntityManager();
Query q = em.createQuery(...).
setParameter(0, paramVal0).
setParameter(1, paramVal1);
qcache.evict (q);
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When using one of OpenJPA's distributed cache implementations, it is necessary
to perform this in every JVM - the change notification is not propagated
automatically. When using a third-party coherent caching solution,
it is not necessary to do this in every JVM (although it won't hurt to do so),
as the cache results are stored directly in the coherent cache.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Queries can also be pinned and unpinned through the <fo:inline font-family="monospace">
QueryResultCache</fo:inline>. The semantics of these operations are the same
as pinning and unpinning data from the data cache.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28766">
public void pin(Query q);
public void unpin(Query q);
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
For JPA queries with parameters, set the desired parameter values into the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api/javax/persistence/Query.html">
<fo:inline font-family="monospace">Query</fo:inline></fo:basic-link> instance before calling the above methods.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The following example shows these APIs in action.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_cache_query_pin"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 10.11. 
Pinning, and Unpinning Query Results
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28780">
import org.apache.openjpa.persistence.*;
...
OpenJPAEntityManagerFactory oemf = OpenJPAPersistence.cast(emf);
QueryResultCache qcache = oemf.getQueryResultCache();
EntityManager em = emf.createEntityManager();
Query pinQuery = em.createQuery(...).
setParameter(0, paramVal0).
setParameter(1, paramVal1);
qcache.pin(pinQuery);
Query unpinQuery = em.createQuery(...).
setParameter(0, paramVal0).
setParameter(1, paramVal1);
qcache.unpin(unpinQuery);
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Pinning data into the cache instructs the cache to not expire the pinned results
when cache flushing occurs. However, pinned results will be removed from the
cache if an event occurs that invalidates the results.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can disable caching on a per-<fo:inline font-family="monospace">EntityManager</fo:inline> or
per-<fo:inline font-family="monospace">Query</fo:inline> basis:
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_cache_query_disable"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 10.12. 
Disabling and Enabling Query Caching
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28795">
import org.apache.openjpa.persistence.*;
...
// temporarily disable query caching for all queries created from em
OpenJPAEntityManager oem = OpenJPAPersistence.cast(em);
oem.getFetchPlan ().setQueryResultCache(false);
// re-enable caching for a particular query
OpenJPAQuery oq = oem.createQuery(...);
oq.getFetchPlan().setQueryResultCache(true);
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_cache_extension"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Cache Extension
</fo:marker><fo:block font-size="17.28pt">10.1.4. 
Cache Extension
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e28800"><!--
caching
,
data cache
,
extension
--></fo:wrapper><fo:wrapper id="d0e28807"><!--
caching
,
query cache
,
extension
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The provided data cache classes can be easily extended to add additional
functionality. If you are adding new behavior, you should extend <fo:inline font-family="monospace">
org.apache.openjpa.datacache.DataCacheImpl</fo:inline>. To use your own storage
mechanism, extend <fo:inline font-family="monospace">org.apache.openjpa.datacache.AbstractDataCache
</fo:inline>, or implement <fo:inline font-family="monospace">org.apache.openjpa.datacache.DataCache
</fo:inline> directly. If you want to implement a distributed cache that uses an
unsupported method for communications, create an implementation of <fo:inline font-family="monospace">
org.apache.openjpa.event.RemoteCommitProvider</fo:inline>. This process is
described in greater detail in
<fo:basic-link internal-destination="ref_guide_event_customization"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 11.2.2, “
Customization
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_event_customization"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_event_customization"/>]</fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The query cache is just as easy to extend. Add functionality by extending the
default <fo:inline font-family="monospace">org.apache.openjpa.datacache.QueryCacheImpl</fo:inline>.
Implement your own storage mechanism for query results by extending <fo:inline font-family="monospace">
org.apache.openjpa.datacache.AbstractQueryCache</fo:inline> or implementing the
<fo:inline font-family="monospace">org.apache.openjpa.datacache.QueryCache</fo:inline> interface
directly.
</fo:block></fo:block><fo:block id="ref_guide_cache_notes"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Important Notes
</fo:marker><fo:block font-size="17.28pt">10.1.5. 
Important Notes
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e28844"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28845"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The default cache implementations <fo:inline font-style="italic">do not</fo:inline> automatically
refresh objects in other <fo:inline font-family="monospace">EntityManager</fo:inline>s when the cache
is updated or invalidated. This behavior would not be compliant with the JPA
specification.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28854"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Invoking <fo:inline font-family="monospace">OpenJPAEntityManager.evict</fo:inline><fo:inline font-style="italic"> does not
</fo:inline> result in the corresponding data being dropped from the data cache,
unless you have set the proper configuration options as explained above (see
<fo:basic-link internal-destination="ref_guide_cache_pmevict"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Example 10.6, “
Automatic Data Cache Eviction
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_cache_pmevict"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_cache_pmevict"/>]</fo:inline></fo:basic-link>). Other methods related to the
<fo:inline font-family="monospace">EntityManager</fo:inline> cache also do not affect the data cache.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The data cache assumes that it is up-to-date with respect to the datastore, so
it is effectively an in-memory extension of the database. To manipulate the data
cache, you should generally use the data cache facades presented in this
chapter.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28869"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
You must specify a <fo:inline font-family="monospace">org.apache.openjpa.event.RemoteCommitProvider
</fo:inline> (via the <fo:basic-link internal-destination="openjpa.RemoteCommitProvider"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.RemoteCommitProvider</fo:inline></fo:inline></fo:basic-link> property) in order to use the data
cache, even when using the cache in a single-JVM mode. When using it in a
single-JVM context, set this property to <fo:inline font-family="monospace">sjvm</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block><fo:block id="datastore_cache_issues"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Known Issues and Limitations
</fo:marker><fo:block font-size="17.28pt">10.1.6. 
Known Issues and Limitations
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e28885"><!--
caching
,
issues and limitations
--></fo:wrapper><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e28890"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28891"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
When using datastore (pessimistic) transactions in concert with the distributed
caching implementations, it is possible to read stale data when reading data
outside a transaction.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
For example, if you have two JVMs (JVM A and JVM B) both communicating with each
other, and JVM A obtains a data store lock on a particular object's underlying
data, it is possible for JVM B to load the data from the cache without going to
the datastore, and therefore load data that should be locked. This will only
happen if JVM B attempts to read data that is already in its cache during the
period between when JVM A locked the data and JVM B received and processed the
invalidation notification.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This problem is impossible to solve without putting together a two-phase commit
system for cache notifications, which would add significant overhead to the
caching implementation. As a result, we recommend that people use optimistic
locking when using data caching. If you do not, then understand that some of
your non-transactional data may not be consistent with the datastore.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Note that when loading objects in a transaction, the appropriate datastore
transactions will be obtained. So, transactional code will maintain its
integrity.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e28900"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Extent</fo:inline>s are not cached. So, if you plan on iterating
over a list of all the objects in an <fo:inline font-family="monospace">Extent</fo:inline> on a regular
basis, you will only benefit from caching if you do so with a <fo:inline font-family="monospace">Query
</fo:inline> instead:
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_cache_limits_extent"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 10.13. 
Query Replaces Extent
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e28915">
import org.apache.openjpa.persistence.*;
...
OpenJPAEntityManager oem = OpenJPAPersistence.cast(em);
Extent extent = oem.getExtent(Magazine.class, false);
// This iterator does not benefit from caching...
Iterator uncachedIterator = extent.iterator();
// ... but this one does.
OpenJPAQuery extentQuery = oem.createQuery(...);
extentQuery.setSubclasses(false);
Iterator cachedIterator = extentQuery.getResultList().iterator();
</fo:block></fo:block></fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="ref_guide_cache_querycomp"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Query Compilation Cache
</fo:marker><fo:block font-size="20.735999999999997pt">10.2. 
Query Compilation Cache
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e28920"><!--
caching
,
query compilation cache
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The query compilation cache is a <fo:inline font-family="monospace">Map</fo:inline> used to cache
parsed query strings. As a result, most queries are only parsed once in
OpenJPA, and cached thereafter. You can control the compilation cache through
the <fo:basic-link internal-destination="openjpa.QueryCompilationCache"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.QueryCompilationCache</fo:inline></fo:inline></fo:basic-link> configuration property. This
property accepts a plugin string (see <fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>)
describing the <fo:inline font-family="monospace">Map</fo:inline> used to associate query strings and
their parsed form. This property accepts the following aliases:
</fo:block><fo:block xmlns:rx="http://www.renderx.com/XSL/Extensions" space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="d0e28939"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Table 10.2. 
Pre-defined aliases
</fo:block><fo:table border-before-width.conditionality="retain" border-collapse="collapse" border-left-style="solid" border-right-style="solid" border-top-style="solid" border-bottom-style="solid" border-left-width="0.5pt" border-right-width="0.5pt" border-top-width="0.5pt" border-bottom-width="0.5pt" border-left-color="black" border-right-color="black" border-top-color="black" border-bottom-color="black" table-layout="fixed" width="100%"><fo:table-column column-number="1"/><fo:table-column column-number="2"/><fo:table-header start-indent="0pt" end-indent="0pt"><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">Alias</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block font-weight="bold">Value</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block font-weight="bold">Notes</fo:block></fo:table-cell></fo:table-row></fo:table-header><fo:table-body start-indent="0pt" end-indent="0pt"><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-family="monospace">true</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
<fo:inline font-family="monospace">org.apache.openjpa.util.CacheMap</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
The default option. Uses a
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/util/CacheMap.html">
<fo:inline font-family="monospace">CacheMap</fo:inline></fo:basic-link> to store compilation data.
<fo:inline font-family="monospace">CacheMap</fo:inline> maintains a fixed number of cache entries, and an
optional soft reference map for entries that are moved out of the LRU space.
So, for applications that have a monotonically increasing number of distinct
queries, this option can be used to ensure that a fixed amount of memory is
used by the cache.
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block><fo:inline font-family="monospace">all</fo:inline></fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
<fo:inline font-family="monospace">org.apache.openjpa.lib.util.ConcurrentHashMap</fo:inline>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
This is the fastest option, but compilation data is never dropped from the
cache, so if you use a large number of dynamic queries, this option may result
in ever-increasing memory usage. Note that if your queries only differ in the
values of the parameters, this should not be an issue.
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block><fo:inline font-family="monospace">false</fo:inline></fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" text-align="left"><fo:block><fo:inline font-style="italic">none</fo:inline></fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" text-align="left"><fo:block>
Disables the compilation cache.
</fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Remote and Offline Operation
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Remote and Offline Operation
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="ref_guide_remote"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 11. 
Remote and Offline Operation
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29000"><!--
remote
--></fo:wrapper><fo:wrapper id="d0e29003"><!--
offline
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The standard JPA runtime environment is <fo:inline font-style="italic">local</fo:inline> and
<fo:inline font-style="italic">online</fo:inline>. It is <fo:inline font-style="italic">local</fo:inline> in that components
such as <fo:inline font-family="monospace">EntityManager</fo:inline>s and queries connect directly to
the datastore and execute their actions in the same JVM as the code using them.
It is <fo:inline font-style="italic">online</fo:inline> in that all changes to managed objects must be
made in the context of an active <fo:inline font-family="monospace"> EntityManager</fo:inline>. These
two properties, combined with the fact that <fo:inline font-family="monospace">
EntityManager</fo:inline>s cannot be serialized for storage or network transfer,
make the standard JPA runtime difficult to incorporate into some enterprise and
client/server program designs.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA extends the standard runtime to add <fo:inline font-style="italic">remote</fo:inline> and
<fo:inline font-style="italic">offline</fo:inline> capabilities in the form of enhanced
<fo:basic-link internal-destination="ref_guide_detach"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Detach and Attach APIs</fo:inline></fo:basic-link> and
<fo:basic-link internal-destination="ref_guide_event"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Remote Commit Events</fo:inline></fo:basic-link>. The following
sections explain these capabilities in detail.
</fo:block><fo:block id="ref_guide_detach"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Detach and Attach
</fo:marker><fo:block font-size="20.735999999999997pt">11.1. 
Detach and Attach
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29048"><!--
detachment
--></fo:wrapper><fo:wrapper id="d0e29051"><!--
attachment
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The JPA Overview describes the specification's standard detach and attach APIs
in <fo:basic-link internal-destination="jpa_overview_em_lifecycle"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 8.2, “
Entity Lifecycle Management
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="jpa_overview_em_lifecycle"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="jpa_overview_em_lifecycle"/>]</fo:inline></fo:basic-link>. This section enumerates
OpenJPA's enhancements to the standard behavior.
</fo:block><fo:block id="ref_guide_detach_behavior"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Detach Behavior
</fo:marker><fo:block font-size="17.28pt">11.1.1. 
Detach Behavior
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29063"><!--
detachment
,
behavior
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In JPA, objects detach automatically when they are serialized or when a
<fo:basic-link internal-destination="jpa_overview_emfactory_perscontext"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">persistence context</fo:inline></fo:basic-link>
ends. The specification does not define any way to explicitly detach objects.
The extended
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/OpenJPAEntityManager.html">
<fo:inline font-family="monospace">OpenJPAEntityManager</fo:inline></fo:basic-link>, however, allows you to
explicitly detach objects at any time.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e29078">
public Object detach(Object pc):
public Object[] detachAll(Object... pcs):
public Collection detachAll(Collection pcs):
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Each detach method returns detached copies of the given instances. The copy
mechanism is similar to serialization, except that only certain fields are
traversed. We will see how to control which fields are detached in a later
section.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e29084"><!--
detachment
,
of dirty objects
--></fo:wrapper>
When detaching an instance that has been modified in the current transaction
(and thus made dirty), the current transaction is flushed. This means that when
subsequently re-attaching the detached instances, OpenJPA assumes that the
transaction from which they were originally detached was committed; if it has
been rolled back, then the re-attachment process will throw an optimistic
concurrency exception.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can stop OpenJPA from assuming the transaction will commit by invoking
<fo:inline font-family="monospace">OpenJPAEntityManager.setRollbackOnly</fo:inline> prior to detaching
your objects. Setting the <fo:inline font-family="monospace">RollbackOnly</fo:inline> flag prevents OpenJPA
from flushing when detaching dirty objects; instead OpenJPA just runs its
pre-flush actions (see the <fo:inline font-family="monospace">OpenJPAEntityManager.preFlush
</fo:inline>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/OpenJPAEntityManager.html">
Javadoc</fo:basic-link> for details).
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This allows you to use the same instances in multiple
attach/modify/detach/rollback cycles. Alternatively, you might also prevent a
flush by making your modifications outside of a transaction (with <fo:inline font-family="monospace">
NontransactionalWrite</fo:inline> enabled) before detaching.
</fo:block></fo:block><fo:block id="ref_guide_attach_behavior"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Attach Behavior
</fo:marker><fo:block font-size="17.28pt">11.1.2. 
Attach Behavior
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29112"><!--
attachment
,
behavior
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When attaching, OpenJPA uses several strategies to determine the optimal way to
merge changes made to the detached instance. As you will see, these strategies
can even be used to attach changes made to a transient instance which was never
detached in the first place.
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e29119"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29120"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If the instance was detached and <fo:basic-link internal-destination="ref_guide_detach_graph"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">
detached state</fo:inline></fo:basic-link> is enabled, OpenJPA will use the detached state to
determine the object's version and primary key values. In addition, this state
will tell OpenJPA which fields were loaded at the time of detach, and in turn
where to expect changes. Loaded detached fields with null values will set the
attached instance's corresponding fields to null.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29126"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If the instance has a <fo:inline font-family="monospace">Version</fo:inline> field,
OpenJPA will consider the object detached if the version field has a non-default
value, and new otherwise.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When attaching null fields in these cases, OpenJPA cannot distinguish between a
field that was unloaded and one that was intentionally set to null. In this
case, OpenJPA will use the current <fo:basic-link internal-destination="ref_guide_detach_graph"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">
detach state</fo:inline></fo:basic-link> setting to determine how to handle null fields: fields that
would have been included in the detached state are treated as loaded, and will
in turn set the corresponding attached field to null.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29137"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
If neither of the above cases apply, OpenJPA will check to see if an instance
with the same primary key values exists in the database. If so, the object is
considered detached. Otherwise, it is considered new.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
These strategies will be assigned on a per-instance basis, such that during the
attachment of an object graph more than one of the above strategies may be used.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If you attempt to attach a versioned instance whose representation has changed
in the datastore since detachment, OpenJPA will throw an optimistic concurrency
exception upon commit or flush, just as if a normal optimistic conflict was
detected. When attaching an instance whose database record has been deleted
since detaching, or when attaching a detached instance into a manager that has a
stale version of the object, OpenJPA will throw an optimistic concurrency
exception from the attach method. In these cases, OpenJPA sets the <fo:inline font-family="monospace">
RollbackOnly</fo:inline> flag on the transaction.
</fo:block></fo:block><fo:block id="ref_guide_detach_graph"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Defining the Detached Object Graph
</fo:marker><fo:block font-size="17.28pt">11.1.3. 
Defining the Detached Object Graph
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29150"><!--
detachment
,
defining the object graph
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When detached objects lose their association with the OpenJPA runtime, they also
lose the ability to load additional state from the datastore. It is important,
therefore, to populate objects with all the persistent state you will need
before detaching them. While you are free to do this manually, OpenJPA includes
facilities for automatically populating objects when they detach. The
<fo:basic-link internal-destination="openjpa.DetachState"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">openjpa.DetachState</fo:inline>
</fo:inline></fo:basic-link> configuration property determines which fields and relations are
detached by default. All settings are recursive. They are:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.2em" id="d0e29162"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29163"><fo:list-item-label end-indent="label-end()"><fo:block>1.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">loaded</fo:inline>: Detach all fields and relations that are already
loaded, but don't include unloaded fields in the detached graph. This is the
default.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29169"><fo:list-item-label end-indent="label-end()"><fo:block>2.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">fetch-groups</fo:inline>: Detach all fields and relations in the current
<fo:basic-link internal-destination="ref_guide_runtime"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">fetch configuration</fo:inline></fo:basic-link>. For more
information on custom fetch groups, see <fo:basic-link internal-destination="ref_guide_fetch"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.6, “
Fetch Groups
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_fetch"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_fetch"/>]</fo:inline></fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29180"><fo:list-item-label end-indent="label-end()"><fo:block>3.</fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">all</fo:inline>: Detach all fields and relations. Be very careful when
using this mode; if you have a highly-connected domain model, you could end up
bringing every object in the database into memory!
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Any field that is not included in the set determined by the detach mode is set
to its Java default value in the detached instance.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The <fo:inline font-family="monospace">openjpa.DetachState</fo:inline> option is actually a plugin string
(see <fo:basic-link internal-destination="ref_guide_conf_plugins"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.4, “
Plugin Configuration
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_plugins"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_plugins"/>]</fo:inline></fo:basic-link>) that allows you to also
configure the following options related to detached state:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e29195"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29196"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">DetachedStateField</fo:inline>: As described in
<fo:basic-link internal-destination="ref_guide_attach_behavior"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 11.1.2, “
Attach Behavior
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_attach_behavior"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_attach_behavior"/>]</fo:inline></fo:basic-link> above, OpenJPA can take
advantage of a <fo:inline font-style="italic">detached state field</fo:inline> to make the attach
process more efficient. This field is added by the enhancer and is not visible
to your application. Set this property to one of the following values:
</fo:block><fo:list-block provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e29207"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29208"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">transient</fo:inline>: Use a transient detached state field. This gives
the benefits of a detached state field to local objects that are never
serialized, but retains serialization compatibility for client tiers without
access to the enhanced versions of your classes. This is the default.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29214"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">true</fo:inline>: Use a non-transient detached state field so that
objects crossing serialization barriers can still be attached efficiently. This
requires, however, that your client tier have the enhanced versions of your
classes and the OpenJPA libraries.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29220"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">false</fo:inline>: Do not use a detached state field.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can override the setting of this property or declare your own detached state
field on individual classes using OpenJPA's metadata extensions. See
<fo:basic-link internal-destination="ref_guide_detach_field"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 11.1.3.1, “
Detached State Field
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_detach_field"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_detach_field"/>]</fo:inline></fo:basic-link> below.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29230"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">DetachedStateManager</fo:inline>: Whether to use a detached state
manager. A detached state manager makes attachment much more efficient. Like a
detached state field, however, it breaks serialization compatibility with the
unenhanced class if it isn't transient.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
This setting piggybacks on the <fo:inline font-family="monospace">DetachedStateField</fo:inline> setting
above. If your detached state field is transient, the detached state manager
will also be transient. If the detached state field is disabled, the detached
state manager will also be disabled. This is typically what you'll want. By
setting <fo:inline font-family="monospace"> DetachedStateField</fo:inline> to true (or transient) and
setting this property to false, however, you can use a detached state field
<fo:inline font-weight="bold">without</fo:inline> using a detached state manager. This
may be useful for debugging or for legacy OpenJPA users who find differences
between OpenJPA's behavior with a detached state manager and OpenJPA's older
behavior without one.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29247"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">AccessUnloaded</fo:inline>: Whether to allow access to unloaded fields
of detached objects. Defaults to true. Set to false to throw an exception
whenever an unloaded field is accessed. This option is only available when you
use detached state managers, as determined by the settings above.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_detach_graph_confex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 11.1. 
Configuring Detached State
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e29256">
&lt;property name="openjpa.DetachState" value="fetch-groups(DetachedStateField=true)"/&gt;
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can also alter the set of fields that will be included in the detached graph
at runtime.
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/OpenJPAEntityManager.html">
<fo:inline font-family="monospace">OpenJPAEntityManager</fo:inline></fo:basic-link>s expose the following APIs
for controlling detached state:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e29265">
public static final int DETACH_LOADED;
public static final int DETACH_FETCH_GROUPS;
public static final int DETACH_ALL;
public int getDetachState();
public void setDetachState(int mode);
</fo:block><fo:block id="ref_guide_detach_field"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">11.1.3.1. 
Detached State Field
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29270"><!--
detachment
,
detached state field
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When the detached state field is enabled, the OpenJPA enhancer adds an
additional field to the enhanced version of your class. This field of type
<fo:inline font-family="monospace">Object</fo:inline>. OpenJPA uses this field for bookkeeping
information, such as the versioning data needed to detect optimistic concurrency
violations when the object is re-attached.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
It is possible to define this detached state field yourself. Declaring this
field in your class metadata prevents the enhancer from adding any extra fields
to the class, and keeps the enhanced class serialization-compatible with the
unenhanced version. The detached state field must not be persistent. See
<fo:basic-link internal-destination="detached-state-field"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 6.3.1.3, “
Detached State
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="detached-state-field"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="detached-state-field"/>]</fo:inline></fo:basic-link> for details on how to declare a
detached state field.
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e29284">
import org.apache.openjpa.persistence.*;
@Entity
public class Magazine
implements Serializable {
private String name;
@DetachedState private Object state;
...
}
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_event"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Remote Event Notification Framework
</fo:marker><fo:block font-size="20.735999999999997pt">11.2. 
Remote Event Notification Framework
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29289"><!--
remote
,
events
--></fo:wrapper><fo:wrapper id="d0e29294"><!--
events
,
remote
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e29303"><!--
remote
,
events
,
RemoteCommitProvider
--></fo:wrapper>
<fo:wrapper id="d0e29311"><!--
remote
,
events
,
RemoteCommitListener
--></fo:wrapper>
The remote event notification framework allows a subset of the information
available through OpenJPA's transaction events (see
<fo:basic-link internal-destination="ref_guide_runtime_pm_event"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 9.7, “
Transaction Events
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_runtime_pm_event"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_runtime_pm_event"/>]</fo:inline></fo:basic-link>) to be broadcast to remote
listeners. OpenJPA's <fo:basic-link internal-destination="ref_guide_cache"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">data cache</fo:inline></fo:basic-link>, for
example, uses remote events to remain synchronized when deployed in multiple
JVMs.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To enable remote events, you must configure the <fo:inline font-family="monospace"> EntityManagerFactory
</fo:inline> to use a <fo:inline font-family="monospace">RemoteCommitProvider</fo:inline> (see below).
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
When a <fo:inline font-family="monospace">RemoteCommitProvider</fo:inline> is properly configured, you can
register
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/event/RemoteCommitListener.html">
<fo:inline font-family="monospace">RemoteCommitListener</fo:inline></fo:basic-link>s that will be alerted with
a list of modified object ids whenever a transaction on a remote machine
successfully commits.
</fo:block><fo:block id="ref_guide_event_conf"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Remote Commit Provider Configuration
</fo:marker><fo:block font-size="17.28pt">11.2.1. 
Remote Commit Provider Configuration
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29345"><!--
remote
,
events
,
configuration
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA includes built in remote commit providers for JMS and TCP communication.
</fo:block><fo:block id="ref_guide_event_conf_jms"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">11.2.1.1. 
JMS
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29357"><!--
remote
,
events
,
JMS
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The JMS remote commit provider can be configured by setting the
<fo:basic-link internal-destination="openjpa.RemoteCommitProvider"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.RemoteCommitProvider</fo:inline></fo:inline></fo:basic-link> property to contain the
appropriate configuration properties. The JMS provider understands the following
properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e29370"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29371"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Topic</fo:inline>: The topic that the remote commit provider should
publish notifications to and subscribe to for notifications sent from other
JVMs. Defaults to <fo:inline font-family="monospace">topic/OpenJPACommitProviderTopic</fo:inline>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29380"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">TopicConnectionFactory</fo:inline>: The JNDI name of a <fo:inline font-family="monospace">
javax.jms.TopicConnectionFactory</fo:inline> factory to use for finding topics.
Defaults to <fo:inline font-family="monospace"> java:/ConnectionFactory</fo:inline>. This setting may vary
depending on the application server in use; consult the application server's
documentation for details of the default JNDI name for the <fo:inline font-family="monospace">
javax.jms.TopicConnectionFactory</fo:inline> instance. For example, under
Weblogic, the JNDI name for the TopicConnectionFactory is <fo:inline font-family="monospace">
javax.jms.TopicConnectionFactory</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29398"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">ExceptionReconnectAttempts</fo:inline>: The number of times to attempt
to reconnect if the JMS system notifies OpenJPA of a serious connection error.
Defaults to 0, meaning OpenJPA will log the error but otherwise ignore it,
hoping the connection is still valid.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29404"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">*</fo:inline>: All other configuration properties will be interpreted as
settings to pass to the JNDI <fo:inline font-family="monospace">InitialContext</fo:inline> on
construction. For example, you might set the <fo:inline font-family="monospace">java.naming.provider.url
</fo:inline> property to the URL of the context provider.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To configure a factory to use the JMS provider, your properties might look like
the following:
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" margin-left="0.25in" margin-right="0.25in" id="d0e29418"><fo:block font-size="15pt" font-weight="bold" hyphenate="false" keep-with-next.within-column="always" font-style="bold" text-align="center" color="#FFFFFF" background-color="#17184A" border-color="#000000" border-style="solid" border-width="0px" padding-left="0.2cm" padding-right="0.2cm">Note</fo:block><fo:block background-color="#B0B3B2" border-color="#000000" border-style="solid" border-width="0px" padding-top="0.2cm" padding-bottom="0.2cm" padding-left="0.2cm" padding-right="0.2cm"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Because of the nature of JMS, it is important that you invoke <fo:inline font-family="monospace">
EntityManagerFactory.close</fo:inline> when finished with a factory. If you do
not do so, a daemon thread will stay up in the JVM, preventing the JVM from
exiting.
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_event_conf_tcp"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">11.2.1.2. 
TCP
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29427"><!--
remote
,
events
,
TCP
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The TCP remote commit provider has several options that are defined as host
specifications containing a host name or IP address and an optional port
separated by a colon. For example, the host specification <fo:inline font-family="monospace">
saturn.bea.com:1234</fo:inline> represents an <fo:inline font-family="monospace">InetAddress</fo:inline>
retrieved by invoking <fo:inline font-family="monospace">InetAddress.getByName("saturn.bea.com")
</fo:inline> and a port of 1234.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:wrapper id="d0e29447"><!--
TCP provider
--></fo:wrapper>
The TCP provider can be configured by setting the <fo:inline font-family="monospace">
openjpa.RemoteCommitProvider</fo:inline> plugin property to contain the
appropriate configuration settings. The TCP provider understands the following
properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e29454"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29455"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Port</fo:inline>: The TCP port that the provider should listen on for
commit notifications. Defaults to 5636.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29461"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">Addresses</fo:inline>: A semicolon-separated list of IP addresses to
which notifications should be sent. No default value.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29467"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">NumBroadcastThreads</fo:inline>: The number of threads to create for the
purpose of transmitting events to peers. You sould increase this value as the
number of concurrent transactions increases. The maximum number of concurrent
transactions is a function of the size of the connection pool. See the the
<fo:inline font-family="monospace">MaxActive</fo:inline> property of <fo:inline font-family="monospace">
openjpa.ConnectionFactoryProperties</fo:inline> in
<fo:basic-link internal-destination="ref_guide_dbsetup_builtin"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 4.1, “
Using the OpenJPA DataSource
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_dbsetup_builtin"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_dbsetup_builtin"/>]</fo:inline></fo:basic-link>. Setting a value of 0 will
result in behavior where the thread invoking <fo:inline font-family="monospace">commit</fo:inline>
will perform the broadcast directly. Defaults to 2.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29484"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">RecoveryTimeMillis</fo:inline>: Amount of time to wait in milliseconds
before attempting to reconnect to a peer of the cluster when connectivity to the
peer is lost. Defaults to 15000.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29490"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">MaxIdle</fo:inline>: The number of TCP sockets (channels) to keep open
to each peer in the cluster for the transmission of events. Defaults to 2.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29496"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">MaxActive</fo:inline>: The maximum allowed number of TCP sockets
(channels) to open simultaneously between each peer in the cluster. Defaults to
2.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To configure a factory to use the TCP provider, your properties might look like
the following:
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_event_conf_tcpex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 11.2. 
TCP Remote Commit Provider Configuration
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e29507">
&lt;property name="openjpa.RemoteCommitProvider"
value="tcp(Addresses=10.0.1.10;10.0.1.11;10.0.1.12;10.0.1.13)"/&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_event_conf_common"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:block font-size="14.399999999999999pt">11.2.1.3. 
Common Properties
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29512"><!--
remote
,
events
,
common properties
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In addition to the provider-specific configuration options above, all providers
accept the following plugin properties:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e29521"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29522"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">TransmitPersistedObjectIds</fo:inline>: Whether remote commit events
will include the object ids of instances persisted in the transaction. By
default only the class names of types persisted in the transaction are sent.
This results in smaller events and more efficient network utilization. If you
have registered your own remote commit listeners, however, you may require the
persisted object ids as well.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
To transmit persisted object ids in our remote commit events using the JMS
provider, we modify the previous example as follows:
</fo:block></fo:block></fo:block><fo:block id="ref_guide_event_customization"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Customization
</fo:marker><fo:block font-size="17.28pt">11.2.2. 
Customization
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29533"><!--
remote
,
events
,
customization
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
You can develop additional mechanisms for remote event notification be by
creating an implementation of the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/event/RemoteCommitProvider.html">
<fo:inline font-family="monospace"> RemoteCommitProvider</fo:inline></fo:basic-link> interface, possibly by
extending the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/event/AbstractRemoteCommitProvider.html">
<fo:inline font-family="monospace">AbstractRemoteCommitProvider</fo:inline></fo:basic-link> abstract class..
</fo:block></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Third Party Integration
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Third Party Integration
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="ref_guide_integration"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 12. 
Third Party Integration
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA provides a number of mechanisms for integrating with third-party tools.
The following chapter will illustrate these integration features.
</fo:block><fo:block id="ref_guide_integration_ant"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Apache Ant
</fo:marker><fo:block font-size="20.735999999999997pt">12.1. 
Apache Ant
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29561"><!--
Ant
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Ant is a very popular tool for building Java projects. It is similar to the
<fo:inline font-family="monospace">make</fo:inline> command, but is Java-centric and has more modern
features. Ant is open source, and can be downloaded from Apache's Ant web page
at <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://jakarta.apache.org/ant/"> http://jakarta.apache.org/ant/
</fo:basic-link>. Ant has become the de-facto standard build tool for Java, and many
commercial integrated development environments provide some support for using
ant build files. The remainder of this section assumes familiarity with writing
Ant <fo:inline font-family="monospace">build.xml</fo:inline> files.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
OpenJPA provides pre-built Ant task definitions for all bundled tools:
</fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e29577"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29578"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link internal-destination="ref_guide_integration_enhance"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Enhancer Task</fo:inline></fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29584"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link internal-destination="ref_guide_integration_appidtool"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Application Identity Tool Task
</fo:inline></fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29590"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link internal-destination="ref_guide_integration_mappingtool"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Mapping Tool Task</fo:inline></fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29596"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link internal-destination="ref_guide_integration_revmappingtool"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Reverse Mapping Tool Task
</fo:inline></fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e29602"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link internal-destination="ref_guide_integration_schematool"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Schema Tool Task</fo:inline></fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The source code for all the ant tasks is provided with the distribution under
the <fo:inline font-family="monospace">src</fo:inline> directory. This allows you to customize various
aspects of the ant tasks in order to better integrate into your development
environment.
</fo:block><fo:block id="ref_guide_integration_conf"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Common Ant Configuration Options
</fo:marker><fo:block font-size="17.28pt">12.1.1. 
Common Ant Configuration Options
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29616"><!--
Ant
,
configuration options
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
All OpenJPA tasks accept a nested <fo:inline font-family="monospace">config</fo:inline> element, which
defines the configuration environment in which the specified task will run. The
attributes for the <fo:inline font-family="monospace">config</fo:inline> tag are defined by the
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html">
<fo:inline font-family="monospace">JDBCConfiguration</fo:inline></fo:basic-link> bean methods. Note that
excluding the <fo:inline font-family="monospace">config</fo:inline> element will cause the Ant task to use
the default system configuration mechanism, such as the configuration defined in
the <fo:inline font-family="monospace">org.apache.openjpa.xml</fo:inline> file.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Following is an example of how to use the nested <fo:inline font-family="monospace">config</fo:inline> tag
in a <fo:inline font-family="monospace">build.xml</fo:inline> file:
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_integration_conf_config"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.1. 
Using the &lt;config&gt; Ant Tag
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e29651">
&lt;mappingtool&gt;
&lt;fileset dir="${basedir}"&gt;
&lt;include name="**/model/*.java" /&gt;
&lt;/fileset&gt;
&lt;config connectionUserName="scott" connectionPassword="tiger"
connectionURL="jdbc:oracle:thin:@saturn:1521:solarsid"
connectionDriverName="oracle.jdbc.driver.OracleDriver" /&gt;
&lt;/mappingtool&gt;
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
It is also possible to specify a <fo:inline font-family="monospace">properties</fo:inline> or <fo:inline font-family="monospace">
propertiesFile</fo:inline> attribute on the <fo:inline font-family="monospace">config</fo:inline> tag, which
will be used to locate a properties resource or file. The resource will be
loaded relative to the current CLASSPATH.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_integration_props"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.2. 
Using the Properties Attribute of the &lt;config&gt; Tag
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e29667">
&lt;mappingtool&gt;
&lt;fileset dir="${basedir}"&gt;
&lt;include name="**/model/*.java"/&gt;
&lt;/fileset&gt;
&lt;config properties="openjpa-dev.xml"/&gt;
&lt;/mappingtool&gt;
</fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_integration_propsfile"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.3. 
Using the PropertiesFile Attribute of the &lt;config&gt; Tag
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e29672">
&lt;mappingtool&gt;
&lt;fileset dir="${basedir}"&gt;
&lt;include name="**/model/*.java"/&gt;
&lt;/fileset&gt;
&lt;config propertiesFile="../conf/openjpa-dev.xml"/&gt;
&lt;/mappingtool&gt;
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Tasks also accept a nested <fo:inline font-family="monospace">classpath</fo:inline> element, which you can
use in place of the default classpath. The <fo:inline font-family="monospace">classpath</fo:inline> argument
behaves the same as it does for Ant's standard <fo:inline font-family="monospace">javac</fo:inline> element.
It is sometimes the case that projects are compiled to a separate directory than
the source tree. If the target path for compiled classes is not included in the
project's classpath, then a <fo:inline font-family="monospace">classpath</fo:inline> element that includes
the target class directory needs to be included so the enhancer and mapping tool
can locate the relevant classes.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Following is an example of using a <fo:inline font-family="monospace">classpath</fo:inline> tag:
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_integration_conf_classpath"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.4. 
Using the &lt;classpath&gt; Ant Tag
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e29696">
&lt;openjpac&gt;
&lt;fileset dir="${basedir}/source"&gt;
&lt;include name="**/model/*.java" /&gt;
&lt;/fileset&gt;
&lt;classpath&gt;
&lt;pathelement location="${basedir}/classes"/&gt;
&lt;pathelement location="${basedir}/source"/&gt;
&lt;pathelement path="${java.class.path}"/&gt;
&lt;/classpath&gt;
&lt;/openjpac&gt;
</fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Finally, tasks that invoke code-generation tools like the application identity
tool and reverse mapping tool accept a nested <fo:inline font-family="monospace">codeformat</fo:inline>
element. See the code formatting documentation in
<fo:basic-link internal-destination="ref_guide_conf_devtools_format"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 2.3.1, “
Code Formatting
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_conf_devtools_format"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_conf_devtools_format"/>]</fo:inline></fo:basic-link> for a list of code
formatting attributes.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_integration_conf_codeformat"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.5. 
Using the &lt;codeformat&gt; Ant Tag
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e29708">
&lt;reversemappingtool package="com.xyz.jdo" directory="${basedir}/src"&gt;
&lt;codeformat tabSpaces="4" spaceBeforeParen="true" braceOnSameLine="false"/&gt;
&lt;/reversemappingtool&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_integration_enhance"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Enhancer Ant Task
</fo:marker><fo:block font-size="17.28pt">12.1.2. 
Enhancer Ant Task
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29713"><!--
Ant
,
enhancer task
--></fo:wrapper><fo:wrapper id="d0e29718"><!--
enhancer
,
Ant task
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The enhancer task allows you to invoke the OpenJPA enhancer directly from within
the Ant build process. The task's parameters correspond exactly to the long
versions of the command-line arguments to the
<fo:basic-link internal-destination="ref_guide_pc_enhance"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
org.apache.openjpa.enhance.PCEnhancer</fo:inline></fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The enhancer task accepts a nested <fo:inline font-family="monospace">fileset</fo:inline> tag to specify the
files that should be processed. You can specify <fo:inline font-family="monospace">.java</fo:inline> or
<fo:inline font-family="monospace">.class</fo:inline> files. If you do not specify any files, the task
will run on the classes listed in your <fo:inline font-family="monospace">persistence.xml</fo:inline> or
<fo:basic-link internal-destination="openjpa.MetaDataFactory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.MetaDataFactory</fo:inline></fo:inline></fo:basic-link> property.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Following is an example of using the enhancer task in a <fo:inline font-family="monospace">build.xml
</fo:inline> file:
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_integration_enhance_task"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.6. 
Invoking the Enhancer from Ant
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e29755">
&lt;target name="enhance"&gt;
&lt;!-- define the openjpac task; this can be done at the top of the --&gt;
&lt;!-- build.xml file, so it will be available for all targets --&gt;
&lt;taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask"/&gt;
&lt;!-- invoke enhancer on all .java files below the model directory --&gt;
&lt;openjpac&gt;
&lt;fileset dir="."&gt;
&lt;include name="**/model/*.java" /&gt;
&lt;/fileset&gt;
&lt;/openjpac&gt;
&lt;/target&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_integration_appidtool"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Application Identity Tool Ant Task
</fo:marker><fo:block font-size="17.28pt">12.1.3. 
Application Identity Tool Ant Task
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29760"><!--
Ant
,
application identity tool task
--></fo:wrapper><fo:wrapper id="d0e29765"><!--
application identity tool
,
Ant task
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The application identity tool task allows you to invoke the application identity
tool directly from within the Ant build process. The task's parameters
correspond exactly to the long versions of the command-line arguments to the
<fo:basic-link internal-destination="ref_guide_pc_appid_appidtool"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
org.apache.openjpa.enhance.ApplicationIdTool</fo:inline></fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The application identity tool task accepts a nested <fo:inline font-family="monospace">fileset</fo:inline>
tag to specify the files that should be processed. You can specify <fo:inline font-family="monospace">
.java</fo:inline> or <fo:inline font-family="monospace">.class</fo:inline> files. If you do not specify any
files, the task will run on the classes listed in your <fo:inline font-family="monospace">persistence.xml
</fo:inline> file or <fo:basic-link internal-destination="openjpa.MetaDataFactory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.MetaDataFactory</fo:inline></fo:inline></fo:basic-link> property.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Following is an example of using the application identity tool task in a
<fo:inline font-family="monospace">build.xml</fo:inline> file:
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_integration_appidtool_task"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.7. 
Invoking the Application Identity Tool from Ant
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e29802">
&lt;target name="appids"&gt;
&lt;!-- define the appidtool task; this can be done at the top of --&gt;
&lt;!-- the build.xml file, so it will be available for all targets --&gt;
&lt;taskdef name="appidtool" classname="org.apache.openjpa.ant.ApplicationIdToolTask"/&gt;
&lt;!-- invoke tool on all .jdo files below the current directory --&gt;
&lt;appidtool&gt;
&lt;fileset dir="."&gt;
&lt;include name="**/model/*.java" /&gt;
&lt;/fileset&gt;
&lt;codeformat spaceBeforeParen="true" braceOnSameLine="false"/&gt;
&lt;/appidtool&gt;
&lt;/target&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_integration_mappingtool"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Mapping Tool Ant Task
</fo:marker><fo:block font-size="17.28pt">12.1.4. 
Mapping Tool Ant Task
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29807"><!--
Ant
,
mapping tool task
--></fo:wrapper><fo:wrapper id="d0e29812"><!--
mapping tool
,
Ant task
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The mapping tool task allows you to directly invoke the mapping tool from within
the Ant build process. It is useful for making sure that the database schema and
object-relational mapping data is always synchronized with your persistent class
definitions, without needing to remember to invoke the mapping tool manually.
The task's parameters correspond exactly to the long versions of the
command-line arguments to the <fo:basic-link internal-destination="ref_guide_mapping_mappingtool"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">
<fo:inline font-family="monospace">org.apache.openjpa.jdbc.meta.MappingTool</fo:inline></fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The mapping tool task accepts a nested <fo:inline font-family="monospace">fileset</fo:inline> tag to specify
the files that should be processed. You can specify <fo:inline font-family="monospace">.java</fo:inline>
or <fo:inline font-family="monospace">.class</fo:inline> files. If you do not specify any files, the task
will run on the classes listed in your <fo:inline font-family="monospace">persistence.xml</fo:inline> file
or <fo:basic-link internal-destination="openjpa.MetaDataFactory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.MetaDataFactory</fo:inline></fo:inline></fo:basic-link> property.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Following is an example of a <fo:inline font-family="monospace">build.xml</fo:inline> target that invokes
the mapping tool:
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_integration_mappingtool_task"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.8. 
Invoking the Mapping Tool from Ant
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e29850">
&lt;target name="refresh"&gt;
&lt;!-- define the mappingtool task; this can be done at the top of --&gt;
&lt;!-- the build.xml file, so it will be available for all targets --&gt;
&lt;taskdef name="mappingtool" classname="org.apache.openjpa.jdbc.ant.MappingToolTask"/&gt;
&lt;!-- add the schema components for all .jdo files below the --&gt;
&lt;!-- current directory --&gt;
&lt;mappingtool action="buildSchema"&gt;
&lt;fileset dir="."&gt;
&lt;include name="**/*.jdo" /&gt;
&lt;/fileset&gt;
&lt;/mappingtool&gt;
&lt;/target&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_integration_revmappingtool"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Reverse Mapping Tool Ant Task
</fo:marker><fo:block font-size="17.28pt">12.1.5. 
Reverse Mapping Tool Ant Task
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29855"><!--
Ant
,
reverse mapping tool task
--></fo:wrapper><fo:wrapper id="d0e29860"><!--
reverse mapping tool
,
Ant task
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The reverse mapping tool task allows you to directly invoke the reverse mapping
tool from within Ant. While many users will only run the reverse mapping process
once, others will make it part of their build process. The task's parameters
correspond exactly to the long versions of the command-line arguments to the
<fo:basic-link internal-destination="ref_guide_pc_reverse_reversemappingtool"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
org.apache.openjpa.jdbc.meta.ReverseMappingTool</fo:inline></fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Following is an example of a <fo:inline font-family="monospace">build.xml</fo:inline> target that invokes
the reverse mapping tool:
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_integration_revmappingtool_task"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.9. 
Invoking the Reverse Mapping Tool from Ant
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e29879">
&lt;target name="reversemap"&gt;
&lt;!-- define the reversemappingtool task; this can be done at the top of --&gt;
&lt;!-- the build.xml file, so it will be available for all targets --&gt;
&lt;taskdef name="reversemappingtool"
classname="org.apache.openjpa.jdbc.ant.ReverseMappingToolTask"/&gt;
&lt;!-- reverse map the entire database --&gt;
&lt;reversemappingtool package="com.xyz.model" directory="${basedir}/src"
customizerProperties="${basedir}/conf/reverse.properties"&gt;
&lt;codeformat tabSpaces="4" spaceBeforeParen="true" braceOnSameLine="false"/&gt;
&lt;/reversemappingtool&gt;
&lt;/target&gt;
</fo:block></fo:block></fo:block></fo:block><fo:block id="ref_guide_integration_schematool"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Schema Tool Ant Task
</fo:marker><fo:block font-size="17.28pt">12.1.6. 
Schema Tool Ant Task
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29884"><!--
Ant
,
schema tool task
--></fo:wrapper><fo:wrapper id="d0e29889"><!--
schema tool
,
Ant task
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The schema tool task allows you to directly invoke the schema tool from within
the Ant build process. The task's parameters correspond exactly to the long
versions of the command-line arguments to the
<fo:basic-link internal-destination="ref_guide_schema_schematool"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
org.apache.openjpa.jdbc.schema.SchemaTool</fo:inline></fo:inline></fo:basic-link>.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Following is an example of a <fo:inline font-family="monospace">build.xml</fo:inline> target that invokes
the schema tool:
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="ref_guide_integration_schematool_task"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 12.10. 
Invoking the Schema Tool from Ant
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e29908">
&lt;target name="schema"&gt;
&lt;!-- define the schematool task; this can be done at the top of --&gt;
&lt;!-- the build.xml file, so it will be available for all targets --&gt;
&lt;taskdef name="schematool" classname="org.apache.openjpa.jdbc.ant.SchemaToolTask"/&gt;
&lt;!-- add the schema components for all .schema files below the --&gt;
&lt;!-- current directory --&gt;
&lt;schematool action="add"&gt;
&lt;fileset dir="."&gt;
&lt;include name="**/*.schema" /&gt;
&lt;/fileset&gt;
&lt;/schematool&gt;
&lt;/target&gt;
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="body" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Optimization Guidelines
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Optimization Guidelines
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="ref_guide_optimization"><fo:block font-family="sans-serif,Symbol,ZapfDingbats"><fo:block margin-left="-4pc"><fo:block font-size="24.8832pt" font-weight="bold"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Chapter 13. 
Optimization Guidelines
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:wrapper id="d0e29914"><!--
optimization guidelines
--></fo:wrapper><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
There are numerous techniques you can use in order to ensure that OpenJPA
operates in the fastest and most efficient manner. Following are some
guidelines. Each describes what impact it will have on performance and
scalability. Note that general guidelines regarding performance or scalability
issues are just that - guidelines. Depending on the particular characteristics
of your application, the optimal settings may be considerably different than
what is outlined below.
</fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
In the following table, each row is labeled with a list of italicized keywords.
These keywords identify what characteristics the row in question may improve
upon. Many of the rows are marked with one or both of the <fo:inline font-style="italic">performance
</fo:inline> and <fo:inline font-style="italic">scalability</fo:inline> labels. It is important to bear
in mind the differences between performance and scalability (for the most part,
we are referring to system-wide scalability, and not necessarily only
scalability within a single JVM). The performance-related hints will probably
improve the performance of your application for a given user load, whereas the
scalability-related hints will probably increase the total number of users that
your application can service. Sometimes, increasing performance will decrease
scalability, and vice versa. Typically, options that reduce the amount of work
done on the database server will improve scalability, whereas those that push
more work onto the server will have a negative impact on scalability.
</fo:block><fo:block xmlns:rx="http://www.renderx.com/XSL/Extensions" space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="d0e29927"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Table 13.1. 
Optimization Guidelines
</fo:block><fo:table border-before-width.conditionality="retain" border-collapse="collapse" border-left-style="solid" border-right-style="solid" border-top-style="solid" border-bottom-style="solid" border-left-width="0.5pt" border-right-width="0.5pt" border-top-width="0.5pt" border-bottom-width="0.5pt" border-left-color="black" border-right-color="black" border-top-color="black" border-bottom-color="black" table-layout="fixed" width="100%"><fo:table-column column-number="1"/><fo:table-column column-number="2" column-width="proportional-column-width(4)"/><fo:table-body start-indent="0pt" end-indent="0pt"><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Plugin in a Connection Pool
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance, scalability</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
OpenJPA's built-in datasource does not perform connection pooling or
prepared statement caching. Plugging in a third-party pooling datasource may
drastically improve performance.
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Optimize database indexes
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance, scalability</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
The default set of indexes created by OpenJPA's mapping tool may not always be
the most appropriate for your application. Manually setting indexes in your
mapping metadata or manually manipulating database indexes to include
frequently-queried fields (as well as dropping indexes on rarely-queried
fields) can yield significant performance benefits.
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
A database must do extra work on insert, update, and delete to maintain an
index. This extra work will benefit selects with WHERE clauses, which will
execute much faster when the terms in the WHERE clause are appropriately
indexed. So, for a read-mostly application, appropriate indexing will slow down
updates (which are rare) but greatly accelerate reads. This means that the
system as a whole will be faster, and also that the database will experience
less load, meaning that the system will be more scalable.
</fo:block>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Bear in mind that over-indexing is a bad thing, both for scalability and
performance, especially for applications that perform lots of inserts, updates,
or deletes.
</fo:block>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
JVM optimizations
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance, reliability</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
Manipulating various parameters of the Java Virtual Machine (such as hotspot
compilation modes and the maximum memory) can result in performance
improvements. For more details about optimizing the JVM execution environment,
please see <fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/docs/hotspot/PerformanceFAQ.html">http://java.sun.com/docs/hotspot/PerformanceFAQ.html</fo:basic-link>.
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Use the data cache
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance, scalability</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
Using OpenJPA's <fo:basic-link internal-destination="ref_guide_cache"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">data and query caching</fo:inline></fo:basic-link>
features can often result in a dramatic improvement in performance.
Additionally, these caches can significantly reduce the amount of load on
the database, increasing the scalability characteristics of your application.
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Set <fo:inline font-family="monospace">LargeTransaction</fo:inline> to true,
or set <fo:inline font-family="monospace"> PopulateDataCache</fo:inline> to
false
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance vs. scalability</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
When using OpenJPA's <fo:basic-link internal-destination="ref_guide_cache"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">data caching</fo:inline></fo:basic-link>
features in a transaction that will delete, modify, or create a very large
number of objects you can set <fo:inline font-family="monospace">LargeTransaction</fo:inline> to true and
perform periodic flushes during your transaction to reduce its memory
requirements. See the Javadoc:
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/OpenJPAEntityManager.html">
OpenJPAEntityManager.setLargeTransaction</fo:basic-link>. Note that transactions in
large mode have to more aggressively flush items from the data cache.
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If your transaction will visit objects that you know are very unlikely to be
accessed by other transactions, for example an exhaustive report run only once a
month, you can turn off population of the data cache so that the transaction
doesn't fill the entire data cache with objects that won't be accessed again.
Again, see the Javadoc:
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/org/apache/openjpa/persistence/OpenJPAEntityManager.html">
OpenJPAEntityManager.setPopulateDataCache</fo:basic-link>
</fo:block>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Run the OpenJPA enhancer on your persistent classes,
either at build-time or deploy-time.
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance, scalability, memory footprint</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
OpenJPA performs best when your persistent classes have been run through the
OpenJPA post-compilation bytecode enhancer. When dealing with enhanced classes,
OpenJPA can make a number of assumptions that reduce memory footprint and
accelerate persistent data access. When evaluating OpenJPA's performance,
build-time or deploy-time enhancement should be enabled. See
<fo:basic-link internal-destination="ref_guide_pc_enhance"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 5.2, “
Enhancement
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_pc_enhance"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_pc_enhance"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Disable logging, performance tracking
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
Developer options such as verbose logging and the JDBC performance tracker can
result in serious performance hits for your application. Before evaluating
OpenJPA's performance, these options should all be disabled.
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Set <fo:inline font-family="monospace">IgnoreChanges</fo:inline> to true, or
set <fo:inline font-family="monospace">FlushBeforeQueries</fo:inline> to true
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance vs. scalability</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
When both the <fo:basic-link internal-destination="openjpa.IgnoreChanges"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.IgnoreChanges</fo:inline></fo:inline></fo:basic-link> and
<fo:basic-link internal-destination="openjpa.FlushBeforeQueries"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">openjpa.FlushBeforeQueries
</fo:inline></fo:inline></fo:basic-link> properties are set to false, OpenJPA needs to consider
in-memory dirty instances during queries. This can sometimes result in OpenJPA
needing to evaluate the entire extent objects in order to return the correct
query results, which can have drastic performance consequences. If it is
appropriate for your application, configuring <fo:inline font-family="monospace">FlushBeforeQueries
</fo:inline> to automatically flush before queries involving dirty objects will
ensure that this never happens. Setting <fo:inline font-family="monospace">IgnoreChanges</fo:inline> to
false will result in a small performance hit even if <fo:inline font-family="monospace">FlushBeforeQueries
</fo:inline> is true, as incremental flushing is not as efficient overall as
delaying all flushing to a single operation during commit.
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Setting <fo:inline font-family="monospace">IgnoreChanges</fo:inline> to <fo:inline font-family="monospace">true</fo:inline> will help
performance, since dirty objects can be ignored for queries, meaning that
incremental flushing or client-side processing is not necessary. It will also
improve scalability, since overall database server usage is diminished. On the
other hand, setting <fo:inline font-family="monospace">IgnoreChanges</fo:inline> to <fo:inline font-family="monospace">false</fo:inline>
will have a negative impact on scalability, even when using automatic flushing
before queries, since more operations will be performed on the database server.
</fo:block>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Configure <fo:inline font-family="monospace">openjpa.ConnectionRetainMode
</fo:inline> appropriately
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance vs. scalability</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
The <fo:basic-link internal-destination="openjpa.ConnectionRetainMode"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">ConnectionRetainMode
</fo:inline></fo:inline></fo:basic-link> configuration option controls when OpenJPA will obtain a
connection, and how long it will hold that connection. The optimal settings for
this option will vary considerably depending on the particular behavior of
your application. You may even benefit from using different retain modes for
different parts of your application.
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The default setting of <fo:inline font-family="monospace">on-demand</fo:inline> minimizes the amount of time
that OpenJPA holds onto a datastore connection. This is generally the best
option from a scalability standpoind, as database resources are held for a
minimal amount of time. However, if you are not using connection pooling, or
if your <fo:inline font-family="monospace">DataSource</fo:inline> is not efficient at managing its
pool, then this default value could cause undesirable pool contention.
</fo:block>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Use flat inheritance
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance, scalability vs. disk space</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
Mapping inheritance hierarchies to a single database table is faster for most
operations than other strategies employing multiple tables. If it is
appropriate for your application, you should use this strategy whenever
possible.
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
However, this strategy will require more disk space on the database side. Disk
space is relatively inexpensive, but if your object model is particularly large,
it can become a factor.
</fo:block>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
High sequence increment
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance, scalability</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
For applications that perform large bulk inserts, the retrieval of sequence
numbers can be a bottleneck. Increasing sequence increments and using
table-based rather than native database sequences can reduce or eliminate
this bottleneck. In some cases, implementing your own sequence factory can
further optimize sequence number retrieval.
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Use optimistic transactions
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance, scalability</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
Using datastore transactions translates into pessimistic database row locking,
which can be a performance hit (depending on the database). If appropriate for
your application, optimistic transactions are typically faster than datastore
transactions.
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Optimistic transactions provide the same transactional guarantees as datastore
transactions, except that you must handle a potential optimistic verification
exception at the end of a transaction instead of assuming that a transaction
will successfully complete. In many applications, it is unlikely that different
concurrent transactions will operate on the same set of data at the same time,
so optimistic verification increases the concurrency, and therefore both the
performance and scalability characteristics, of the application. A common
approach to handling optimistic verification exceptions is to simply present the
end user with the fact that concurrent modifications happened, and require that
the user redo any work.
</fo:block>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Use query aggregates and projections
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance, scalability</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
Using aggregates to compute reporting data on the database server can
drastically speed up queries. Similarly, using projections when you are
interested in specific object fields or relations rather than the entire object
state can reduce the amount of data OpenJPA must transfer from the database to
your application.
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Always close resources
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">scalability</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Under certain settings, <fo:inline font-family="monospace"> EntityManager</fo:inline> s, OpenJPA
<fo:inline font-family="monospace">Extent</fo:inline> iterators, and <fo:inline font-family="monospace">Query</fo:inline>
results may be backed by resources in the database.
</fo:block>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
For example, if you have configured OpenJPA to use scrollable cursors and lazy
object instantiation by default, each query result will hold open a <fo:inline font-family="monospace">
ResultSet</fo:inline> object, which, in turn, will hold open a <fo:inline font-family="monospace">
Statement</fo:inline> object (preventing it from being re-used). Garbage
collection will clean up these resources, so it is never necessary to explicitly
close them, but it is always faster if it is done at the application level.
</fo:block>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Use detached state managers
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Attaching and even persisting instances can be more efficient when your detached
objects use detached state managers. By default, OpenJPA does not use detached
state managers when serializing an instance across tiers. See
<fo:basic-link internal-destination="ref_guide_detach_graph"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 11.1.3, “
Defining the Detached Object Graph
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_detach_graph"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_detach_graph"/>]</fo:inline></fo:basic-link> for how to force OpenJPA to use
detached state managers across tiers, and for other options for more efficient
attachment.
</fo:block>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
The downside of using a detached state manager across tiers is that your
enhanced persistent classes and the OpenJPA libraries must be available on the
client tier.
</fo:block>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Utilize the <fo:inline font-family="monospace">EntityManager</fo:inline>
cache
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance, scalability</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
When possible and appropriate, re-using <fo:inline font-family="monospace">EntityManager</fo:inline>s
and setting the <fo:basic-link internal-destination="openjpa.RetainState"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">RetainState
</fo:inline></fo:inline></fo:basic-link> configuration option to <fo:inline font-family="monospace">true</fo:inline> may result in
significant performance gains, since the <fo:inline font-family="monospace">EntityManager</fo:inline>'s
built-in object cache will be used.
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Enable multithreaded operation only when necessary
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
OpenJPA respects the <fo:basic-link internal-destination="openjpa.Multithreaded"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.Multithreaded</fo:inline></fo:inline></fo:basic-link> option in that it does not impose as
much synchronization overhead for applications that do not set this value to
<fo:inline font-family="monospace">true</fo:inline>. If your application is guaranteed to only use
single-threaded access to OpenJPA resources and persistent objects, leaving
this option as <fo:inline font-family="monospace">false</fo:inline> will reduce synchronization overhead,
and may result in a modest performance increase.
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Enable large data set handling
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance, scalability</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
If you execute queries that return large numbers of objects or have relations
(collections or maps) that are large, and if you often only access parts of
these data sets, enabling <fo:basic-link internal-destination="ref_guide_dbsetup_lrs"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">large result
set handling</fo:inline></fo:basic-link> where appropriate can dramatically speed up your
application, since OpenJPA will bring the data sets into memory from the
database only as necessary.
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Disable large data set handling
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance, scalability</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
If you have enabled scrollable result sets and on-demand loading but do you not
require it, consider disabling it again. Some JDBC drivers and databases
(SQLServer for example) are much slower when used with scrolling result sets.
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Use the <fo:inline font-family="monospace">DynamicSchemaFactory</fo:inline>
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance, validation</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
If you are using a <fo:basic-link internal-destination="openjpa.jdbc.SchemaFactory"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"><fo:inline font-family="monospace">
openjpa.jdbc.SchemaFactory</fo:inline></fo:inline></fo:basic-link> setting of something other than
the default of <fo:inline font-family="monospace">dynamic</fo:inline>, consider switching back. While other
factories can ensure that object-relational mapping information is valid when
a persistent class is first used, this can be a slow process. Though the
validation is only performed once for each class, switching back to the
<fo:inline font-family="monospace">DynamicSchemaFactory</fo:inline> can reduce the warm-up time for
your application.
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Do not use XA transactions
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance, scalability</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
<fo:basic-link internal-destination="ref_guide_enterprise_xa"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">XA transactions</fo:inline></fo:basic-link> can be orders of
magnitude slower than standard transactions. Unless distributed transaction
functionality is required by your application, use standard transactions.
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Recall that XA transactions are distinct from managed transactions - managed
transaction services such as that provided by EJB declarative transactions can
be used both with XA and non-XA transactions. XA transactions should only be
used when a given business transaction involves multiple different transactional
resources (an Oracle database and an IBM transactional message queue, for
example).
</fo:block>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Use <fo:inline font-family="monospace">Set</fo:inline>s instead of
<fo:inline font-family="monospace">List/Collection</fo:inline>s
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance, scalability</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
There is a small amount of extra overhead for OpenJPA to maintain collections
where each element is not guaranteed to be unique. If your application does
not require duplicates for a collection, you should always declare your
fields to be of type <fo:inline font-family="monospace">Set, SortedSet, HashSet,</fo:inline> or
<fo:inline font-family="monospace">TreeSet</fo:inline>.
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Use query parameters instead of encoding search
data in filter strings
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
If your queries depend on parameter data only known at runtime, you should use
query parameters rather than dynamically building different query strings.
OpenJPA performs aggressive caching of query compilation data, and the
effectiveness of this cache is diminished if multiple query filters are used
where a single one could have sufficed.
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Tune your fetch groups appropriately
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance, scalability</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
The <fo:basic-link internal-destination="ref_guide_fetch"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">fetch groups</fo:inline></fo:basic-link> used when loading an
object control how much data is eagerly loaded, and by extension, which fields
must be lazily loaded at a future time. The ideal fetch group configuration
loads all the data that is needed in one fetch, and no extra fields - this
minimizes both the amount of data transferred from the database, and the
number of trips to the database.
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
If extra fields are specified in the fetch groups (in particular, large fields
such as binary data, or relations to other persistence-capable objects), then
network overhead (for the extra data) and database processing (for any necessary
additional joins) will hurt your application's performance. If too few fields
are specified in the fetch groups, then OpenJPA will have to make additional
trips to the database to load additional fields as necessary.
</fo:block>
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Use eager fetching
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance, scalability</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
Using <fo:basic-link internal-destination="ref_guide_perfpack_eager"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">eager fetching</fo:inline></fo:basic-link> when
loading subclass data or traversing relations for each instance in a large
collection of results can speed up data loading by orders of magnitude.
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
<fo:inline font-weight="bold">
Disable BrokerImpl finalization
</fo:inline>
<fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
<fo:inline font-style="italic">performance, scalability</fo:inline>
</fo:block>
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" text-align="left"><fo:block>
Outside of a Java EE 5 application server or other JPA persistence container,
OpenJPA's EntityManagers use finalizers to ensure that resources
get cleaned up. If you are properly managing your resources, this finalization
is not necessary, and will introduce unneeded synchronization, leading to
scalability problems. You can disable this protective behavior by setting the
<fo:inline font-family="monospace">openjpa.BrokerImpl</fo:inline> property to
<fo:inline font-family="monospace">non-finalizing</fo:inline>. See <fo:basic-link internal-destination="ref_guide_runtime_broker_finalization"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">Section 9.1.1, “
Broker Finalization
</fo:inline></fo:basic-link><fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" internal-destination="ref_guide_runtime_broker_finalization"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="ref_guide_runtime_broker_finalization"/>]</fo:inline></fo:basic-link> for details.
</fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="back" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
JPA Resources
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
JPA Resources
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="jpa_resources"><fo:block><fo:block><fo:block margin-left="-4pc" font-size="24.8832pt" font-weight="bold" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Appendix 1. 
JPA Resources
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e30503"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30504"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/aboutJava/communityprocess/jsr/jsr_220_dataobj.html">
EJB 3 JSR page</fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30510"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/products/ejb">Sun EJB page</fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30516"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://java.sun.com/javaee/5/docs/api/index.html">
javax.persistence Javadoc</fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30522"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="../javadoc/index.html">OpenJPA Javadoc</fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30528"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="Persistence.pdf">Locally mirrored JPA specification</fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:flow></fo:page-sequence><fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" hyphenate="true" master-reference="back" language="en" format="1" initial-page-number="auto" force-page-count="no-force" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"><fo:static-content flow-name="xsl-region-before-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Supported Databases
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block>
Supported Databases
</fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-before-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="before"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-footnote-separator"><fo:block><fo:leader color="black" leader-pattern="rule" leader-length="1in"/></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-first"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-odd"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-even"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after-blank"><fo:block font-family="serif,Symbol,ZapfDingbats" margin-left="-4pc"><fo:table table-layout="fixed" width="100%" border-top-width="0.5pt" border-top-style="solid" border-top-color="black"><fo:table-column column-number="1" column-width="proportional-column-width(1)"/><fo:table-column column-number="2" column-width="proportional-column-width(1)"/><fo:table-column column-number="3" column-width="proportional-column-width(1)"/><fo:table-body><fo:table-row block-progression-dimension.minimum="14pt"><fo:table-cell text-align="left" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell><fo:table-cell text-align="center" display-align="after"><fo:block><fo:block><fo:page-number/></fo:block></fo:block></fo:table-cell><fo:table-cell text-align="right" display-align="after"><fo:block><fo:block/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body"><fo:block id="supported_databases"><fo:block><fo:block><fo:block margin-left="-4pc" font-size="24.8832pt" font-weight="bold" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always" space-before.optimum="10pt" space-before.minimum="10pt * 0.8" space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left" start-indent="-4pc" hyphenation-character="-" hyphenation-push-character-count="2" hyphenation-remain-character-count="2">Appendix 2. 
Supported Databases
</fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Following is a table of the database and JDBC driver versions that are supported
by OpenJPA.
</fo:block><fo:block xmlns:rx="http://www.renderx.com/XSL/Extensions" space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="d0e30540"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Table 2.1. 
Supported Databases and JDBC Drivers
</fo:block><fo:table border-before-width.conditionality="retain" border-collapse="collapse" border-left-style="solid" border-right-style="solid" border-top-style="solid" border-bottom-style="solid" border-left-width="0.5pt" border-right-width="0.5pt" border-top-width="0.5pt" border-bottom-width="0.5pt" border-left-color="black" border-right-color="black" border-top-color="black" border-bottom-color="black" table-layout="fixed" width="100%"><fo:table-column column-number="1"/><fo:table-column column-number="2"/><fo:table-column column-number="3"/><fo:table-column column-number="4"/><fo:table-header start-indent="0pt" end-indent="0pt"><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">
Database Name
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">
Database Version
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block font-weight="bold">
JDBC Driver Name
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block font-weight="bold">
JDBC Driver Version
</fo:block></fo:table-cell></fo:table-row></fo:table-header><fo:table-body start-indent="0pt" end-indent="0pt"><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Apache Derby
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
10.1.2.1
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Apache Derby Embedded JDBC Driver
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
10.1.2.1
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Borland Interbase
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
7.1.0.202
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Interclient
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
4.5.1
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Borland JDataStore
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
6.0
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Borland JDataStore
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
6.0
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
DB2
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
8.1
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
IBM DB2 JDBC Universal Driver
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
1.0.581
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Empress
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
8.62
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Empress Category 2 JDBC Driver
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
8.62
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Firebird
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
1.5
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
JayBird JCA/JDBC driver
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
1.0.1
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
H2 Database Engine
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
1.0
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
H2
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
1.0
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Hypersonic Database Engine
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
1.8.0
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Hypersonic
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
1.8.0
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Informix Dynamic Server
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
9.30.UC10
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Informix JDBC driver
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
2.21.JC2
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
InterSystems Cache
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
5.0
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Cache JDBC Driver
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
5.0
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Microsoft Access
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
9.0 (a.k.a. "2000")
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
DataDirect SequeLink
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
5.4.0038
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Microsoft SQL Server
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
9.00.1399 (SQL Server 2005)
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
SQLServer
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
1.0.809.102
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Microsoft Visual FoxPro
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
7.0
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
DataDirect SequeLink
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
5.4.0038
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
MySQL
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
3.23.43-log
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
MySQL Driver
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
3.0.14
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
MySQL
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
5.0.26
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
MySQL Driver
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
3.0.14
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Oracle
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
8.1,9.2,10.1
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Oracle JDBC driver
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
10.2.0.1.0
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Pointbase
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
4.4
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Pointbase JDBC driver
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
4.4 (4.4)
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
PostgreSQL
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
7.2.1
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
PostgreSQL Native Driver
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
8.1
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
PostgreSQL
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
8.1.5
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
PostgreSQL Native Driver
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt" border-bottom-style="solid" border-bottom-color="black" text-align="left"><fo:block>
8.1
</fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
Sybase Adaptive Server Enterprise
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
12.5
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" border-right-style="solid" border-right-color="black" text-align="left"><fo:block>
jConnect
</fo:block></fo:table-cell><fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" text-align="left"><fo:block>
5.5 (5.5)
</fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block><fo:block id="dbsupport_derby"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Apache Derby
</fo:marker><fo:block font-size="20.735999999999997pt">2.1. 
Apache Derby
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="example_props_derby"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.1. 
Example properties for Derby
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e30745">
openjpa.ConnectionDriverName: org.apache.derby.jdbc.EmbeddedDriver
openjpa.ConnectionURL: jdbc:derby:DB_NAME;create=true
</fo:block></fo:block></fo:block></fo:block><fo:block id="dbsupport_interbase"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Borland Interbase
</fo:marker><fo:block font-size="20.735999999999997pt">2.2. 
Borland Interbase
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="example_props_interbase"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.2. 
Example properties for Interbase
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e30753">
openjpa.ConnectionDriverName: interbase.interclient.Driver
openjpa.ConnectionURL: jdbc:interbase://SERVER_NAME:SERVER_PORT/DB_PATH
</fo:block></fo:block></fo:block><fo:block id="dbsupport_interbase_issues"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Known issues with Interbase
</fo:marker><fo:block font-size="17.28pt">2.2.1. 
Known issues with Interbase
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e30758"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30759"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Interbase does not support record locking, so
datastore transactions cannot use the pessimistic lock manager.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30762"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Interbase does not support the <fo:inline font-family="monospace">LOWER</fo:inline>, <fo:inline font-family="monospace">SUBSTRING
</fo:inline>, or <fo:inline font-family="monospace">INSTR</fo:inline> SQL functions&gt;
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="dbsupport_jdatastore"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
JDataStore
</fo:marker><fo:block font-size="20.735999999999997pt">2.3. 
JDataStore
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="example_props_jdatastore"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.3. 
Example properties for JDataStore
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e30780">
openjpa.ConnectionDriverName: com.borland.datastore.jdbc.DataStoreDriver
openjpa.ConnectionURL: jdbc:borland:dslocal:db-jdatastore.jds;create=true
</fo:block></fo:block></fo:block></fo:block><fo:block id="dbsupport_db2"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
IBM DB2
</fo:marker><fo:block font-size="20.735999999999997pt">2.4. 
IBM DB2
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="example_props_db2"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.4. 
Example properties for IBM DB2
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e30788">
openjpa.ConnectionDriverName: com.ibm.db2.jcc.DB2Driver
openjpa.ConnectionURL: jdbc:db2://SERVER_NAME:SERVER_PORT/DB_NAME
</fo:block></fo:block></fo:block><fo:block id="dbsupport_db2_issues"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Known issues with DB2
</fo:marker><fo:block font-size="17.28pt">2.4.1. 
Known issues with DB2
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e30793"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30794"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Floats and doubles may lose precision when stored.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30797"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Empty char values are stored as NULL.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30800"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Fields of type BLOB and CLOB are limited to 1M. This number can be increased by
extending <fo:inline font-family="monospace">DB2Dictionary</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="dbsupport_empress"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Empress
</fo:marker><fo:block font-size="20.735999999999997pt">2.5. 
Empress
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="example_props_empress"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.5. 
Example properties for Empress
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e30812">
openjpa.ConnectionDriverName: empress.jdbc.empressDriver
openjpa.ConnectionURL: jdbc:empress://SERVER=yourserver;PORT=6322;DATABASE=yourdb
</fo:block></fo:block></fo:block><fo:block id="dbsupport_empress_issues"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Known issues with Empress
</fo:marker><fo:block font-size="17.28pt">2.5.1. 
Known issues with Empress
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e30817"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30818"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Empress enforces pessimistic semantics (lock on
read) when not using <fo:inline font-family="monospace">AllowConcurrentRead</fo:inline> property (which
bypasses row locking) for <fo:inline font-family="monospace">EmpressDictionary</fo:inline>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30827"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Only the category 2 non-local driver is supported.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="dbsupport_h2"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
H2 Database Engine
</fo:marker><fo:block font-size="20.735999999999997pt">2.6. 
H2 Database Engine
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="example_props_h2"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.6. 
Example properties for H2 Database Engine
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e30836">
openjpa.ConnectionDriverName: org.h2.Driver
openjpa.ConnectionURL: jdbc:h2:DB_NAME
</fo:block></fo:block></fo:block><fo:block id="dbsupport_h2_issues"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Known issues with H2 Database Engine
</fo:marker><fo:block font-size="17.28pt">2.6.1. 
Known issues with H2 Database Engine
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e30841"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30842"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
H2 does not support cross joins
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="dbsupport_hypersonic"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Hypersonic
</fo:marker><fo:block font-size="20.735999999999997pt">2.7. 
Hypersonic
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="example_props_hypersonic"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.7. 
Example properties for Hypersonic
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e30851">
openjpa.ConnectionDriverName: org.hsqldb.jdbcDriver
openjpa.ConnectionURL: jdbc:hsqldb:DB_NAME
</fo:block></fo:block></fo:block><fo:block id="dbsupport_hypersonic_issues"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Known issues with Hypersonic
</fo:marker><fo:block font-size="17.28pt">2.7.1. 
Known issues with Hypersonic
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e30856"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30857"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Hypersonic does not support pessimistic locking, so non-optimistic transactions
will fail unless the <fo:inline font-family="monospace">SimulateLocking</fo:inline> property is set for the
<fo:basic-link internal-destination="openjpa.jdbc.DBDictionary"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold"> openjpa.jdbc.DBDictionary</fo:inline></fo:basic-link>
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="dbsupport_firebird"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Firebird
</fo:marker><fo:block font-size="20.735999999999997pt">2.8. 
Firebird
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="example_props_firebird"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.8. 
Example properties for Firebird
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e30872">
openjpa.ConnectionDriverName: org.firebirdsql.jdbc.FBDriver
openjpa.ConnectionURL: jdbc:firebirdsql://SERVER_NAME:SERVER_PORT/DB_PATH
</fo:block></fo:block></fo:block><fo:block id="dbsupport_firebird_issues"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Known issues with Firebird
</fo:marker><fo:block font-size="17.28pt">2.8.1. 
Known issues with Firebird
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e30877"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30878"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Firebird does not support auto-increment columns.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30881"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Firebird does not support the <fo:inline font-family="monospace">LOWER</fo:inline>, <fo:inline font-family="monospace">SUBSTRING
</fo:inline>, or <fo:inline font-family="monospace">INSTR</fo:inline> SQL functions.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="dbsupport_informix"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Informix
</fo:marker><fo:block font-size="20.735999999999997pt">2.9. 
Informix
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="example_props_informix"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.9. 
Example properties for Informix Dynamic Server
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e30899">
openjpa.ConnectionDriverName: com.informix.jdbc.IfxDriver
openjpa.ConnectionURL: \
jdbc:informix-sqli://SERVER_NAME:SERVER_PORT/DB_NAME:INFORMIXSERVER=SERVER_ID
</fo:block></fo:block></fo:block><fo:block id="dbsupport_informix_issues"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Known issues with Informix
</fo:marker><fo:block font-size="17.28pt">2.9.1. 
Known issues with Informix
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e30904"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30905"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
None
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="dbsupport_intersystems_cache"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
InterSystems Cache
</fo:marker><fo:block font-size="20.735999999999997pt">2.10. 
InterSystems Cache
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="example_props_intersystems_cache"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.10. 
Example properties for InterSystems Cache
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e30914">
openjpa.ConnectionDriverName: com.intersys.jdbc.CacheDriver
openjpa.ConnectionURL: jdbc:Cache://SERVER_NAME:SERVER_PORT/DB_NAME
</fo:block></fo:block></fo:block><fo:block id="dbsupport_intersystems_cache_issues"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Known issues with InterSystems Cache
</fo:marker><fo:block font-size="17.28pt">2.10.1. 
Known issues with InterSystems Cache
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e30919"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30920"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Support for Cache is done via SQL access over JDBC, not through their object
database APIs.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="dbsupport_access"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Microsoft Access
</fo:marker><fo:block font-size="20.735999999999997pt">2.11. 
Microsoft Access
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="example_props_access"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.11. 
Example properties for Microsoft Access
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e30929">
openjpa.ConnectionDriverName: com.ddtek.jdbc.sequelink.SequeLinkDriver
openjpa.ConnectionURL: jdbc:sequelink://SERVER_NAME:SERVER_PORT
</fo:block></fo:block></fo:block><fo:block id="dbsupport_access_issues"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Known issues with Microsoft Access
</fo:marker><fo:block font-size="17.28pt">2.11.1. 
Known issues with Microsoft Access
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e30934"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30935"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Using the Sun JDBC-ODBC bridge to connect is not supported.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="dbsupport_sqlserver"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Microsoft SQL Server
</fo:marker><fo:block font-size="20.735999999999997pt">2.12. 
Microsoft SQL Server
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="example_props_sqlserver"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.12. 
Example properties for Microsoft SQLServer
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e30944">
openjpa.ConnectionDriverName: com.microsoft.sqlserver.jdbc.SQLServerDriver
openjpa.ConnectionURL: \
jdbc:sqlserver://SERVER_NAME:1433;DatabaseName=DB_NAME;selectMethod=cursor;sendStringParametersAsUnicode=false
</fo:block></fo:block></fo:block><fo:block id="dbsupport_sqlserver_issues"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Known issues with SQL Server
</fo:marker><fo:block font-size="17.28pt">2.12.1. 
Known issues with SQL Server
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e30949"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30950"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
SQL Server date fields are accurate only to the nearest 3 milliseconds,
possibly resulting in precision loss in stored dates.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30953"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The ConnectionURL must always contain the " <fo:inline font-family="monospace">selectMethod=cursor
</fo:inline> " string.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30959"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Adding <fo:inline font-family="monospace">sendStringParametersAsUnicode=false</fo:inline> to the
ConnectionURL may significantly increase performance.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30965"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The Microsoft SQL Server driver only emulates batch updates. The DataDirect JDBC
driver has true support for batch updates, and may result in a significant
performance gain.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30968"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Floats and doubles may lose precision when stored.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30971"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
<fo:inline font-family="monospace">TEXT</fo:inline> columns cannot be used in queries.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30977"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
When using a SQL Server instance that has been configured to be case-sensitive
in schema names, you need to set the "schemaCase=preserve" parameter in the
<fo:basic-link internal-destination="openjpa.jdbc.DBDictionary"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">openjpa.jdbc.DBDictionary</fo:inline></fo:basic-link>
property.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="dbsupport_foxpro"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Microsoft FoxPro
</fo:marker><fo:block font-size="20.735999999999997pt">2.13. 
Microsoft FoxPro
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="example_props_foxpro"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.13. 
Example properties for Microsoft FoxPro
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e30989">
openjpa.ConnectionDriverName: com.ddtek.jdbc.sequelink.SequeLinkDriver
openjpa.ConnectionURL: jdbc:sequelink://SERVER_NAME:SERVER_PORT
</fo:block></fo:block></fo:block><fo:block id="dbsupport_foxpro_issues"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Known issues with Microsoft FoxPro
</fo:marker><fo:block font-size="17.28pt">2.13.1. 
Known issues with Microsoft FoxPro
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e30994"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e30995"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Using the Sun JDBC-ODBC bridge to connect is not supported.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="dbsupport_mysql"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
MySQL
</fo:marker><fo:block font-size="20.735999999999997pt">2.14. 
MySQL
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="example_props_mysql"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.14. 
Example properties for MySQL
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e31004">
openjpa.ConnectionDriverName: com.mysql.jdbc.Driver
openjpa.ConnectionURL: jdbc:mysql://SERVER_NAME/DB_NAME
</fo:block></fo:block></fo:block><fo:block id="dbsupport_mysql_issues"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Known issues with MySQL
</fo:marker><fo:block font-size="17.28pt">2.14.1. 
Known issues with MySQL
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e31009"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31010"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The default table types that MySQL uses do not support transactions, which will
prevent OpenJPA from being able to roll back transactions. Use the
<fo:inline font-family="monospace">InnoDB</fo:inline> table type for any tables that OpenJPA will access.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31016"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
MySQL does not support sub-selects in versions prior to 4.1, and are disabled by
default. Some operations (such as the <fo:inline font-family="monospace">isEmpty()</fo:inline> method in a
query) will fail due to this. If you are using MySQL 4.1 or later, you can lift
this restriction by setting the <fo:inline font-family="monospace">SupportsSubselect=true</fo:inline>
parameter of the <fo:basic-link internal-destination="openjpa.jdbc.DBDictionary"><fo:inline xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold">
openjpa.jdbc.DBDictionary</fo:inline></fo:basic-link> property.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31028"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Rollback due to database error or optimistic lock violation is not supported
unless the table type is one of the MySQL transactional types. Explicit calls to
<fo:inline font-family="monospace">rollback()</fo:inline> before a transaction has been committed,
however, are always supported.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31034"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Floats and doubles may lose precision when stored in some datastores.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31037"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
When storing a field of type <fo:inline font-family="monospace">java.math.BigDecimal</fo:inline>, some
datastores will add extraneous trailing 0 characters, causing an equality
mismatch between the field that is stored and the field that is retrieved.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31043"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Some version of the MySQL JDBC driver have a bug that prevents OpenJPA from
being able to interrogate the database for foreign keys. Version 3.0.14 (or
higher) of the MySQL driver is required in order to get around this bug.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="dbsupport_oracle"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Oracle
</fo:marker><fo:block font-size="20.735999999999997pt">2.15. 
Oracle
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="example_props_oracle"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.15. 
Example properties for Oracle
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e31052">
openjpa.ConnectionDriverName: oracle.jdbc.driver.OracleDriver
openjpa.ConnectionURL: jdbc:oracle:thin:@SERVER_NAME:1521:DB_NAME
</fo:block></fo:block></fo:block><fo:block id="dbsupport_oracle_query_hints"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Using Query Hints with Oracle
</fo:marker><fo:block font-size="17.28pt">2.15.1. 
Using Query Hints with Oracle
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">
Oracle has support for "query hints", which are formatted comments embedded in
SQL that provide some hint for how the query should be executed. These hints are
usually designed to provide suggestions to the Oracle query optimizer for how to
efficiently perform a certainly query, and aren't typically needed for any but
the most intensive queries.
</fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="dbsupport_oracle_query_hints_ex"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.16. 
Using Oracle Hints
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e31062">
Query query = em.createQuery(...);
query.setHint("openjpa.hint.OracleSelectHint", "/*+ first_rows(100) */");
List results = query.getResultList();
</fo:block></fo:block></fo:block></fo:block><fo:block id="dbsupport_oracle_issues"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Known issues with Oracle
</fo:marker><fo:block font-size="17.28pt">2.15.2. 
Known issues with Oracle
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e31067"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31068"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The Oracle JDBC driver has significant differences between different versions.
It is important to use the officially supported version of the driver
(10.2.0.1.0), which is backward compatible with previous versions of the Oracle
server. It can be downloaded from
<fo:basic-link xmlns:xlink="http://www.w3.org/1999/xlink" color="#17184A" font-weight="bold" external-destination="http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc101040.html">
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc101040.html</fo:basic-link>.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31074"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
For VARCHAR fields, <fo:inline font-family="monospace">null</fo:inline> and a blank string are equivalent.
This means that an object that stores a null string field will have it get read
back as a blank string.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31080"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Oracle corp's JDBC driver for Oracle has only limited support for batch updates.
The result for OpenJPA is that in some cases, the exact object that failed an
optimistic lock check cannot be determined, and OpenJPA will throw an
<fo:inline font-family="monospace">OptimisticVerificationException</fo:inline> with more failed objects
than actually failed.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31086"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Oracle cannot store numbers with more than 38 digits in numeric columns.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31089"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Floats and doubles may lose precision when stored.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31092"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
CLOB columns cannot be used in queries.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="dbsupport_pointbase"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Pointbase
</fo:marker><fo:block font-size="20.735999999999997pt">2.16. 
Pointbase
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="example_props_pointbase"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.17. 
Example properties for Pointbase
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e31101">
openjpa.ConnectionDriverName: com.pointbase.jdbc.jdbcUniversalDriver
openjpa.ConnectionURL: \
jdbc:pointbase:DB_NAME,database.home=pointbasedb,create=true,cache.size=10000,database.pagesize=30720
</fo:block></fo:block></fo:block><fo:block id="dbsupport_pointbase_issues"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Known issues with Pointbase
</fo:marker><fo:block font-size="17.28pt">2.16.1. 
Known issues with Pointbase
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e31106"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31107"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Fields of type BLOB and CLOB are limited to 1M. Set the <fo:inline font-family="monospace">BlobTypeName
</fo:inline> and/or <fo:inline font-family="monospace">ClobTypeName</fo:inline> properties of the
<fo:inline font-family="monospace">openjpa.jdbc.DBDictionary</fo:inline> setting to override.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="dbsupport_postgresql"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
PostgreSQL
</fo:marker><fo:block font-size="20.735999999999997pt">2.17. 
PostgreSQL
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="example_props_postgresql"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.18. 
Example properties for PostgreSQL
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e31125">
openjpa.ConnectionDriverName: org.postgresql.Driver
openjpa.ConnectionURL: jdbc:postgresql://SERVER_NAME:5432/DB_NAME
</fo:block></fo:block></fo:block><fo:block id="dbsupport_postgresql_issues"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Known issues with PostgreSQL
</fo:marker><fo:block font-size="17.28pt">2.17.1. 
Known issues with PostgreSQL
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e31130"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31131"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Floats and doubles may lose precision when stored.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31134"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
PostgreSQL cannot store very low and very high dates.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31137"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Empty string/char values are stored as NULL.
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block><fo:block id="dbsupport_sybase"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Sybase Adaptive Server
</fo:marker><fo:block font-size="20.735999999999997pt">2.18. 
Sybase Adaptive Server
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:block><fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" keep-together.within-column="always" id="example_props_sybase"><fo:block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" font-weight="bold" font-size="12pt" hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" space-after.maximum="0.8em" font-style="italic" keep-with-next.within-column="always">Example 2.19. 
Example properties for Sybase
</fo:block><fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false" wrap-option="no-wrap" white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve" text-align="start" font-family="monospace" font-size="7pt" background-color="#F0F0F0" border-color="#000000" border-style="solid" border-width="1px" padding-top="0.5cm" padding-bottom="0.5cm" padding-left="0.5cm" padding-right="0.5cm" id="d0e31146">
openjpa.ConnectionDriverName: com.sybase.jdbc2.jdbc.SybDriver
openjpa.ConnectionURL: \
jdbc:sybase:Tds:SERVER_NAME:4100/DB_NAME?ServiceName=DB_NAME&amp;BE_AS_JDBC_COMPLIANT_AS_POSSIBLE=true
</fo:block></fo:block></fo:block><fo:block id="dbsupport_sybase_issues"><fo:block><fo:block><fo:block keep-together.within-column="always" margin-left="-4pc" font-family="sans-serif,Symbol,ZapfDingbats"><fo:block keep-with-next.within-column="always"><fo:block font-family="sans-serif" font-weight="bold" keep-with-next.within-column="always" space-before.minimum="0.8em" space-before.optimum="1.0em" space-before.maximum="1.2em" text-align="left" start-indent="-4pc" border-bottom-width="1px" border-top-width="0px" border-left-width="0px" border-right-width="0px" border-style="solid" border-width="1px" border-color="#17184A"><fo:marker marker-class-name="section.head.marker">
Known issues with Sybase
</fo:marker><fo:block font-size="17.28pt">2.18.1. 
Known issues with Sybase
</fo:block></fo:block></fo:block></fo:block></fo:block></fo:block><fo:list-block space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" space-after.optimum="1em" space-after.minimum="0.8em" space-after.maximum="1.2em" provisional-label-separation="0.2em" provisional-distance-between-starts="1.0em" id="d0e31151"><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31152"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The "<fo:inline font-family="monospace">DYNAMIC_PREPARE</fo:inline>" parameter of the Sybase JDBC driver
cannot be used with OpenJPA.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31158"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Datastore locking cannot be used when manipulating many-to-many relations using
the default OpenJPA schema created by the schematool, unless an auto-increment
primary key field is manually added to the table.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31161"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
Persisting a zero-length string results in a string with a single space
characted being returned from Sybase, Inc.'s JDBC driver.
</fo:block></fo:block></fo:list-item-body></fo:list-item><fo:list-item space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em" id="d0e31164"><fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label><fo:list-item-body start-indent="body-start()"><fo:block><fo:block>
The <fo:inline font-family="monospace">BE_AS_JDBC_COMPLIANT_AS_POSSIBLE</fo:inline> is required in order to
use datastore (pessimistic) locking. Failure to set this property may lead to
obscure errors like " <fo:inline font-family="monospace">FOR UPDATE can not be used in a SELECT which is
not part of the declaration of a cursor or which is not inside a stored
procedure.</fo:inline> ".
</fo:block></fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block></fo:block></fo:flow></fo:page-sequence></fo:root>