diff --git a/Sda2/sda2.xml b/Sda2/sda2.xml index 6aae4b084f32ecf53bf1dba1628366ef1d4aac80..f3c5f685b478286f92de4e87ef3102c9e0a6cf7f 100644 --- a/Sda2/sda2.xml +++ b/Sda2/sda2.xml @@ -9,8 +9,7 @@ <title>Structured data and applications 2</title> <chapter xml:id="ldap"> - <title><xi:include href="../acronyms.xml" - xpointer="glo_LDAP"/></title> + <title><xi:include href="../acronyms.xml" xpointer="glo_LDAP"/></title> <section xml:id="ldapIntro"> <title>Getting started with <xi:include href="../acronyms.xml" @@ -120,8 +119,8 @@ track</link> neglecting time consuming GUI stuff).</para> <para>Hint: If you do have limited understanding of <xi:include - href="../acronyms.xml" xpointer="glo_LDAP"/> classes an - schemata you may want to create entries containing the following + href="../acronyms.xml" xpointer="glo_LDAP"/> classes an schemata + you may want to create entries containing the following <parameter xlink:href="http://www.zytrax.com/books/ldap/apd/index.html#objectclass">objectClass</parameter> values:</para> @@ -219,8 +218,8 @@ uidNumber: 1023 <para>Without having the <code>objectClass</code> value <code>posixAccount</code> the attribute <code>uid</code> would be disallowed and could thus not be part of our <xi:include - href="../acronyms.xml" xpointer="glo_DN"/> values. This - would leave us with solutions like:</para> + href="../acronyms.xml" xpointer="glo_DN"/> values. This would + leave us with solutions like:</para> <programlisting language="none"><emphasis role="bold">dn: cn=Mee Lapinski,ou=billing,dc=hdm-stuttgart,dc=de</emphasis></programlisting> @@ -236,8 +235,8 @@ uidNumber: 1023 </section> <section xml:id="ldifImportExport"> - <title><xi:include href="../acronyms.xml" xpointer="glo_LDIF"/> - export and import</title> + <title><xi:include href="../acronyms.xml" xpointer="glo_LDIF"/> export + and import</title> <para>This section is intended to get acquainted with <xi:include href="../acronyms.xml" xpointer="glo_LDIF"/> representation of @@ -249,16 +248,15 @@ uidNumber: 1023 <qandaset defaultlabel="qanda" xml:id="qanda_ldifExportImport"> <title>Exporting, modifying and importing <xi:include href="../acronyms.xml" xpointer="glo_LDAP"/> data using the - <xi:include href="../acronyms.xml" xpointer="glo_LDIF"/> - interchange representation.</title> + <xi:include href="../acronyms.xml" xpointer="glo_LDIF"/> interchange + representation.</title> <qandadiv> <qandaentry> <question> <para>Export your current database state being left from <xref linkend="qandaPopulateLdap"/> to an <xi:include - href="../acronyms.xml" xpointer="glo_LDIF"/> text - file.</para> + href="../acronyms.xml" xpointer="glo_LDIF"/> text file.</para> <para>Subsequently use this database dump file as a starting point to create a <xi:include href="../acronyms.xml" @@ -328,9 +326,8 @@ uidNumber: 1028</programlisting> <listitem> <para>All user entries within the whole <xi:include - href="../acronyms.xml" xpointer="glo_DIT"/> having a - common name containing the substring - <quote>ei</quote>.</para> + href="../acronyms.xml" xpointer="glo_DIT"/> having a common + name containing the substring <quote>ei</quote>.</para> </listitem> <listitem> @@ -352,8 +349,8 @@ uidNumber: 1028</programlisting> <itemizedlist> <listitem> <para>The <xi:include href="../acronyms.xml" - xpointer="glo_DIT"/> entry to start from being - identified by its <xi:include href="../acronyms.xml" + xpointer="glo_DIT"/> entry to start from being identified by + its <xi:include href="../acronyms.xml" xpointer="glo_DN"/>.</para> </listitem> @@ -390,8 +387,7 @@ uidNumber: 1028</programlisting> greater than 1023.</emphasis></para> <para>Solution: <code>(uidNumber>=1024)</code> starting - from <xi:include href="../acronyms.xml" - xpointer="glo_DN"/> + from <xi:include href="../acronyms.xml" xpointer="glo_DN"/> <code>ou=billing,dc=hdm-stuttgart,dc=de</code> and scope <code>one level</code>.</para> @@ -404,8 +400,8 @@ uidNumber: 1028</programlisting> <listitem> <para><emphasis role="bold">All user entries within the whole </emphasis><xi:include href="../acronyms.xml" - xpointer="glo_DIT"/><emphasis role="bold"> having a - common name containing the substring + xpointer="glo_DIT"/><emphasis role="bold"> having a common + name containing the substring <quote>ei</quote>.</emphasis></para> <para>Solution: <code>(cn=*ei*)</code>, starting from top of @@ -523,9 +519,8 @@ uidNumber: 1028</programlisting> <listitem> <para>We select <quote>maven-archetype-quickstart</quote> to - choose a plain <xi:include - href="../acronyms.xml" xpointer="glo_Java"/> - project</para> + choose a plain <xi:include href="../acronyms.xml" + xpointer="glo_Java"/> project</para> <informalfigure> <mediaobject> @@ -549,10 +544,9 @@ uidNumber: 1028</programlisting> </listitem> <listitem> - <para>We end up with a <xi:include - href="../acronyms.xml" xpointer="glo_Java"/> project - already being enabled for <productname - xlink:href="http://www.junit.org">Junit</productname> + <para>We end up with a <xi:include href="../acronyms.xml" + xpointer="glo_Java"/> project already being enabled for + <productname xlink:href="http://www.junit.org">Junit</productname> testing.</para> <informalfigure> @@ -601,8 +595,8 @@ uidNumber: 1028</programlisting> <orderedlist> <listitem> <para>Searching for <quote>mysql</quote> in a maven repository - yields the <xi:include - href="../acronyms.xml" xpointer="glo_Java"/> <trademark + yields the <xi:include href="../acronyms.xml" + xpointer="glo_Java"/> <trademark xlink:href="http://www.oracle.com/technetwork/java/javase/jdbc">JDBC</trademark> connector:</para> @@ -700,9 +694,8 @@ uidNumber: 1028</programlisting> <title>Creating a Hibernate configuration</title> <para>Hibernate is intended to provide persistence services saving - transient <xi:include - href="../acronyms.xml" xpointer="glo_Java"/> instances to a - database. For this purpose Hibernate needs:</para> + transient <xi:include href="../acronyms.xml" xpointer="glo_Java"/> + instances to a database. For this purpose Hibernate needs:</para> <itemizedlist> <listitem> @@ -794,11 +787,12 @@ uidNumber: 1028</programlisting> <section xml:id="sect_hibernateBasics"> <title>A round trip working with objects</title> - <para>Hibernate may be regarded as a persistence provider to <xi:include href="../acronyms.xml" - xpointer="glo_JPA"/>:</para> + <para>Hibernate may be regarded as a persistence provider to <xi:include + href="../acronyms.xml" xpointer="glo_JPA"/>:</para> <figure xml:id="jpaPersistProvider"> - <title><link linkend="gloss_JPA"><abbrev>JPA</abbrev></link> persistence provider</title> + <title><xi:include href="../acronyms.xml" xpointer="glo_JPA"/> + persistence provider</title> <mediaobject> <imageobject> @@ -807,8 +801,8 @@ uidNumber: 1028</programlisting> </mediaobject> </figure> - <para>Having configured Hibernate we may now start working with <xi:include - href="../acronyms.xml" xpointer="glo_Java"/> objects. To do + <para>Having configured Hibernate we may now start working with + <xi:include href="../acronyms.xml" xpointer="glo_Java"/> objects. To do so we need an appropriate session object to run transactions. Starting from the Hibernate documentation we code the following helper method:</para> @@ -891,14 +885,9 @@ public class User { <section xml:id="persistingObjects"> <title>Persisting objects</title> - <para>Persisting transient objects may be achieved in various ways. In - <xref linkend="jdbcIntro"/> we introduced the <trademark - xlink:href="http://www.oracle.com/technetwork/java/javase/jdbc">JDBC</trademark> - <abbrev xlink:href="http://en.wikipedia.org/wiki/Api">API</abbrev> - connecting <xi:include - href="../acronyms.xml" xpointer="glo_Java"/> applications - and relational database systems. We stored and retrieved object - values.</para> + <para>Persisting transient objects may be achieved in various ways. + <xi:include href="../acronyms.xml" xpointer="glo_Jdbc"/> allows to + store and retrieved object values.</para> <para>Having larger projects these tasks become increasingly tedious. It is thus desired to automate these tasks while still using @@ -1036,9 +1025,9 @@ import javax.persistence.Entity; <para>The careful reader will have noticed that we've annotated the getter method rather than the property <code>uid</code> itself. - Hibernate / <link linkend="gloss_JPA"><abbrev>JPA</abbrev></link> can - work both ways. Annotating a getter however offers additional support - e.g. when logging for debugging purposes is required.</para> + Hibernate / <xi:include href="../acronyms.xml" xpointer="glo_JPA"/> + can work both ways. Annotating a getter however offers additional + support e.g. when logging for debugging purposes is required.</para> <para>This time we are successful. Since we enabled the logging of SQL statements in <xref linkend="hibernateConfigurationFile"/> Hibernate @@ -1690,7 +1679,7 @@ public class Project { </calloutlist> <qandaset defaultlabel="qanda" xml:id="quandaentry_IdGetterProtected"> - <title><link linkend="gloss_JPA"><abbrev>JPA</abbrev></link> <code + <title><xi:include href="../acronyms.xml" xpointer="glo_JPA"/> <code language="java">id</code> getter visibility.</title> <qandadiv> @@ -1730,19 +1719,19 @@ public class Project { <para>From the viewpoint of software modelling non-unique indexes are not part of the business logic but refer to database optimization. - Consequently <link linkend="gloss_JPA"><abbrev>JPA</abbrev></link> has - no support for non-unique indexes.</para> + Consequently <xi:include href="../acronyms.xml" xpointer="glo_JPA"/> + has no support for non-unique indexes.</para> <para>On the other hand performance matters. Hibernate and other - persistence providers offer vendor specific <link - linkend="gloss_JPA"><abbrev>JPA</abbrev></link> extensions. We may - find it useful to access <classname>hibintro.v5.User</classname> - instances having a specific <code>cname</code> quickly. This can be - achieved by adding a Hibernate specific + persistence providers offer vendor specific <xi:include + href="../acronyms.xml" xpointer="glo_JPA"/> extensions. We may find it + useful to access <classname>hibintro.v5.User</classname> instances + having a specific <code>cname</code> quickly. This can be achieved by + adding a Hibernate specific <code>org.hibernate.annotations.</code><classname>org.hibernate.annotations.Table</classname> index generating annotation <coref linkend="hibernateExtensionIndex"/> - which works on top of <link - linkend="gloss_JPA"><abbrev>JPA</abbrev></link>'s + which works on top of <xi:include href="../acronyms.xml" + xpointer="glo_JPA"/>'s <code>javax.persistence.</code><classname>javax.persistence.Table</classname>:</para> <informaltable border="1"> @@ -1787,14 +1776,14 @@ CREATE INDEX findCname ON User (cname ASC);</programlisting></td> <title>Renaming tables and attributes</title> <para>So far we assumed that we map classes to database tables having - identical names: A <xi:include - href="../acronyms.xml" xpointer="glo_Java"/> class - <code>User</code> is being mapped to a relational table with identical - name <code>User</code>. Sometimes a renaming is desired. We may for - example want to access a legacy database by a newly implemented <xi:include - href="../acronyms.xml" xpointer="glo_Java"/> application. - Choosing meaningful names may conflict with decisions being taken when - the original database design took place.</para> + identical names: A <xi:include href="../acronyms.xml" + xpointer="glo_Java"/> class <code>User</code> is being mapped to a + relational table with identical name <code>User</code>. Sometimes a + renaming is desired. We may for example want to access a legacy + database by a newly implemented <xi:include href="../acronyms.xml" + xpointer="glo_Java"/> application. Choosing meaningful names may + conflict with decisions being taken when the original database design + took place.</para> <para>In the following example we change the database tables name from its default User to Person <coref linkend="renameUserToPerson"/>. The @@ -1852,8 +1841,8 @@ public class User { <section xml:id="sectChangeDefaultTypeMapping"> <title>Changing the default type mapping</title> - <para>Sometimes we are interested in changing <link - linkend="gloss_JPA"><abbrev>JPA</abbrev></link>'s default type mapping + <para>Sometimes we are interested in changing <xi:include + href="../acronyms.xml" xpointer="glo_JPA"/>'s default type mapping strategy. For example <trademark xlink:href="http://www.mysql.com/about/legal/trademark.html">Mysql</trademark> versions prior to 5.0 lack an appropriate type representing boolean @@ -1863,10 +1852,10 @@ public class User { <code>tinyint(1)</code>. Supporting older software may require to tweak the standard mapping.</para> - <para>Unfortunately <link - linkend="gloss_JPA"><abbrev>JPA</abbrev></link> itself does not offer - any interface for this purpose. The persistence provider may offer a - solution though. Hibernate for example allows to remap <coref + <para>Unfortunately <xi:include href="../acronyms.xml" + xpointer="glo_JPA"/> itself does not offer any interface for this + purpose. The persistence provider may offer a solution though. + Hibernate for example allows to remap <coref linkend="remapBooleanChar"/> types . We assume our <classname>hibintro.v9.User</classname> class to have a <code>boolean</code> property <code>active</code>:</para> @@ -2057,16 +2046,16 @@ public class BankAccount extends BillingDetails { <callout arearefs="billingMapSingleTable" xml:id="billingMapSingleTableCallout"> <para>All classes of the inheritance hierarchy will be mapped to a - single table. Unless stated otherwise the <link - linkend="gloss_JPA"><abbrev>JPA</abbrev></link> provider will - choose the root class' name (<code>BillingDetails</code>) as - default value for the generated relation's name <coref + single table. Unless stated otherwise the <xi:include + href="../acronyms.xml" xpointer="glo_JPA"/> provider will choose + the root class' name (<code>BillingDetails</code>) as default + value for the generated relation's name <coref linkend="BillingDetailsGeneratedRelationName"/>.</para> </callout> <callout arearefs="billingMapSingleTableDiscriminator" xml:id="billingMapSingleTableDiscriminatorCallout"> - <para>The <link linkend="gloss_JPA"><abbrev>JPA</abbrev></link> + <para>The <xi:include href="../acronyms.xml" xpointer="glo_JPA"/> provider needs a column to distinguish the different types of database objects. We've chosen the discriminator attribute <code>dataType</code> values to be simple strings. Due to the @@ -2520,7 +2509,7 @@ public class RetrieveAll { <qandaset defaultlabel="qanda" xml:id="quandaentry_IntegrityGenerate"> - <title><link linkend="gloss_JPA"><abbrev>JPA</abbrev></link> + <title><xi:include href="../acronyms.xml" xpointer="glo_JPA"/> constraints and database integrity.</title> <qandadiv> @@ -2529,8 +2518,8 @@ public class RetrieveAll { <para>Explain all integrity constraints of the Hibernate generated schema. Will it implement the constraints corectly on database level corresponding to the inheritance related - <xi:include - href="../acronyms.xml" xpointer="glo_Java"/> objects? On contrary: Are there possible database states + <xi:include href="../acronyms.xml" xpointer="glo_Java"/> + objects? On contrary: Are there possible database states which do not correspond to the domain model's object constraints?</para> </question> @@ -2604,7 +2593,7 @@ CREATE TABLE BankAccount ( <para>The NOT NULL constraints implement their counterpart properties in the corresponding <xi:include - href="../acronyms.xml" xpointer="glo_Java"/> objects.</para> + href="../acronyms.xml" xpointer="glo_Java"/> objects.</para> <para>The mapping does not cover one important integrity constraint of our domain model: The base class @@ -2766,9 +2755,9 @@ second transaction: user.equals(user2):false <coref linkend="rereadInstance_2"/> <para>The two instances in question definitely represent the same database entity. The two entity managers referring to different sessions create two distinct instances within a given <xi:include - href="../acronyms.xml" xpointer="glo_Java"/> runtime.</para> + href="../acronyms.xml" xpointer="glo_Java"/> runtime.</para> - <para>Since <link linkend="gloss_JPA"><abbrev>JPA</abbrev></link> + <para>Since <xi:include href="../acronyms.xml" xpointer="glo_JPA"/> entities require an <code>@javax.persistence.Id</code> attribute we may generally define object equality solely based on this at tribute's value:</para> @@ -3010,9 +2999,10 @@ public class User { </question> <answer> - <para><link linkend="gloss_JPA">JPA</link> allows lazy fetch - mode typically enabled by default. So the <code>uid</code> - attribute's initialization will be deferred until + <para><xi:include href="../acronyms.xml" + xpointer="glo_JPA"/> allows lazy fetch mode typically + enabled by default. So the <code>uid</code> attribute's + initialization will be deferred until <methodname>session3.User.getUid()</methodname> is being called for the first time.</para> </answer> @@ -3025,8 +3015,9 @@ public class User { <section xml:id="entityValueTypes"> <title>Entity and value types</title> - <para>From the viewpoint of <link linkend="gloss_ORM">ORM</link> we - distinguish two distinct types of database objects:</para> + <para>From the viewpoint of <xi:include href="../acronyms.xml" + xpointer="glo_ORM"/> we distinguish two distinct types of database + objects:</para> <glosslist> <glossentry> @@ -3221,8 +3212,8 @@ public class PersistUser { <qandadiv> <qandaentry> <question> - <para>Create a <link linkend="gloss_Hql">HQL</link> query - searching for:</para> + <para>Create a <xi:include href="../acronyms.xml" + xpointer="glo_HQL"/> query searching for:</para> <itemizedlist> <listitem> diff --git a/acronyms.xml b/acronyms.xml index cbe43110817d5f152139f77b9ea05223c3851ced..3df884759af4f14ce99b7c5f58c7e0e531226925 100644 --- a/acronyms.xml +++ b/acronyms.xml @@ -52,7 +52,7 @@ <para><acronym xlink:href="http://docs.jboss.org/hibernate/orm/4.1/manual/en-US/html/ch16.html" - xml:id="glo_Hql">HQL</acronym></para> + xml:id="glo_HQL">HQL</acronym></para> <para><acronym xlink:href="http://www.w3.org/Protocols" xml:id="glo_Http">http</acronym></para> @@ -104,6 +104,9 @@ xlink:href="http://www.mysql.com/about/legal/trademark.html" xml:id="glo_Mysql">Mysql</trademark></para> + <para><acronym xlink:href="http://en.wikipedia.org/wiki/Object-relational_mapping" + xml:id="glo_ORM">ORM</acronym></para> + <para><acronym xlink:href="http://www.php.net" xml:id="glo_PHP">PHP</acronym></para>