You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(22) |
Nov
(308) |
Dec
(131) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(369) |
Feb
(171) |
Mar
(236) |
Apr
(187) |
May
(218) |
Jun
(217) |
Jul
(127) |
Aug
(448) |
Sep
(270) |
Oct
(231) |
Nov
(422) |
Dec
(255) |
2004 |
Jan
(111) |
Feb
(73) |
Mar
(338) |
Apr
(351) |
May
(349) |
Jun
(495) |
Jul
(394) |
Aug
(1048) |
Sep
(499) |
Oct
(142) |
Nov
(269) |
Dec
(638) |
2005 |
Jan
(825) |
Feb
(1272) |
Mar
(593) |
Apr
(690) |
May
(950) |
Jun
(958) |
Jul
(767) |
Aug
(839) |
Sep
(525) |
Oct
(449) |
Nov
(585) |
Dec
(455) |
2006 |
Jan
(603) |
Feb
(656) |
Mar
(195) |
Apr
(114) |
May
(136) |
Jun
(100) |
Jul
(128) |
Aug
(68) |
Sep
(7) |
Oct
(1) |
Nov
(1) |
Dec
(8) |
2007 |
Jan
(4) |
Feb
(3) |
Mar
(8) |
Apr
(16) |
May
(5) |
Jun
(4) |
Jul
(6) |
Aug
(23) |
Sep
(15) |
Oct
(5) |
Nov
(7) |
Dec
(5) |
2008 |
Jan
(5) |
Feb
(1) |
Mar
(1) |
Apr
(5) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <tu...@us...> - 2002-11-25 20:50:31
|
Update of /cvsroot/hibernate/Hibernate/doc/reference In directory sc8-pr-cvs1:/tmp/cvs-serv25884/doc/reference Added Files: README Log Message: Instructions for documentation generation --- NEW FILE: README --- ############################################################################ # REQUIRED SOFTWARE # ############################################################################ Some packages are required to compile the HTML and PDF documentation. On RedHat Linux 7.3, install RPMs: rpm -i jadetex-3.12-2.noarch.rpm \ sgml-common-0.6.3-9.noarch.rpm \ tetex-1.0.7-47.i386.rpm \ tetex-latex-1.0.7-47.i386.rpm \ tetex-dvips-1.0.7-47.i386.rpm \ openjade-1.3.1-4.i386.rpm \ ed-0.2-25.i386.rpm \ tetex-fonts-1.0.7-47.i386.rpm \ docbook-dtds-1.0-8.noarch.rpm \ docbook-style-xsl-1.49-1.noarch.rpm \ docbook-style-dsssl-1.76-1.noarch.rpm Link the current DTD to the real version name: ln -s /usr/share/sgml/docbook/xml-dtd-4.1.2-1.0-8 \ /usr/share/sgml/docbook/xml-dtd-4.1.2 Converting the DocBook XML source to HTML requires an XSL Transformer. Don't use Xalan, it is broken with the current DocBook XSL stylesheets! We recommend using Saxon from http://saxon.sourceforge.net/ - the version in use is 6.5.2. Just move saxon.jar to your libs directory somewhere and change the path in the scripts. The PDF output uses TeX and then converts from TeX to PDF. This stuff is somewhat broken, as the DSSSL stylesheets change regulary and the whole DocBook toolchain is just a big mess. The configuration files are only tested with the package versions of the RPMs above! ############################################################################ # HTML DOCUMENTATION # ############################################################################ The following bash script can be used to generate the HTML documentation (set the path to saxon.jar): -------------------------- dbtrans2html ------------------------------------ #!/bin/bash SAXON=~/dev/lib/saxon.jar; XSL_PARAMS="html.stylesheet='../style.css' \ chunk.section.depth='5' \ use.id.as.filename='1'"; USAGE="usage: dbtrans2html INFILE.xml STYLE.XSL OUTFILE.html|OUTDIR" if [[ -z "$1" || -z "$2" || -z "$3" ]]; then echo $USAGE echo exit fi if [ ! -r $1 ]; then echo $USAGE echo File $1 not found or not readable. echo exit fi echo "Generating HTML with Saxon from XML source: $1" CLASSPATH=$JAVA_HOME/lib/tools.jar:$SAXON; CURRDIR=$PWD; if [ -d $3 ]; then cd $3; java -cp $CLASSPATH com.icl.saxon.StyleSheet $1 $2 $XSL_PARAMS cd $CURRDIR; else java -cp $CLASSPATH com.icl.saxon.StyleSheet -o $3 $1 $2 $XSL_PARAMS fi echo "Finished." ---------------------------------------------------------------------------- Calling the script (use absolute path names!): dbtrans2html ~/Hibernate/doc/reference/src/index.xml \ /usr/share/sgml/docbook/xsl-stylesheets/html/docbook.xsl \ ~/Hibernate/doc/reference/html_single/index.html To generate the chunked online HTML documentation, change the XSL file and use an existing directory as the OUTFILE parameter: dbtrans2html ~/Hibernate/doc/reference/src/index.xml \ /usr/share/sgml/docbook/xsl-stylesheets/html/chunk.xsl \ ~/Hibernate/doc/reference/html/ ############################################################################ # PDF DOCUMENTATION # ############################################################################ The following bash script can be used to generate the PDF documentation (set the path to xml.dcl): -------------------------- dbtrans2pdf ------------------------------------- #!/bin/bash XMLDCL="/usr/share/doc/openjade-1.3.1/pubtext/xml.dcl"; USAGE="usage: dbtrans2pdf INFILE.xml OUTFILE.pdf /path/to/hibernate.dsl" if [[ -z "$1" || -z "$2" ]]; then echo $USAGE echo exit fi if [ ! -r $1 ]; then echo $USAGE echo File \"$1\" not found or not readable. echo exit fi # Generate LaTeX from XML source echo "Generating TeX from XML source: $1" TEMPFILE=`date +%s`; jade -d $3 -t tex -o $TEMPFILE.tex $XMLDCL $1 RETVAL=$? if [ $RETVAL -eq 0 ] ; then echo "Generating PDF..." # This is really broken, but required for references and TOC... # min. 3 times: pdfjadetex $TEMPFILE.tex 2&>/dev/null pdfjadetex $TEMPFILE.tex 2&>/dev/null pdfjadetex $TEMPFILE.tex 2&>/dev/null # Final Move mv $TEMPFILE.pdf $2 echo "Cleanup..." # Cleanup rm $TEMPFILE.* echo "Finished." else echo "ERROR: jadetex failed." rm $TEMPFILE.tex 2&>/dev/null fi ---------------------------------------------------------------------------- Calling the script (use absolute path names!): dbtrans2pdf ~/Hibernate/doc/reference/src/index.xml \ ~/Hibernate/doc/reference/pdf/hibernate_reference.pdf \ ~/Hibernate/doc/reference/hibernate.dsl The script hides the STDERR of pdfjadetex (lots of debugging output) by default. If something goes wrong in this step, you won't see it. If something is broken in the XML, the jade step will spit out errors earlier, though. |
From: <tu...@us...> - 2002-11-25 20:49:44
|
Update of /cvsroot/hibernate/Hibernate/doc/reference In directory sc8-pr-cvs1:/tmp/cvs-serv25444/doc/reference Added Files: hibernate.dsl jadetex.cfg Log Message: Configuration and styles for PDF generation --- NEW FILE: hibernate.dsl --- <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [ <!ENTITY dbstyle SYSTEM "/usr/share/sgml/docbook/dsssl-stylesheets/print/docbook.dsl" CDATA DSSSL> ]> <style-sheet> <style-specification use="docbook"> <style-specification-body> ;; Hibernate Custom Parameters (define %generate-book-toc% ;; REFENTRY generate-book-toc ;; PURP Should a Table of Contents be produced for Books? ;; DESC ;; If true, a Table of Contents will be generated for each 'Book'. ;; /DESC ;; AUTHOR N/A ;; /REFENTRY #t) (define %verbatim-size-factor% ;; REFENTRY verbatim-size-factor ;; PURP Verbatim font scaling factor ;; DESC ;; When a monospace font is selected, the current font size is multiplied ;; by the '%verbatim-size-factor%'. If '%verbatim-size-factor%' ;; is '#f', no scaling is performed (Well, that's not precisely true. ;; In '$verbatim-display$' ;; environments, the font size is calculated with respect to the longest line ;; in the display, if '%verbatim-size-factor%' is '#f'). ;; /DESC ;; AUTHOR N/A ;; /REFENTRY 0.8) (define %section-autolabel% ;; REFENTRY section-autolabel ;; PURP Are sections enumerated? ;; DESC ;; If true, unlabeled sections will be enumerated. ;; /DESC ;; AUTHOR N/A ;; /REFENTRY #t) (define %paper-type% ;; REFENTRY paper-type ;; PURP Name of paper type ;; DESC ;; The paper type value identifies the sort of paper in use, for example, ;; 'A4' or 'USletter'. Setting the paper type is an ;; easy shortcut for setting the correct paper height and width. ;; ;; As distributed, only 'A4' and 'USletter' are supported. You can add ;; additional paper types by updating 'page-width' and 'page-height'. ;; If you do, please pass along your updates. ;; /DESC ;; AUTHOR N/A ;; /REFENTRY ;; "A4" "A4") (define %left-margin% ;; REFENTRY left-margin ;; PURP Width of left margin ;; DESC ;; The '%left-margin%' parameter specifies the width of the left margin ;; of the page. Note that this setting is relative to the physical page, ;; not the writing direction. ;; /DESC ;; AUTHOR N/A ;; /REFENTRY 5pi) (define %body-start-indent% ;; REFENTRY body-start-indent ;; PURP Default indent of body text ;; DESC ;; The default indent of body text. Some elements may have more or less ;; indentation. ;; /DESC ;; AUTHOR N/A ;; /REFENTRY 1pi) ;; space-before set to 0pt doesn't work... this stuff just sucks ;; we add more space to space-after so it doesn't all that bad... (define ($list$) (make display-group space-before: %block-sep% start-indent: (if (INBLOCK?) (inherited-start-indent) (+ %block-start-indent% (inherited-start-indent))) space-after: (* %block-sep% 2.0) )) </style-specification-body> </style-specification> <external-specification id="docbook" document="dbstyle"> </style-sheet> --- NEW FILE: jadetex.cfg --- \hypersetup{colorlinks=true, pdfpagemode=UseOutlines, pdftitle={Hibernate Reference Documentation}, pdfsubject={Reference Documentation}, pdfauthor={Gavin King, Christian Bauer}, pdfkeywords={hibernate reference documentation} } \usepackage{thumbpdf} |
From: <tu...@us...> - 2002-11-25 20:48:29
|
Update of /cvsroot/hibernate/Hibernate/doc/reference In directory sc8-pr-cvs1:/tmp/cvs-serv24915/doc/reference Modified Files: style.css Log Message: New Wiki style for HTML docs Index: style.css =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/reference/style.css,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** style.css 27 Jul 2002 16:43:13 -0000 1.3 --- style.css 25 Nov 2002 20:48:25 -0000 1.4 *************** *** 1,45 **** ! body { font-family: Arial, Verdana, Helvetica, sans-serif; ! font-size: 10.5pt; ! background-color: silver; ! color: navy; ! margin: 0px } ! table { font-size: 10.5pt; ! border-style: solid; ! border-color: silver } ! td { border-style: solid; ! border-width: 0; ! border-color: silver; ! padding: 6 } ! dt { font-weight: bold } ! hr { height:2px; color: navy } ! tt { color: black; font-family: courier, sans-serif; font-size: 10pt } ! pre { color: black; font-family: courier, sans-serif; font-size: 9pt } ! .itemizedlist { padding: 0; margin:0 } ! .listitem { padding: 0; margin:0 } ! .revhistory { border:solid; border-width: 1px; } ! .revision { height:20pt; } ! .revremark { height:20pt; } - .title { color: black; font-size: 12pt } - .subtitle { color: black; font-size: 10pt } ! .programlisting, ! .programlistingco, ! .screen { background-color: #D4D4D4; ! color: black; ! padding: 5pt; ! margin: 5pt } ! :hover { color: red; text-decoration: underline } ! a { text-decoration: none; color: navy; font-weight: bold } ! .chapter, .refentry, ! .book, .reference, ! .preface, .colophon { margin-left: 10pt; ! margin-right: 10pt } --- 1,86 ---- ! A { ! color: #003399; ! } ! A:active { ! color: #003399; ! } ! A:visited { ! color: #888888; ! } ! P, OL, UL, LI, DL, DT, DD, BLOCKQUOTE { ! color: #000000; ! } ! TD, TH, SPAN { ! color: #000000; ! } ! BLOCKQUOTE { ! margin-right: 0px; ! } ! H1, H2, H3, H4, H5, H6 { ! color: #000000; ! font-weight:500; ! margin-top:10px; ! padding-top:15px; ! } ! H1 { font-size: 150%; } ! H2 { font-size: 140%; } ! H3 { font-size: 110%; font-weight: bold; } ! H4 { font-size: 110%; font-weight: bold;} ! H5 { font-size: 100%; font-style: italic; } ! H6 { font-size: 100%; font-style: italic; } ! TT { ! font-size: 90%; ! font-family: "Courier New", Courier, monospace; ! color: #000000; ! } ! PRE { ! font-size: 90%; ! padding: 5px; ! border-style: solid; ! border-width: 1px; ! border-color: #CCCCCC; ! background-color: #F4F4F4; ! } ! ! UL, OL, LI { ! list-style: disc; ! } ! ! HR { ! width: 100%; ! height: 1px; ! background-color: #CCCCCC; ! border-width: 0px; ! padding: 0px; ! color: #CCCCCC; ! } ! ! .variablelist { ! padding-top: 10; ! padding-bottom:10; ! margin:0; ! } ! ! .itemizedlist, UL { ! padding-top: 0; ! padding-bottom:0; ! margin:0; ! } ! ! .term { ! font-weight:bold; ! } ! ! ! ! \ No newline at end of file |
From: <tu...@us...> - 2002-11-25 20:46:46
|
Update of /cvsroot/hibernate/Hibernate/doc/reference In directory sc8-pr-cvs1:/tmp/cvs-serv23960/doc/reference Removed Files: index.html Log Message: No longer required --- index.html DELETED --- |
From: <tu...@us...> - 2002-11-25 20:45:48
|
Update of /cvsroot/hibernate/Hibernate/doc/reference/src In directory sc8-pr-cvs1:/tmp/cvs-serv23455/doc/reference/src Modified Files: transactions.xml Log Message: Renumbered Sections Index: transactions.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/reference/src/transactions.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** transactions.xml 3 Oct 2002 06:01:11 -0000 1.5 --- transactions.xml 25 Nov 2002 20:45:44 -0000 1.6 *************** *** 57,61 **** </sect1> ! <sect1 id="transactions-s3"> <title>Threads and connections</title> --- 57,61 ---- </sect1> ! <sect1 id="transactions-s2"> <title>Threads and connections</title> *************** *** 90,94 **** </sect1> ! <sect1 id="transactions-s5"> <title>Optimistic Locking / Versioning</title> --- 90,94 ---- </sect1> ! <sect1 id="transactions-s3"> <title>Optimistic Locking / Versioning</title> *************** *** 104,108 **** </para> ! <sect2 id="transactions-s5-1"> <title>Long session with automatic versioning</title> --- 104,108 ---- </para> ! <sect2 id="transactions-s3-1"> <title>Long session with automatic versioning</title> *************** *** 128,132 **** ! <sect2 id="transactions-s5-2"> <title>Many sessions with automatic versioning</title> --- 128,132 ---- ! <sect2 id="transactions-s3-2"> <title>Many sessions with automatic versioning</title> *************** *** 149,153 **** </sect2> ! <sect2 id="transactions-s5-3"> <title>Application version checking</title> --- 149,153 ---- </sect2> ! <sect2 id="transactions-s3-3"> <title>Application version checking</title> *************** *** 180,184 **** </sect1> ! <sect1 id="transactions-s2"> <title>Session disconnection</title> --- 180,184 ---- </sect1> ! <sect1 id="transactions-s4"> <title>Session disconnection</title> *************** *** 281,285 **** </sect1> ! <sect1 id="transactions-s4"> <title>Pessimistic Locking</title> --- 281,285 ---- </sect1> ! <sect1 id="transactions-s5"> <title>Pessimistic Locking</title> |
From: <one...@us...> - 2002-11-25 16:15:08
|
Update of /cvsroot/hibernate/Hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv20539 Modified Files: hibernate.properties Log Message: 1.2 rc 1 Index: hibernate.properties =================================================================== RCS file: /cvsroot/hibernate/Hibernate/hibernate.properties,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** hibernate.properties 25 Nov 2002 02:21:08 -0000 1.90 --- hibernate.properties 25 Nov 2002 16:14:35 -0000 1.91 *************** *** 161,165 **** hibernate.connection.pool_size 2 ! #hibernate.statement_cache.size 100 --- 161,165 ---- hibernate.connection.pool_size 2 ! hibernate.statement_cache.size 100 |
From: <one...@us...> - 2002-11-25 16:14:41
|
Update of /cvsroot/hibernate/Hibernate/doc/reference/html In directory sc8-pr-cvs1:/tmp/cvs-serv20539/doc/reference/html Modified Files: examples.html Log Message: 1.2 rc 1 Index: examples.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/reference/html/examples.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** examples.html 21 Nov 2002 09:03:16 -0000 1.4 --- examples.html 25 Nov 2002 16:14:36 -0000 1.5 *************** *** 10,59 **** Heres a possible mapping document: </p><pre class="programlisting"><hibernate-mapping> ! ! <class name="Employer" table="employers"> ! <id name="id"> ! <generator class="sequence"> ! <param>employer_id_seq</param> ! </generator> ! </id> ! <property name="name"/> ! </class> ! ! <class name="Employment" table="employment_periods"> ! ! <id name="id"> ! <generator class="sequence"> ! <param>employment_id_seq</param> ! </generator> ! </id> ! <property name="startDate" column="start_date"/> ! <property name="endDate" column="end_date"/> ! ! <component name="hourlyRate" class="MonetoryAmount"> ! <property name="amount"> ! <column name="hourly_rate" sql-type="NUMERIC(12, 2)"/> ! </property> ! <property name="currency" length="12"/> ! </component> ! ! <many-to-one name="employer" column="employer_id" not-null="true"/> ! <many-to-one name="employee" column="employee_id" not-null="true"/> ! ! </class> ! ! <class name="Employee" table="employees"> ! <id name="id"> ! <generator class="sequence"> ! <param>employee_id_seq</param> ! </generator> ! </id> ! <property name="taxfileNumber"/> ! <component name="name" class="Name"> ! <property name="firstName"/> ! <property name="initial"/> ! <property name="lastName"/> ! </component> ! </class> ! </hibernate-mapping></pre><p> And heres the table schema generated by <tt>SchemaExport</tt>. --- 10,59 ---- Heres a possible mapping document: </p><pre class="programlisting"><hibernate-mapping> ! ! <class name="Employer" table="employers"> ! <id name="id"> ! <generator class="sequence"> ! <param>employer_id_seq</param> ! </generator> ! </id> ! <property name="name"/> ! </class> ! ! <class name="Employment" table="employment_periods"> ! ! <id name="id"> ! <generator class="sequence"> ! <param>employment_id_seq</param> ! </generator> ! </id> ! <property name="startDate" column="start_date"/> ! <property name="endDate" column="end_date"/> ! ! <component name="hourlyRate" class="MonetoryAmount"> ! <property name="amount"> ! <column name="hourly_rate" sql-type="NUMERIC(12, 2)"/> ! </property> ! <property name="currency" length="12"/> ! </component> ! ! <many-to-one name="employer" column="employer_id" not-null="true"/> ! <many-to-one name="employee" column="employee_id" not-null="true"/> ! ! </class> ! ! <class name="Employee" table="employees"> ! <id name="id"> ! <generator class="sequence"> ! <param>employee_id_seq</param> ! </generator> ! </id> ! <property name="taxfileNumber"/> ! <component name="name" class="Name"> ! <property name="firstName"/> ! <property name="initial"/> ! <property name="lastName"/> ! </component> ! </class> ! </hibernate-mapping></pre><p> And heres the table schema generated by <tt>SchemaExport</tt>. *************** *** 99,149 **** </p><pre class="programlisting"><hibernate-mapping> ! <class name="Work" table="works" discriminator-value="W"> ! ! <id name="id" column="id"> ! <generator class="native"/> ! </id> ! <discriminator column="type" type="character"/> ! ! <property name="title"/> ! <set role="authors" table="author_work"> ! <key column="work_id" not-null="true"/> ! <many-to-many class="Author" column="author_id" not-null="true"/> ! </set> ! ! <subclass name="Book" discriminator-value="B"> ! <property name="text"/> ! </subclass> ! ! <subclass name="Song" discriminator-value="S"> ! <property name="tempo"/> ! <property name="genre"/> ! </subclass> ! ! </class> ! <class name="Author" table="authors"> ! ! <id name="id" column="id"> ! <generator class="assigned"/> <!-- The Author must have the same identifier as the Person --> ! </id> ! ! <property name="alias"/> ! <one-to-one name="person" constrained="true"/> ! ! <set role="works" table="author_work" readonly="true"> ! <key column="author_id"/> ! <many-to-many class="Work" column="work_id"/> ! </set> ! ! </class> ! ! <class name="Person" table="persons"> ! <id name="id" column="id"> ! <generator class="native"/> ! </id> ! <property name="name"/> ! </class> ! </hibernate-mapping></pre><p> --- 99,148 ---- </p><pre class="programlisting"><hibernate-mapping> ! <class name="Work" table="works" discriminator-value="W"> ! <id name="id" column="id"> ! <generator class="native"/> ! </id> ! <discriminator column="type" type="character"/> ! ! <property name="title"/> ! <set role="authors" table="author_work"> ! <key column="work_id" not-null="true"/> ! <many-to-many class="Author" column="author_id" not-null="true"/> ! </set> ! ! <subclass name="Book" discriminator-value="B"> ! <property name="text"/> ! </subclass> ! ! <subclass name="Song" discriminator-value="S"> ! <property name="tempo"/> ! <property name="genre"/> ! </subclass> ! ! </class> ! ! <class name="Author" table="authors"> ! ! <id name="id" column="id"> ! <generator class="assigned"/> <!-- The Author must have the same identifier as the Person --> ! </id> ! ! <property name="alias"/> ! <one-to-one name="person" constrained="true"/> ! ! <set role="works" table="author_work" readonly="true"> ! <key column="author_id"/> ! <many-to-many class="Work" column="work_id"/> ! </set> ! ! </class> ! ! <class name="Person" table="persons"> ! <id name="id" column="id"> ! <generator class="native"/> ! </id> ! <property name="name"/> ! </class> </hibernate-mapping></pre><p> *************** *** 196,233 **** </p><pre class="programlisting"><hibernate-mapping> ! <class name="Customer" table="customers"> ! <id name="id"> ! <generator class="native"/> ! </id> ! <property name="name"/> ! <set role="orders" readonly="true"> ! <key column="customer_id"/> ! <one-to-many class="Order"/> ! </set> ! </class> ! ! <class name="Order" table="orders"> ! <id name="id"> ! <generator class="native"/> ! </id> ! <property name="date"/> ! <many-to-one name="customer" column="customer_id"/> ! <list role="lineItems" table="line_items"> ! <key column="order_id"/> ! <index column="line_number"/> ! <composite-element class="LineItem"> ! <property name="quantity"/> ! <many-to-one name="product" column="product_id"/> ! </composite-element> ! </list> ! </class> ! ! <class name="Product" table="products"> ! <id name="id"> ! <generator class="native"/> ! </id> ! <property name="serialNumber"/> ! </class> ! </hibernate-mapping></pre><p> <tt>customers</tt>, <tt>orders</tt>, <tt>line_items</tt> and --- 195,232 ---- </p><pre class="programlisting"><hibernate-mapping> ! <class name="Customer" table="customers"> ! <id name="id"> ! <generator class="native"/> ! </id> ! <property name="name"/> ! <set role="orders" readonly="true"> ! <key column="customer_id"/> ! <one-to-many class="Order"/> ! </set> ! </class> ! ! <class name="Order" table="orders"> ! <id name="id"> ! <generator class="native"/> ! </id> ! <property name="date"/> ! <many-to-one name="customer" column="customer_id"/> ! <list role="lineItems" table="line_items"> ! <key column="order_id"/> ! <index column="line_number"/> ! <composite-element class="LineItem"> ! <property name="quantity"/> ! <many-to-one name="product" column="product_id"/> ! </composite-element> ! </list> ! </class> ! ! <class name="Product" table="products"> ! <id name="id"> ! <generator class="native"/> ! </id> ! <property name="serialNumber"/> ! </class> ! </hibernate-mapping></pre><p> <tt>customers</tt>, <tt>orders</tt>, <tt>line_items</tt> and |
From: <one...@us...> - 2002-11-25 16:14:41
|
Update of /cvsroot/hibernate/Hibernate/doc In directory sc8-pr-cvs1:/tmp/cvs-serv20539/doc Modified Files: hibernate.html Log Message: 1.2 rc 1 Index: hibernate.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/hibernate.html,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** hibernate.html 24 Nov 2002 16:19:04 -0000 1.34 --- hibernate.html 25 Nov 2002 16:14:35 -0000 1.35 *************** *** 95,99 **** <ol> <li> Some features of the query language are not supported for databases which do not have subqueries.</li> ! <li> The table-per-subclass mapping strategy is supported only for databases with ANSI-style <tt>OUTER JOIN</tt> and <tt>CASE</tt></li> <li> Firebird InterClient 2.01 is <strong>strongly</strong> recommended in preference to other versions of Interbase Interclient.</li> <ul> --- 95,99 ---- <ol> <li> Some features of the query language are not supported for databases which do not have subqueries.</li> ! <li> The table-per-subclass mapping strategy is supported only for databases with ANSI-style <tt>CASE...WHEN</tt></li> <li> Firebird InterClient 2.01 is <strong>strongly</strong> recommended in preference to other versions of Interbase Interclient.</li> <ul> |
From: <one...@us...> - 2002-11-25 16:14:41
|
Update of /cvsroot/hibernate/Hibernate/doc/reference/html_single In directory sc8-pr-cvs1:/tmp/cvs-serv20539/doc/reference/html_single Modified Files: index.html Log Message: 1.2 rc 1 Index: index.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/reference/html_single/index.html,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** index.html 24 Nov 2002 15:45:51 -0000 1.84 --- index.html 25 Nov 2002 16:14:37 -0000 1.85 *************** *** 3042,3091 **** Heres a possible mapping document: </p><pre class="programlisting"><hibernate-mapping> ! ! <class name="Employer" table="employers"> ! <id name="id"> ! <generator class="sequence"> ! <param>employer_id_seq</param> ! </generator> ! </id> ! <property name="name"/> ! </class> ! ! <class name="Employment" table="employment_periods"> ! ! <id name="id"> ! <generator class="sequence"> ! <param>employment_id_seq</param> ! </generator> ! </id> ! <property name="startDate" column="start_date"/> ! <property name="endDate" column="end_date"/> ! ! <component name="hourlyRate" class="MonetoryAmount"> ! <property name="amount"> ! <column name="hourly_rate" sql-type="NUMERIC(12, 2)"/> ! </property> ! <property name="currency" length="12"/> ! </component> ! ! <many-to-one name="employer" column="employer_id" not-null="true"/> ! <many-to-one name="employee" column="employee_id" not-null="true"/> ! ! </class> ! ! <class name="Employee" table="employees"> ! <id name="id"> ! <generator class="sequence"> ! <param>employee_id_seq</param> ! </generator> ! </id> ! <property name="taxfileNumber"/> ! <component name="name" class="Name"> ! <property name="firstName"/> ! <property name="initial"/> ! <property name="lastName"/> ! </component> ! </class> ! </hibernate-mapping></pre><p> And heres the table schema generated by <tt>SchemaExport</tt>. --- 3042,3091 ---- Heres a possible mapping document: </p><pre class="programlisting"><hibernate-mapping> ! ! <class name="Employer" table="employers"> ! <id name="id"> ! <generator class="sequence"> ! <param>employer_id_seq</param> ! </generator> ! </id> ! <property name="name"/> ! </class> ! ! <class name="Employment" table="employment_periods"> ! ! <id name="id"> ! <generator class="sequence"> ! <param>employment_id_seq</param> ! </generator> ! </id> ! <property name="startDate" column="start_date"/> ! <property name="endDate" column="end_date"/> ! ! <component name="hourlyRate" class="MonetoryAmount"> ! <property name="amount"> ! <column name="hourly_rate" sql-type="NUMERIC(12, 2)"/> ! </property> ! <property name="currency" length="12"/> ! </component> ! ! <many-to-one name="employer" column="employer_id" not-null="true"/> ! <many-to-one name="employee" column="employee_id" not-null="true"/> ! ! </class> ! ! <class name="Employee" table="employees"> ! <id name="id"> ! <generator class="sequence"> ! <param>employee_id_seq</param> ! </generator> ! </id> ! <property name="taxfileNumber"/> ! <component name="name" class="Name"> ! <property name="firstName"/> ! <property name="initial"/> ! <property name="lastName"/> ! </component> ! </class> ! </hibernate-mapping></pre><p> And heres the table schema generated by <tt>SchemaExport</tt>. *************** *** 3131,3181 **** </p><pre class="programlisting"><hibernate-mapping> ! <class name="Work" table="works" discriminator-value="W"> ! ! <id name="id" column="id"> ! <generator class="native"/> ! </id> ! <discriminator column="type" type="character"/> ! ! <property name="title"/> ! <set role="authors" table="author_work"> ! <key column="work_id" not-null="true"/> ! <many-to-many class="Author" column="author_id" not-null="true"/> ! </set> ! ! <subclass name="Book" discriminator-value="B"> ! <property name="text"/> ! </subclass> ! ! <subclass name="Song" discriminator-value="S"> ! <property name="tempo"/> ! <property name="genre"/> ! </subclass> ! ! </class> ! <class name="Author" table="authors"> ! ! <id name="id" column="id"> ! <generator class="assigned"/> <!-- The Author must have the same identifier as the Person --> ! </id> ! ! <property name="alias"/> ! <one-to-one name="person" constrained="true"/> ! ! <set role="works" table="author_work" readonly="true"> ! <key column="author_id"/> ! <many-to-many class="Work" column="work_id"/> ! </set> ! ! </class> ! ! <class name="Person" table="persons"> ! <id name="id" column="id"> ! <generator class="native"/> ! </id> ! <property name="name"/> ! </class> ! </hibernate-mapping></pre><p> --- 3131,3180 ---- </p><pre class="programlisting"><hibernate-mapping> ! <class name="Work" table="works" discriminator-value="W"> ! <id name="id" column="id"> ! <generator class="native"/> ! </id> ! <discriminator column="type" type="character"/> ! ! <property name="title"/> ! <set role="authors" table="author_work"> ! <key column="work_id" not-null="true"/> ! <many-to-many class="Author" column="author_id" not-null="true"/> ! </set> ! ! <subclass name="Book" discriminator-value="B"> ! <property name="text"/> ! </subclass> ! ! <subclass name="Song" discriminator-value="S"> ! <property name="tempo"/> ! <property name="genre"/> ! </subclass> ! ! </class> ! ! <class name="Author" table="authors"> ! ! <id name="id" column="id"> ! <generator class="assigned"/> <!-- The Author must have the same identifier as the Person --> ! </id> ! ! <property name="alias"/> ! <one-to-one name="person" constrained="true"/> ! ! <set role="works" table="author_work" readonly="true"> ! <key column="author_id"/> ! <many-to-many class="Work" column="work_id"/> ! </set> ! ! </class> ! ! <class name="Person" table="persons"> ! <id name="id" column="id"> ! <generator class="native"/> ! </id> ! <property name="name"/> ! </class> </hibernate-mapping></pre><p> *************** *** 3228,3265 **** </p><pre class="programlisting"><hibernate-mapping> ! <class name="Customer" table="customers"> ! <id name="id"> ! <generator class="native"/> ! </id> ! <property name="name"/> ! <set role="orders" readonly="true"> ! <key column="customer_id"/> ! <one-to-many class="Order"/> ! </set> ! </class> ! ! <class name="Order" table="orders"> ! <id name="id"> ! <generator class="native"/> ! </id> ! <property name="date"/> ! <many-to-one name="customer" column="customer_id"/> ! <list role="lineItems" table="line_items"> ! <key column="order_id"/> ! <index column="line_number"/> ! <composite-element class="LineItem"> ! <property name="quantity"/> ! <many-to-one name="product" column="product_id"/> ! </composite-element> ! </list> ! </class> ! ! <class name="Product" table="products"> ! <id name="id"> ! <generator class="native"/> ! </id> ! <property name="serialNumber"/> ! </class> ! </hibernate-mapping></pre><p> <tt>customers</tt>, <tt>orders</tt>, <tt>line_items</tt> and --- 3227,3264 ---- </p><pre class="programlisting"><hibernate-mapping> ! <class name="Customer" table="customers"> ! <id name="id"> ! <generator class="native"/> ! </id> ! <property name="name"/> ! <set role="orders" readonly="true"> ! <key column="customer_id"/> ! <one-to-many class="Order"/> ! </set> ! </class> ! ! <class name="Order" table="orders"> ! <id name="id"> ! <generator class="native"/> ! </id> ! <property name="date"/> ! <many-to-one name="customer" column="customer_id"/> ! <list role="lineItems" table="line_items"> ! <key column="order_id"/> ! <index column="line_number"/> ! <composite-element class="LineItem"> ! <property name="quantity"/> ! <many-to-one name="product" column="product_id"/> ! </composite-element> ! </list> ! </class> ! ! <class name="Product" table="products"> ! <id name="id"> ! <generator class="native"/> ! </id> ! <property name="serialNumber"/> ! </class> ! </hibernate-mapping></pre><p> <tt>customers</tt>, <tt>orders</tt>, <tt>line_items</tt> and |
From: <one...@us...> - 2002-11-25 10:44:52
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv7421/hibernate/impl Modified Files: SessionImpl.java Log Message: removed shortcut for immutable classes, because it would break collections Index: SessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/SessionImpl.java,v retrieving revision 1.152 retrieving revision 1.153 diff -C2 -d -r1.152 -r1.153 *** SessionImpl.java 20 Nov 2002 14:20:08 -0000 1.152 --- SessionImpl.java 25 Nov 2002 10:44:49 -0000 1.153 *************** *** 1700,1705 **** ClassPersister persister = entry.persister; - if ( entry.existsInDatabase && !persister.isMutable() ) continue; - // make sure user didn't mangle the id if ( persister.hasIdentifierProperty() ) { --- 1700,1703 ---- *************** *** 1793,1797 **** else { ! //now update the object .. has to be outside if block because of nested // collections if (substitute) persister.setPropertyValues(object, values); --- 1791,1795 ---- else { ! // now update the object .. has to be outside if block because of nested // collections if (substitute) persister.setPropertyValues(object, values); |
From: <one...@us...> - 2002-11-25 10:42:57
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv7130/hibernate/impl Modified Files: BatcherImpl.java Log Message: added some logging Index: BatcherImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/BatcherImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BatcherImpl.java 31 Oct 2002 16:58:13 -0000 1.1 --- BatcherImpl.java 25 Nov 2002 10:42:54 -0000 1.2 *************** *** 20,23 **** --- 20,25 ---- public abstract class BatcherImpl implements Batcher { + public static int open; + protected static final Log log = LogFactory.getLog(BatcherImpl.class); *************** *** 41,47 **** --- 43,51 ---- public PreparedStatement prepareStatement(String sql) throws SQLException, HibernateException { executeBatch(); + logOpen(); return factory.getPreparedStatement( session.connection(), sql, false ); } public PreparedStatement prepareQueryStatement(String sql, boolean scrollable) throws SQLException, HibernateException { + logOpen(); PreparedStatement ps = factory.getPreparedStatement( session.connection(), sql, scrollable ); factory.setFetchSize(ps); *************** *** 52,59 **** --- 56,65 ---- public void closeQueryStatement(PreparedStatement ps) throws SQLException { statementsToClose.remove(ps); + logClose(); factory.closePreparedStatement(ps); } public void closeStatement(PreparedStatement ps) throws SQLException { + logClose(); factory.closePreparedStatement(ps); } *************** *** 97,100 **** protected abstract void doExecuteBatch(PreparedStatement ps) throws SQLException, HibernateException; ! } --- 103,117 ---- protected abstract void doExecuteBatch(PreparedStatement ps) throws SQLException, HibernateException; ! ! private static void logOpen() { ! if ( log.isTraceEnabled() ) { ! open++; ! log.trace( open + " open PreparedStatements" ); ! } ! } ! ! private static void logClose() { ! if ( log.isTraceEnabled() ) ! open--; ! } } |
From: <one...@us...> - 2002-11-25 10:42:04
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv6810/hibernate/persister Modified Files: EntityPersister.java Log Message: fixed some PreparedStatement handling Index: EntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/EntityPersister.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** EntityPersister.java 25 Nov 2002 07:25:20 -0000 1.42 --- EntityPersister.java 25 Nov 2002 10:41:59 -0000 1.43 *************** *** 415,423 **** PreparedStatement st = session.getBatcher().prepareStatement( (String) lockers.get(lockMode) ); - - getIdentifierType().nullSafeSet(st, id, 1, session); - if ( isVersioned() ) getVersionType().nullSafeSet(st, version, 2, session); - try { ResultSet rs = st.executeQuery(); try { --- 415,422 ---- PreparedStatement st = session.getBatcher().prepareStatement( (String) lockers.get(lockMode) ); try { + getIdentifierType().nullSafeSet(st, id, 1, session); + if ( isVersioned() ) getVersionType().nullSafeSet(st, version, 2, session); + ResultSet rs = st.executeQuery(); try { |
From: <one...@us...> - 2002-11-25 10:00:09
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv21302/cirrus/hibernate/persister Modified Files: MultiTableEntityPersister.java Log Message: fixed some PreparedStatement handling Index: MultiTableEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/MultiTableEntityPersister.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** MultiTableEntityPersister.java 25 Nov 2002 07:25:20 -0000 1.37 --- MultiTableEntityPersister.java 25 Nov 2002 10:00:05 -0000 1.38 *************** *** 440,448 **** PreparedStatement st = session.getBatcher().prepareStatement( (String) lockers.get(lockMode) ); - - getIdentifierType().nullSafeSet(st, id, 1, session); - if ( isVersioned() ) getVersionType().nullSafeSet(st, version, 2, session); - try { ResultSet rs = st.executeQuery(); try { --- 440,447 ---- PreparedStatement st = session.getBatcher().prepareStatement( (String) lockers.get(lockMode) ); try { + getIdentifierType().nullSafeSet(st, id, 1, session); + if ( isVersioned() ) getVersionType().nullSafeSet(st, version, 2, session); + ResultSet rs = st.executeQuery(); try { *************** *** 477,486 **** // Render the SQL query final PreparedStatement[] statements = new PreparedStatement[ tableNames.length ]; - for ( int i=0; i<tableNames.length; i++ ) { - statements[i] = session.getBatcher().prepareStatement( sqlInsert()[i] ); - } - try { // Write the values of fields onto the prepared statement - we MUST use the state at the time the // insert was issued (cos of foreign key constraints). Not necessarily the object's current state --- 476,485 ---- // Render the SQL query final PreparedStatement[] statements = new PreparedStatement[ tableNames.length ]; try { + for ( int i=0; i<tableNames.length; i++ ) { + statements[i] = session.getBatcher().prepareStatement( sqlInsert()[i] ); + } + // Write the values of fields onto the prepared statement - we MUST use the state at the time the // insert was issued (cos of foreign key constraints). Not necessarily the object's current state *************** *** 496,500 **** } finally { ! for ( int i=0; i<tableNames.length; i++ ) session.getBatcher().closeStatement( statements[i] ); } --- 495,501 ---- } finally { ! for ( int i=0; i<tableNames.length; i++ ) { ! if ( statements[i]!=null ) session.getBatcher().closeStatement( statements[i] ); ! } } *************** *** 582,594 **** } - //Render the SQL query final PreparedStatement[] statements = new PreparedStatement[tableNames.length]; - for ( int i=0; i<tableNames.length; i++ ) { - statements[i] = session.getBatcher().prepareStatement( sqlDelete()[i] ); - } - - try { if ( isVersioned() ) getVersionType().nullSafeSet( statements[0], version, getIdentifierColumnNames().length + 1, session ); --- 583,593 ---- } final PreparedStatement[] statements = new PreparedStatement[tableNames.length]; try { + for ( int i=0; i<tableNames.length; i++ ) { + statements[i] = session.getBatcher().prepareStatement( sqlDelete()[i] ); + } + if ( isVersioned() ) getVersionType().nullSafeSet( statements[0], version, getIdentifierColumnNames().length + 1, session ); *************** *** 610,614 **** } finally { ! for ( int i=0; i<tableNames.length; i++ ) session.getBatcher().closeStatement( statements[i] ); } } --- 609,615 ---- } finally { ! for ( int i=0; i<tableNames.length; i++ ) { ! if ( statements[i]!=null ) session.getBatcher().closeStatement( statements[i] ); ! } } } *************** *** 638,648 **** } - //Render the SQL query final PreparedStatement[] statements = new PreparedStatement[tables]; - for ( int i=0; i<tableNames.length; i++ ) { - if ( tableUpdateNeeded[i] ) statements[i] = session.getBatcher().prepareStatement( sqlUpdate()[i] ); - } - try { int versionParam = dehydrate(id, fields, statements, session); //TODO --- 639,648 ---- } final PreparedStatement[] statements = new PreparedStatement[tables]; try { + + for ( int i=0; i<tableNames.length; i++ ) { + if ( tableUpdateNeeded[i] ) statements[i] = session.getBatcher().prepareStatement( sqlUpdate()[i] ); + } int versionParam = dehydrate(id, fields, statements, session); //TODO *************** *** 653,657 **** if ( tableUpdateNeeded[i] ) check( statements[i].executeUpdate(), id ); } - } --- 653,656 ---- *************** *** 662,666 **** finally { for ( int i=0; i<tableNames.length; i++ ) { ! if ( tableUpdateNeeded[i] ) session.getBatcher().closeStatement( statements[i] ); } } --- 661,665 ---- finally { for ( int i=0; i<tableNames.length; i++ ) { ! if ( statements[i]!=null ) session.getBatcher().closeStatement( statements[i] ); } } |
From: <tu...@us...> - 2002-11-25 08:04:24
|
Update of /cvsroot/hibernate/Hibernate/doc/reference/src In directory sc8-pr-cvs1:/tmp/cvs-serv32091/doc/reference/src Modified Files: examples.xml Log Message: Replaced tabs with whitespaces Index: examples.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/reference/src/examples.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** examples.xml 21 Nov 2002 09:03:31 -0000 1.4 --- examples.xml 25 Nov 2002 08:04:20 -0000 1.5 *************** *** 25,74 **** <programlisting><![CDATA[<hibernate-mapping> ! ! <class name="Employer" table="employers"> ! <id name="id"> ! <generator class="sequence"> ! <param>employer_id_seq</param> ! </generator> ! </id> ! <property name="name"/> ! </class> ! ! <class name="Employment" table="employment_periods"> ! ! <id name="id"> ! <generator class="sequence"> ! <param>employment_id_seq</param> ! </generator> ! </id> ! <property name="startDate" column="start_date"/> ! <property name="endDate" column="end_date"/> ! ! <component name="hourlyRate" class="MonetoryAmount"> ! <property name="amount"> ! <column name="hourly_rate" sql-type="NUMERIC(12, 2)"/> ! </property> ! <property name="currency" length="12"/> ! </component> ! ! <many-to-one name="employer" column="employer_id" not-null="true"/> ! <many-to-one name="employee" column="employee_id" not-null="true"/> ! ! </class> ! ! <class name="Employee" table="employees"> ! <id name="id"> ! <generator class="sequence"> ! <param>employee_id_seq</param> ! </generator> ! </id> ! <property name="taxfileNumber"/> ! <component name="name" class="Name"> ! <property name="firstName"/> ! <property name="initial"/> ! <property name="lastName"/> ! </component> ! </class> ! </hibernate-mapping>]]></programlisting> --- 25,74 ---- <programlisting><![CDATA[<hibernate-mapping> ! ! <class name="Employer" table="employers"> ! <id name="id"> ! <generator class="sequence"> ! <param>employer_id_seq</param> ! </generator> ! </id> ! <property name="name"/> ! </class> ! ! <class name="Employment" table="employment_periods"> ! ! <id name="id"> ! <generator class="sequence"> ! <param>employment_id_seq</param> ! </generator> ! </id> ! <property name="startDate" column="start_date"/> ! <property name="endDate" column="end_date"/> ! ! <component name="hourlyRate" class="MonetoryAmount"> ! <property name="amount"> ! <column name="hourly_rate" sql-type="NUMERIC(12, 2)"/> ! </property> ! <property name="currency" length="12"/> ! </component> ! ! <many-to-one name="employer" column="employer_id" not-null="true"/> ! <many-to-one name="employee" column="employee_id" not-null="true"/> ! ! </class> ! ! <class name="Employee" table="employees"> ! <id name="id"> ! <generator class="sequence"> ! <param>employee_id_seq</param> ! </generator> ! </id> ! <property name="taxfileNumber"/> ! <component name="name" class="Name"> ! <property name="firstName"/> ! <property name="initial"/> ! <property name="lastName"/> ! </component> ! </class> ! </hibernate-mapping>]]></programlisting> *************** *** 135,185 **** <programlisting><![CDATA[<hibernate-mapping> ! <class name="Work" table="works" discriminator-value="W"> ! ! <id name="id" column="id"> ! <generator class="native"/> ! </id> ! <discriminator column="type" type="character"/> ! ! <property name="title"/> ! <set role="authors" table="author_work"> ! <key column="work_id" not-null="true"/> ! <many-to-many class="Author" column="author_id" not-null="true"/> ! </set> ! ! <subclass name="Book" discriminator-value="B"> ! <property name="text"/> ! </subclass> ! ! <subclass name="Song" discriminator-value="S"> ! <property name="tempo"/> ! <property name="genre"/> ! </subclass> ! ! </class> ! <class name="Author" table="authors"> ! ! <id name="id" column="id"> ! <generator class="assigned"/> <!-- The Author must have the same identifier as the Person --> ! </id> ! ! <property name="alias"/> ! <one-to-one name="person" constrained="true"/> ! ! <set role="works" table="author_work" readonly="true"> ! <key column="author_id"/> ! <many-to-many class="Work" column="work_id"/> ! </set> ! ! </class> ! ! <class name="Person" table="persons"> ! <id name="id" column="id"> ! <generator class="native"/> ! </id> ! <property name="name"/> ! </class> ! </hibernate-mapping>]]></programlisting> --- 135,184 ---- <programlisting><![CDATA[<hibernate-mapping> ! <class name="Work" table="works" discriminator-value="W"> ! <id name="id" column="id"> ! <generator class="native"/> ! </id> ! <discriminator column="type" type="character"/> ! ! <property name="title"/> ! <set role="authors" table="author_work"> ! <key column="work_id" not-null="true"/> ! <many-to-many class="Author" column="author_id" not-null="true"/> ! </set> ! ! <subclass name="Book" discriminator-value="B"> ! <property name="text"/> ! </subclass> ! ! <subclass name="Song" discriminator-value="S"> ! <property name="tempo"/> ! <property name="genre"/> ! </subclass> ! ! </class> ! ! <class name="Author" table="authors"> ! ! <id name="id" column="id"> ! <generator class="assigned"/> <!-- The Author must have the same identifier as the Person --> ! </id> ! ! <property name="alias"/> ! <one-to-one name="person" constrained="true"/> ! ! <set role="works" table="author_work" readonly="true"> ! <key column="author_id"/> ! <many-to-many class="Work" column="work_id"/> ! </set> ! ! </class> ! ! <class name="Person" table="persons"> ! <id name="id" column="id"> ! <generator class="native"/> ! </id> ! <property name="name"/> ! </class> </hibernate-mapping>]]></programlisting> *************** *** 253,290 **** <programlisting><![CDATA[<hibernate-mapping> ! <class name="Customer" table="customers"> ! <id name="id"> ! <generator class="native"/> ! </id> ! <property name="name"/> ! <set role="orders" readonly="true"> ! <key column="customer_id"/> ! <one-to-many class="Order"/> ! </set> ! </class> ! ! <class name="Order" table="orders"> ! <id name="id"> ! <generator class="native"/> ! </id> ! <property name="date"/> ! <many-to-one name="customer" column="customer_id"/> ! <list role="lineItems" table="line_items"> ! <key column="order_id"/> ! <index column="line_number"/> ! <composite-element class="LineItem"> ! <property name="quantity"/> ! <many-to-one name="product" column="product_id"/> ! </composite-element> ! </list> ! </class> ! ! <class name="Product" table="products"> ! <id name="id"> ! <generator class="native"/> ! </id> ! <property name="serialNumber"/> ! </class> ! </hibernate-mapping>]]></programlisting> --- 252,289 ---- <programlisting><![CDATA[<hibernate-mapping> ! <class name="Customer" table="customers"> ! <id name="id"> ! <generator class="native"/> ! </id> ! <property name="name"/> ! <set role="orders" readonly="true"> ! <key column="customer_id"/> ! <one-to-many class="Order"/> ! </set> ! </class> ! ! <class name="Order" table="orders"> ! <id name="id"> ! <generator class="native"/> ! </id> ! <property name="date"/> ! <many-to-one name="customer" column="customer_id"/> ! <list role="lineItems" table="line_items"> ! <key column="order_id"/> ! <index column="line_number"/> ! <composite-element class="LineItem"> ! <property name="quantity"/> ! <many-to-one name="product" column="product_id"/> ! </composite-element> ! </list> ! </class> ! ! <class name="Product" table="products"> ! <id name="id"> ! <generator class="native"/> ! </id> ! <property name="serialNumber"/> ! </class> ! </hibernate-mapping>]]></programlisting> |
From: <one...@us...> - 2002-11-25 07:25:23
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv5218/hibernate/test Modified Files: Multi.hbm.xml MultiTableTest.java Log Message: improved SQL for <joined-subclass> mappings Index: Multi.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/Multi.hbm.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Multi.hbm.xml 22 Nov 2002 00:27:09 -0000 1.14 --- Multi.hbm.xml 25 Nov 2002 07:25:21 -0000 1.15 *************** *** 12,16 **** <property name="date" column="date_"/> ! <joined-subclass name="cirrus.hibernate.test.LessSimple" table="subclass"> <key column="id_"/> <property name="intprop" not-null="true"/> --- 12,16 ---- <property name="date" column="date_"/> ! <joined-subclass name="cirrus.hibernate.test.LessSimple" table="leafsubclass"> <key column="id_"/> <property name="intprop" not-null="true"/> *************** *** 25,29 **** </joined-subclass> ! <joined-subclass name="cirrus.hibernate.test.Multi" table="nuthasubclass"> <key column="sid"/> <property name="extraProp"/> --- 25,29 ---- </joined-subclass> ! <joined-subclass name="cirrus.hibernate.test.Multi" table="nonleafsubclass"> <key column="sid"/> <property name="extraProp"/> *************** *** 35,39 **** </component> ! <joined-subclass name="cirrus.hibernate.test.SubMulti" table="submulti"> <key column="sid"/> <property name="amount"/> --- 35,39 ---- </component> ! <joined-subclass name="cirrus.hibernate.test.SubMulti" table="leafsubsubclass"> <key column="sid"/> <property name="amount"/> Index: MultiTableTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/MultiTableTest.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** MultiTableTest.java 20 Nov 2002 10:30:45 -0000 1.11 --- MultiTableTest.java 25 Nov 2002 07:25:21 -0000 1.12 *************** *** 93,96 **** --- 93,112 ---- s.find("from m in class LessSimple where m.other is not null"); s.find("from m in class SubMulti where m.amount > 0.0"); + + assertTrue( + s.find("from m in class Multi").size()==2 + ); + /*assertTrue( + s.find("from m in class Multi where m.class = Multi").size()==1 + );*/ + assertTrue( + s.find("from s in class Simple").size()==3 + ); + assertTrue( + s.find("from ls in class LessSimple").size()==0 + ); + assertTrue( + s.find("from sm in class SubMulti").size()==1 + ); t.commit(); s.close(); |
From: <one...@us...> - 2002-11-25 07:25:23
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/query In directory sc8-pr-cvs1:/tmp/cvs-serv5218/hibernate/query Modified Files: QueryTranslator.java Log Message: improved SQL for <joined-subclass> mappings Index: QueryTranslator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/query/QueryTranslator.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** QueryTranslator.java 25 Nov 2002 05:18:00 -0000 1.50 --- QueryTranslator.java 25 Nov 2002 07:25:20 -0000 1.51 *************** *** 595,599 **** Queryable p = getPersisterForName(name); buf.append(' ') ! .append( p.fromClauseFragment(name) ); if ( iter.hasNext() || collections.size()!=0 ) buf.append(','); } --- 595,599 ---- Queryable p = getPersisterForName(name); buf.append(' ') ! .append( p.fromClauseFragment(name, true) ); if ( iter.hasNext() || collections.size()!=0 ) buf.append(','); } |
From: <one...@us...> - 2002-11-25 07:25:23
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv5218/hibernate/persister Modified Files: EntityPersister.java Loadable.java MultiTableEntityPersister.java Log Message: improved SQL for <joined-subclass> mappings Index: EntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/EntityPersister.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** EntityPersister.java 25 Nov 2002 05:18:00 -0000 1.41 --- EntityPersister.java 25 Nov 2002 07:25:20 -0000 1.42 *************** *** 813,825 **** } ! public String fromClauseFragment(String name) { return getTableName() + ' ' + name; } ! public String outerJoinsAfterFrom(String name) { return ""; } ! public String outerJoinsAfterWhere(String name) { return ""; } --- 813,825 ---- } ! public String fromClauseFragment(String name, boolean innerJoin) { return getTableName() + ' ' + name; } ! public String outerJoinsAfterFrom(String name, boolean innerJoin) { return ""; } ! public String outerJoinsAfterWhere(String name, boolean innerJoin) { return ""; } Index: Loadable.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/Loadable.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Loadable.java 25 Nov 2002 02:21:10 -0000 1.12 --- Loadable.java 25 Nov 2002 07:25:20 -0000 1.13 *************** *** 95,107 **** * Get the from clause fragment, given a query alias */ ! public String fromClauseFragment(String name); /** * Get any the outer join SQL fragments that appear in the <tt>FROM</tt> clause */ ! public String outerJoinsAfterFrom(String name); /** * Get any the outer join SQL fragments that appear in the <tt>WHERE</tt> clause */ ! public String outerJoinsAfterWhere(String name); } --- 95,107 ---- * Get the from clause fragment, given a query alias */ ! public String fromClauseFragment(String name, boolean innerJoin); /** * Get any the outer join SQL fragments that appear in the <tt>FROM</tt> clause */ ! public String outerJoinsAfterFrom(String name, boolean innerJoin); /** * Get any the outer join SQL fragments that appear in the <tt>WHERE</tt> clause */ ! public String outerJoinsAfterWhere(String name, boolean innerJoin); } Index: MultiTableEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/MultiTableEntityPersister.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** MultiTableEntityPersister.java 25 Nov 2002 05:18:00 -0000 1.36 --- MultiTableEntityPersister.java 25 Nov 2002 07:25:20 -0000 1.37 *************** *** 61,64 **** --- 61,65 ---- private transient final String[] subclassTableNameClosure; private transient final String[][] subclassTableKeyColumns; + private transient final boolean[] isSubclassTable; private transient final String[] deleteStrings; *************** *** 421,425 **** Object result = loader.load(session, id, optionalObject); ! lock(id, getVersion(result), result, lockMode, session); return result; --- 422,426 ---- Object result = loader.load(session, id, optionalObject); ! if (result!=null) lock(id, getVersion(result), result, lockMode, session); return result; *************** *** 725,731 **** tableKeyColumns = (String[][]) keyColumns.toArray( new String[0][] ); ! tables = new ArrayList(); keyColumns = new ArrayList(); ! tables.add(qualifiedTableName); keyColumns.add( getIdentifierColumnNames() ); titer = model.getSubclassTableClosureIterator(); --- 726,732 ---- tableKeyColumns = (String[][]) keyColumns.toArray( new String[0][] ); ! ArrayList subtables = new ArrayList(); keyColumns = new ArrayList(); ! subtables.add(qualifiedTableName); keyColumns.add( getIdentifierColumnNames() ); titer = model.getSubclassTableClosureIterator(); *************** *** 734,738 **** String tabname = tab.getQualifiedName( factory.getDefaultSchema() ); if ( !tabname.equals(qualifiedTableName) ) { ! tables.add(tabname); String[] key = new String[idColumnSpan]; Iterator kiter = tab.getPrimaryKey().getColumnIterator(); --- 735,739 ---- String tabname = tab.getQualifiedName( factory.getDefaultSchema() ); if ( !tabname.equals(qualifiedTableName) ) { ! subtables.add(tabname); String[] key = new String[idColumnSpan]; Iterator kiter = tab.getPrimaryKey().getColumnIterator(); *************** *** 741,746 **** } } ! subclassTableNameClosure = (String[]) tables.toArray( new String[0] ); subclassTableKeyColumns = (String[][]) keyColumns.toArray( new String[0][] ); // PROPERTIES --- 742,751 ---- } } ! subclassTableNameClosure = (String[]) subtables.toArray( new String[0] ); subclassTableKeyColumns = (String[][]) keyColumns.toArray( new String[0][] ); + isSubclassTable = new boolean[ subclassTableNameClosure.length ]; + for ( int j=0; j<subclassTableNameClosure.length; j++ ) { + isSubclassTable[j] = tables.contains( subclassTableNameClosure[j] ); + } // PROPERTIES *************** *** 955,968 **** } ! public String fromClauseFragment(String name) { StringBuffer buf = new StringBuffer(100); buf.append( subclassTableNameClosure[0] ) .append(' ') .append(name) ! .append( outerJoinsAfterFrom(name) ); return buf.toString(); } ! public String outerJoinsAfterFrom(String name) { StringBuffer buf = new StringBuffer(20); OuterJoinGenerator ojg = factory.getDialect().getOuterJoinGenerator(); --- 960,973 ---- } ! public String fromClauseFragment(String name, boolean innerJoin) { StringBuffer buf = new StringBuffer(100); buf.append( subclassTableNameClosure[0] ) .append(' ') .append(name) ! .append( outerJoinsAfterFrom(name, innerJoin) ); return buf.toString(); } ! public String outerJoinsAfterFrom(String name, boolean innerJoin) { StringBuffer buf = new StringBuffer(20); OuterJoinGenerator ojg = factory.getDialect().getOuterJoinGenerator(); *************** *** 971,977 **** buf, subclassTableNameClosure[i], ! name+i, StringHelper.prefix( getIdentifierColumnNames(), name + '.' ), ! subclassTableKeyColumns[i] ); } --- 976,983 ---- buf, subclassTableNameClosure[i], ! name+'_'+i, StringHelper.prefix( getIdentifierColumnNames(), name + '.' ), ! subclassTableKeyColumns[i], ! innerJoin && isSubclassTable[i] ); } *************** *** 979,991 **** } ! public String outerJoinsAfterWhere(String name) { StringBuffer buf = new StringBuffer(20); OuterJoinGenerator ojg = factory.getDialect().getOuterJoinGenerator(); for ( int i=1; i<subclassTableNameClosure.length; i++ ) { ojg.appendOuterJoinStringAfterWhere( buf, ! name+i, StringHelper.prefix( getIdentifierColumnNames(), name + '.' ), ! subclassTableKeyColumns[i] ); } --- 985,999 ---- } ! public String outerJoinsAfterWhere(String name, boolean innerJoin) { StringBuffer buf = new StringBuffer(20); OuterJoinGenerator ojg = factory.getDialect().getOuterJoinGenerator(); + //TODO: change to use inner joins instead of "not null" for ( int i=1; i<subclassTableNameClosure.length; i++ ) { ojg.appendOuterJoinStringAfterWhere( buf, ! name+'_'+i, StringHelper.prefix( getIdentifierColumnNames(), name + '.' ), ! subclassTableKeyColumns[i], ! innerJoin && isSubclassTable[i] ); } *************** *** 998,1002 **** //TODO: change to use inner joins instead of "not null" ! if ( isInherited() ) { int last = tableNumbers.length-1; int tab = tableNumbers[last]; --- 1006,1010 ---- //TODO: change to use inner joins instead of "not null" ! /*if ( isInherited() ) { int last = tableNumbers.length-1; int tab = tableNumbers[last]; *************** *** 1010,1019 **** .toString(); } ! else { ! String ojw = outerJoinsAfterWhere(name); //remove leading " AND " if ( ojw.toUpperCase().startsWith(" AND ") ) ojw = ojw.substring(5); return ojw; ! } } --- 1018,1027 ---- .toString(); } ! else {*/ ! String ojw = outerJoinsAfterWhere(name, true); //remove leading " AND " if ( ojw.toUpperCase().startsWith(" AND ") ) ojw = ojw.substring(5); return ojw; ! //} } *************** *** 1042,1053 **** int tab = ( (Integer) tableNumberByPropertyPath.get(property) ).intValue(); ! return StringHelper.prefix( cols, name + ( (tab==0) ? "" : Integer.toString(tab) ) + '.' ); } public String[] toColumns(String name, int i) { int tab = subclassPropertyTableNumberClosure[i]; ! return StringHelper.prefix( subclassPropertyColumnNameClosure[i], name + ( (tab==0) ? "" : Integer.toString(tab) ) + '.' ); } - public String propertySelectClauseFragment(String name, String suffix) { --- 1050,1060 ---- int tab = ( (Integer) tableNumberByPropertyPath.get(property) ).intValue(); ! return StringHelper.prefix( cols, name + ( (tab==0) ? "" : '_' +Integer.toString(tab) ) + '.' ); } public String[] toColumns(String name, int i) { int tab = subclassPropertyTableNumberClosure[i]; ! return StringHelper.prefix( subclassPropertyColumnNameClosure[i], name + ( (tab==0) ? "" : '_' +Integer.toString(tab) ) + '.' ); } public String propertySelectClauseFragment(String name, String suffix) { *************** *** 1061,1065 **** .append(name); int tab = tableNumbers[i]; ! if (tab!=0) buf.append(tab); buf.append('.') .append( notNullColumns[i] ) --- 1068,1072 ---- .append(name); int tab = tableNumbers[i]; ! if (tab!=0) buf.append('_').append(tab); buf.append('.') .append( notNullColumns[i] ) *************** *** 1077,1081 **** buf.append(", ") .append(name); ! if (tab!=0) buf.append(tab); buf.append('.') .append( cols[i] ) --- 1084,1088 ---- buf.append(", ") .append(name); ! if (tab!=0) buf.append('_').append(tab); buf.append('.') .append( cols[i] ) |
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader In directory sc8-pr-cvs1:/tmp/cvs-serv5218/hibernate/loader Modified Files: AnsiOuterJoinGenerator.java EntityLoader.java OneToManyLoader.java OracleOuterJoinGenerator.java OuterJoinGenerator.java Log Message: improved SQL for <joined-subclass> mappings Index: AnsiOuterJoinGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader/AnsiOuterJoinGenerator.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AnsiOuterJoinGenerator.java 25 Nov 2002 02:21:09 -0000 1.5 --- AnsiOuterJoinGenerator.java 25 Nov 2002 07:25:20 -0000 1.6 *************** *** 15,21 **** } ! public final String appendOuterJoinStringAfterFrom(StringBuffer buf, String tableName, String alias, String[] fkColumns, String[] pkColumns) { ! buf.append(" LEFT OUTER JOIN ") .append(tableName) .append(' ') --- 15,21 ---- } ! public final String appendOuterJoinStringAfterFrom(StringBuffer buf, String tableName, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin) { ! buf.append( innerJoin ? " INNER JOIN " : " LEFT OUTER JOIN ") .append(tableName) .append(' ') *************** *** 34,38 **** } ! public final String appendOuterJoinStringAfterWhere(StringBuffer buf, String alias, String[] fkColumns, String[] pkColumns) { return EMPTY_STRING; } --- 34,38 ---- } ! public final String appendOuterJoinStringAfterWhere(StringBuffer buf, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin) { return EMPTY_STRING; } Index: EntityLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader/EntityLoader.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** EntityLoader.java 5 Nov 2002 06:46:06 -0000 1.10 --- EntityLoader.java 25 Nov 2002 07:25:20 -0000 1.11 *************** *** 43,47 **** selectString( persister, alias, suffixes[joins] ), // FROM CLAUSE ! persister.fromClauseFragment(alias), // OUTER JOINS (Insertion Point 1) outerJoinGenerator.outerJoinStringAfterFrom(associations), --- 43,47 ---- selectString( persister, alias, suffixes[joins] ), // FROM CLAUSE ! persister.fromClauseFragment(alias, true), // OUTER JOINS (Insertion Point 1) outerJoinGenerator.outerJoinStringAfterFrom(associations), *************** *** 49,53 **** whereString( persister.getIdentifierColumnNames(), alias ), // OUTER JOINS (Insertion Point 2) ! outerJoinGenerator.outerJoinStringAfterWhere(associations) ); --- 49,54 ---- whereString( persister.getIdentifierColumnNames(), alias ), // OUTER JOINS (Insertion Point 2) ! outerJoinGenerator.outerJoinStringAfterWhere(associations) + ! persister.outerJoinsAfterWhere(alias, true) ); Index: OneToManyLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader/OneToManyLoader.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** OneToManyLoader.java 5 Nov 2002 06:46:06 -0000 1.11 --- OneToManyLoader.java 25 Nov 2002 07:25:20 -0000 1.12 *************** *** 55,59 **** selectString( persister, alias, suffixes[joins] ), // FROM CLAUSE ! persister.fromClauseFragment(alias), // OUTER JOINS (Insertion Point 1) outerJoinGenerator.outerJoinStringAfterFrom(associations), --- 55,59 ---- selectString( persister, alias, suffixes[joins] ), // FROM CLAUSE ! persister.fromClauseFragment(alias, true), // OUTER JOINS (Insertion Point 1) outerJoinGenerator.outerJoinStringAfterFrom(associations), *************** *** 61,65 **** whereString( collPersister.getKeyColumnNames(), alias ), // OUTER JOINS (Insertion Point 2) ! outerJoinGenerator.outerJoinStringAfterWhere(associations), // ORDER BY CLAUSE collPersister.hasOrdering() ? --- 61,66 ---- whereString( collPersister.getKeyColumnNames(), alias ), // OUTER JOINS (Insertion Point 2) ! outerJoinGenerator.outerJoinStringAfterWhere(associations) + ! persister.outerJoinsAfterWhere(alias, true), // ORDER BY CLAUSE collPersister.hasOrdering() ? Index: OracleOuterJoinGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader/OracleOuterJoinGenerator.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** OracleOuterJoinGenerator.java 25 Nov 2002 02:21:09 -0000 1.5 --- OracleOuterJoinGenerator.java 25 Nov 2002 07:25:20 -0000 1.6 *************** *** 13,17 **** } ! public final String appendOuterJoinStringAfterFrom(StringBuffer buf, String tableName, String alias, String[] fkColumns, String[] pkColumns) { buf.append(", ") --- 13,17 ---- } ! public final String appendOuterJoinStringAfterFrom(StringBuffer buf, String tableName, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin) { buf.append(", ") *************** *** 22,26 **** } ! public final String appendOuterJoinStringAfterWhere(StringBuffer buf, String alias, String[] fkColumns, String[] pkColumns) { for ( int j=0; j<fkColumns.length; j++) { --- 22,26 ---- } ! public final String appendOuterJoinStringAfterWhere(StringBuffer buf, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin) { for ( int j=0; j<fkColumns.length; j++) { *************** *** 30,35 **** .append(alias) .append('.') ! .append( pkColumns[j] ) ! .append("(+)"); } return buf.toString(); --- 30,35 ---- .append(alias) .append('.') ! .append( pkColumns[j] ); ! if (!innerJoin) buf.append("(+)"); } return buf.toString(); Index: OuterJoinGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader/OuterJoinGenerator.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** OuterJoinGenerator.java 25 Nov 2002 02:21:09 -0000 1.4 --- OuterJoinGenerator.java 25 Nov 2002 07:25:20 -0000 1.5 *************** *** 26,32 **** oj.subalias, oj.foreignKeyColumns, ! oj.subpersister.getIdentifierColumnNames() ); ! buf.append( oj.subpersister.outerJoinsAfterFrom(oj.subalias) ); } return buf.toString(); --- 26,33 ---- oj.subalias, oj.foreignKeyColumns, ! oj.subpersister.getIdentifierColumnNames(), ! false ); ! buf.append( oj.subpersister.outerJoinsAfterFrom(oj.subalias, false) ); } return buf.toString(); *************** *** 46,52 **** oj.subalias, oj.foreignKeyColumns, ! oj.subpersister.getIdentifierColumnNames() ); ! buf.append( oj.subpersister.outerJoinsAfterWhere(oj.subalias) ); } return buf.toString(); --- 47,54 ---- oj.subalias, oj.foreignKeyColumns, ! oj.subpersister.getIdentifierColumnNames(), ! false ); ! buf.append( oj.subpersister.outerJoinsAfterWhere(oj.subalias, false) ); } return buf.toString(); *************** *** 57,67 **** * To be inserted after the FROM clause. */ ! public abstract String appendOuterJoinStringAfterFrom(StringBuffer buf, String tableName, String alias, String[] fkColumns, String[] pkColumns); /** ! * Generate a <tt>LEFT OUTER JOIN</tt> clause to the table of the entity class * To be inserted after the FROM clause. */ ! public abstract String appendOuterJoinStringAfterWhere(StringBuffer buf, String alias, String[] fkColumns, String[] pkColumns); } --- 59,69 ---- * To be inserted after the FROM clause. */ ! public abstract String appendOuterJoinStringAfterFrom(StringBuffer buf, String tableName, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin); /** ! * Generate a <tt>ON</tt> clause to the table of the entity class * To be inserted after the FROM clause. */ ! public abstract String appendOuterJoinStringAfterWhere(StringBuffer buf, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin); } |
From: <one...@us...> - 2002-11-25 05:18:03
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/query In directory sc8-pr-cvs1:/tmp/cvs-serv27042/hibernate/query Modified Files: QueryTranslator.java Log Message: miscellaneous refactoring Index: QueryTranslator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/query/QueryTranslator.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** QueryTranslator.java 25 Nov 2002 02:21:10 -0000 1.49 --- QueryTranslator.java 25 Nov 2002 05:18:00 -0000 1.50 *************** *** 626,639 **** //render the " and foo.class in ( 'Foo', 'Bar' ) " bit String where = p.getQueryWhereClause(name); - String ojWhere = p.outerJoinsAfterWhere(name); if ( where!=null ) { ! if (!first) inClassWheres.append(" and "); first=false; inClassWheres.append(where); - } - if (ojWhere.length()>1) { //UGLY - if (first) ojWhere = ojWhere.substring(5); //get rid of leading " AND "? - first=false; - inClassWheres.append(ojWhere); } --- 626,633 ---- //render the " and foo.class in ( 'Foo', 'Bar' ) " bit String where = p.getQueryWhereClause(name); if ( where!=null ) { ! if (!first) inClassWheres.append(" AND "); first=false; inClassWheres.append(where); } |
From: <one...@us...> - 2002-11-25 05:18:03
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv27042/hibernate/test Modified Files: FooBarTest.java Log Message: miscellaneous refactoring Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/FooBarTest.java,v retrieving revision 1.229 retrieving revision 1.230 diff -C2 -d -r1.229 -r1.230 *** FooBarTest.java 24 Nov 2002 15:45:50 -0000 1.229 --- FooBarTest.java 25 Nov 2002 05:18:00 -0000 1.230 *************** *** 1547,1550 **** --- 1547,1553 ---- s.iterate("select fum.id.short, fum.id.date, fum.id.string from fum in class cirrus.hibernate.test.Fum").hasNext() ); + assertTrue( + s.iterate("select fum.id from fum in class cirrus.hibernate.test.Fum").hasNext() + ); Query qu = s.createQuery("select fum.fum, fum , fum.fum, fum.id.date from fum in class cirrus.hibernate.test.Fum"); Type[] types = qu.getReturnTypes(); |
From: <one...@us...> - 2002-11-25 05:18:02
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv27042/hibernate/persister Modified Files: AbstractEntityPersister.java EntityPersister.java MultiTableEntityPersister.java Log Message: miscellaneous refactoring Index: AbstractEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/AbstractEntityPersister.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** AbstractEntityPersister.java 19 Nov 2002 10:42:17 -0000 1.14 --- AbstractEntityPersister.java 25 Nov 2002 05:18:00 -0000 1.15 *************** *** 5,8 **** --- 5,9 ---- import java.lang.reflect.Constructor; import java.lang.reflect.Method; + import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; *************** *** 26,29 **** --- 27,32 ---- import cirrus.hibernate.helpers.StringHelper; import cirrus.hibernate.id.IdentifierGenerator; + import cirrus.hibernate.id.NativeGenerator; + import cirrus.hibernate.map.Column; import cirrus.hibernate.map.PersistentClass; import cirrus.hibernate.map.Property; *************** *** 35,38 **** --- 38,42 ---- import cirrus.hibernate.sql.Dialect; import cirrus.hibernate.type.AbstractComponentType; + import cirrus.hibernate.type.IdentifierType; import cirrus.hibernate.type.Type; import cirrus.hibernate.type.TypeFactory; *************** *** 66,75 **** private transient final boolean hasCascades; private transient final boolean mutable; private transient final Class superclass; ! private transient final Class[] proxyInterfaces; private transient final Class concreteProxyClass; private transient final boolean hasProxy; private transient final boolean hasEmbeddedIdentifier; private transient final String identifierPropertyName; --- 70,90 ---- private transient final boolean hasCascades; private transient final boolean mutable; + private transient final boolean useIdentityColumn; private transient final Class superclass; ! ! private transient final String identitySelectString; ! private transient final Class[] proxyInterfaces; private transient final Class concreteProxyClass; private transient final boolean hasProxy; private transient final boolean hasEmbeddedIdentifier; + + private transient final String[] identifierColumnNames; + private transient final Cascades.IdentifierValue unsavedIdentifierValue; + + private transient final HashMap idTypesByPropertyPath = new HashMap(); + private transient final HashMap idColumnNamesByPropertyPath = new HashMap(); + protected transient final HashMap columnNamesByPropertyPath = new HashMap(); + protected transient final HashMap typesByPropertyPath = new HashMap(); private transient final String identifierPropertyName; *************** *** 83,86 **** --- 98,102 ---- private transient final String versionPropertyName; + private transient final String versionColumnName; private transient final VersionType versionType; private transient final Method getVersionMethod; *************** *** 142,146 **** int loc = path.indexOf("."); ! String componentPath = (loc>0) ? path.substring(loc+1) : ""; if ( getIdentifierType().isComponentType() ) { --- 158,162 ---- int loc = path.indexOf("."); ! String componentPath = path.substring(loc+1); if ( getIdentifierType().isComponentType() ) { *************** *** 179,186 **** ( idprop!=null && path.startsWith(idprop + '.') ) ) { ! return getIdentifierPropertyType( path.substring( PathExpressionParser.ENTITY_ID.length() ) ); } else { ! return null; } } --- 195,202 ---- ( idprop!=null && path.startsWith(idprop + '.') ) ) { ! return getIdentifierPropertyType( path.substring( PathExpressionParser.ENTITY_ID.length()+1 ) ); } else { ! return (Type) typesByPropertyPath.get(path); } } *************** *** 190,199 **** return cascadeStyles; } - - /** - * Given a component path expression, get the columns used to - * persist the composite identifier property - */ - protected abstract String[] getIdentifierPropertyColumnNames(String path); /** --- 206,209 ---- *************** *** 306,309 **** --- 316,323 ---- } + public String[] getIdentifierColumnNames() { + return identifierColumnNames; + } + public boolean isPolymorphic() { return polymorphic; *************** *** 314,317 **** --- 328,335 ---- } + public boolean hasCompositeKey() { + return identifierColumnNames.length>1; + } + public boolean hasCascades() { return hasCascades; *************** *** 341,344 **** --- 359,369 ---- } + public boolean isIdentifierAssignedByInsert() { + return useIdentityColumn; + } + + public boolean isUnsaved(Serializable id) { + return unsavedIdentifierValue.isUnsaved(id); + } public String[] getPropertyNames() { *************** *** 349,353 **** --- 374,392 ---- return identifierPropertyName; } + + public String getVersionColumnName() { + return versionColumnName; + } + public final String[] getIdentifierPropertyColumnNames(String path) { + return (String[]) idColumnNamesByPropertyPath.get(path); + } + public final Type getIdentifierPropertyType(String path) { + return (Type) idTypesByPropertyPath.get(path); + } + public final String[] getPropertyColumnNames(String path) { + return (String[]) columnNamesByPropertyPath.get(path); + } + public boolean implementsLifecycle() { return implementsLifecycle; *************** *** 382,385 **** --- 421,431 ---- } + /** + * The query that returns the generated identifier for an identity column + */ + protected final String sqlIdentitySelect() { + return identitySelectString; + } + public IdentifierGenerator getIdentifierGenerator() throws HibernateException { if (idgen==null) throw new HibernateException( *************** *** 455,459 **** ! // VERSION: if ( model.isVersioned() ) { --- 501,581 ---- ! // IDENTIFIER ! ! int idColumnSpan = model.getIdentifier().getColumnSpan(); ! identifierColumnNames = new String[idColumnSpan]; ! ! iter = idValue.getColumnIterator(); ! int i=0; ! while ( iter.hasNext() ) { ! Column col = (Column) iter.next(); ! identifierColumnNames[i] = col.getName(); ! i++; ! } ! ! ! if ( idValue.isComposite() ) { ! ! iter = ( (cirrus.hibernate.map.Component) idValue ).getPropertyIterator(); ! while ( iter.hasNext() ) { ! ! Property prop = (Property) iter.next(); ! idTypesByPropertyPath.put( prop.getName(), prop.getType() ); ! ! String[] cols = new String[ prop.getColumnSpan() ]; ! Iterator colIter= prop.getColumnIterator(); ! int j=0; ! while ( colIter.hasNext() ) { ! Column col = (Column) colIter.next(); ! cols[j++] = col.getName(); ! } ! ! idColumnNamesByPropertyPath.put( prop.getName(), cols ); ! if ( model.hasEmbeddedIdentifier() ) { ! columnNamesByPropertyPath.put( prop.getName(), cols ); ! typesByPropertyPath.put( prop.getName(), prop.getType() ); ! } ! ! } ! } ! ! ! IdentifierGenerator idgen = model.getIdentifier().getIdentifierGenerator(); ! useIdentityColumn = dialect.supportsIdentityColumns() && ( idgen instanceof NativeGenerator ); ! identitySelectString = (useIdentityColumn) ? dialect.getIdentitySelectString() : null; ! ! ! // UNSAVED-VALUE: ! ! String cts = model.getIdentifier().getNullValue(); ! if ( cts==null || "any".equals(cts) ) { ! unsavedIdentifierValue=Cascades.SAVE_ANY; ! } ! else if ( "none".equals(cts) ) { ! unsavedIdentifierValue=Cascades.SAVE_NONE; ! } ! else if ( "null".equals(cts) ) { ! unsavedIdentifierValue=Cascades.SAVE_NULL; ! } ! else { ! try { ! unsavedIdentifierValue = new Cascades.IdentifierValue( ( (IdentifierType) model.getIdentifier().getType() ).stringToObject(cts) ); ! } ! catch (ClassCastException cce) { ! throw new MappingException("Bad identifier type: " + model.getIdentifier().getType().getClass().getName() ); ! } ! catch (Exception e) { ! throw new MappingException("Could not parse unsaved-value: " + cts); ! } ! } ! ! // VERSION: ! ! if ( model.isVersioned() ) { ! versionColumnName = ( (Column) model.getVersion().getColumnIterator().next() ).getName(); ! } ! else { ! versionColumnName = null; ! } if ( model.isVersioned() ) { *************** *** 479,483 **** iter = model.getPropertyClosureIterator(); ! int i=0; int tempVersionProperty=-66; boolean foundCascade = false; --- 601,605 ---- iter = model.getPropertyClosureIterator(); ! i=0; int tempVersionProperty=-66; boolean foundCascade = false; Index: EntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/EntityPersister.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** EntityPersister.java 25 Nov 2002 02:21:09 -0000 1.40 --- EntityPersister.java 25 Nov 2002 05:18:00 -0000 1.41 *************** *** 4,9 **** import cirrus.hibernate.helpers.JDBCExceptionReporter; import cirrus.hibernate.helpers.StringHelper; - import cirrus.hibernate.id.IdentifierGenerator; - import cirrus.hibernate.id.NativeGenerator; import cirrus.hibernate.loader.EntityLoader; import cirrus.hibernate.loader.SimpleEntityLoader; --- 4,7 ---- *************** *** 41,47 **** import cirrus.hibernate.type.DiscriminatorType; import cirrus.hibernate.type.EntityType; - import cirrus.hibernate.type.IdentifierType; import cirrus.hibernate.type.Type; - import cirrus.hibernate.engine.Cascades; import cirrus.hibernate.engine.SessionFactoryImplementor; import cirrus.hibernate.engine.SessionImplementor; --- 39,43 ---- *************** *** 65,82 **** private transient final String updateString; private transient final String identityInsertString; - private transient final String identitySelectString; - private transient final String[] identifierColumnNames; - private transient final Cascades.IdentifierValue unsavedIdentifierValue; - private transient final int[] propertyColumnSpans; private transient final boolean[] definedOnSubclass; private transient final String[][] propertyColumnNames; private transient final String[][] subclassPropertyColumnNameClosure; ! ! private transient final boolean useIdentityColumn; ! private transient final String discriminatorColumnName; - private transient final String versionColumnName; private transient final String[] columnNames; private transient final String[] subclassColumnClosure; --- 61,71 ---- private transient final String updateString; private transient final String identityInsertString; private transient final int[] propertyColumnSpans; private transient final boolean[] definedOnSubclass; private transient final String[][] propertyColumnNames; private transient final String[][] subclassPropertyColumnNameClosure; ! private transient final String discriminatorColumnName; private transient final String[] columnNames; private transient final String[] subclassColumnClosure; *************** *** 86,97 **** private transient final int[] joinedFetch; ! private transient final HashMap subclassesByDiscriminatorValue; ! ! private transient final HashMap columnNamesByPropertyPath = new HashMap(); ! private transient final HashMap typesByPropertyPath = new HashMap(); ! ! private transient final HashMap idColumnNamesByPropertyPath = new HashMap(); ! private transient final HashMap idTypesByPropertyPath = new HashMap(); ! private transient final DiscriminatorType discriminatorType; private transient final Object discriminatorValue; --- 75,80 ---- private transient final int[] joinedFetch; ! private transient final HashMap subclassesByDiscriminatorValue = new HashMap(); ! private transient final DiscriminatorType discriminatorType; private transient final Object discriminatorValue; *************** *** 165,180 **** } - public String[] getIdentifierColumnNames() { - return identifierColumnNames; - } - public String getDiscriminatorColumnName() { return discriminatorColumnName; } - public boolean hasCompositeKey() { - return identifierColumnNames.length>1; - } - public int enableJoinedFetch(int i) { return joinedFetch[i]; --- 148,155 ---- *************** *** 194,212 **** return subclassPropertyTypeClosure.length; } - public Type getPropertyType(String path) { - Type idType = super.getPropertyType(path); - if (idType!=null) return idType; - - return (Type) typesByPropertyPath.get(path); - } - public Type getIdentifierPropertyType(String path) { - return (Type) idTypesByPropertyPath.get(path); - } - public String[] getIdentifierPropertyColumnNames(String path) { - return (String[]) idColumnNamesByPropertyPath.get(path); - } - public String[] getPropertyColumnNames(String path) { - return (String[]) columnNamesByPropertyPath.get(path); - } public String getTableName() { --- 169,172 ---- *************** *** 222,228 **** } - public boolean isIdentifierAssignedByInsert() { - return useIdentityColumn; - } public DiscriminatorType getDiscriminatorType() { return discriminatorType; --- 182,185 ---- *************** *** 241,248 **** } - public boolean isUnsaved(Serializable id) { - return unsavedIdentifierValue.isUnsaved(id); - } - public Serializable getIdentifierSpace() { return qualifiedTableName; --- 198,201 ---- *************** *** 256,266 **** /** - * The query that returns the generated identifier for an identity column - */ - protected final String sqlIdentitySelect() { - return identitySelectString; - } - - /** * The query that deletes a row by id (and version) */ --- 209,212 ---- *************** *** 299,307 **** .append(qualifiedTableName) .append(" where ") ! .append( StringHelper.join( " = ? and ", identifierColumnNames ) ) .append(" = ?"); if ( isVersioned() ) { buf.append(" and ") ! .append(versionColumnName) .append(" = ?") ; } --- 245,253 ---- .append(qualifiedTableName) .append(" where ") ! .append( StringHelper.join( " = ? and ", getIdentifierColumnNames() ) ) .append(" = ?"); if ( isVersioned() ) { buf.append(" and ") ! .append( getVersionColumnName() ) .append(" = ?") ; } *************** *** 324,328 **** .append( cirrus.hibernate.helpers.StringHelper.join( ", ", columnNames ) ) .append(commaAfterProperties) ! .append( insertIdentifierColumns ? StringHelper.join( ", ", identifierColumnNames ) : "" ) .append(commaAfterIdentifiers) .append( isPolymorphic() ? getDiscriminatorColumnName() : "" ) //to handle discriminator column --- 270,274 ---- .append( cirrus.hibernate.helpers.StringHelper.join( ", ", columnNames ) ) .append(commaAfterProperties) ! .append( insertIdentifierColumns ? StringHelper.join( ", ", getIdentifierColumnNames() ) : "" ) .append(commaAfterIdentifiers) .append( isPolymorphic() ? getDiscriminatorColumnName() : "" ) //to handle discriminator column *************** *** 332,336 **** .append(commaAfterProperties); if ( !identityInsert ) { ! buf.append( StringHelper.repeat( "?, ", identifierColumnNames.length-1 ) ) .append("?"); } --- 278,282 ---- .append(commaAfterProperties); if ( !identityInsert ) { ! buf.append( StringHelper.repeat( "?, ", getIdentifierColumnNames().length-1 ) ) .append("?"); } *************** *** 363,367 **** return new StringBuffer(100) .append("select ") ! .append( StringHelper.join( ", ", identifierColumnNames ) ) .append( hasSubclasses() ? ", " + getDiscriminatorColumnName() : "" ) .append( subclassColumnClosure.length==0 ? "" : ", ") --- 309,313 ---- return new StringBuffer(100) .append("select ") ! .append( StringHelper.join( ", ", getIdentifierColumnNames() ) ) .append( hasSubclasses() ? ", " + getDiscriminatorColumnName() : "" ) .append( subclassColumnClosure.length==0 ? "" : ", ") *************** *** 370,374 **** .append(qualifiedTableName) .append(" where ") ! .append( StringHelper.join( " = ? and ", identifierColumnNames ) ) .append(" = ?") .toString(); --- 316,320 ---- .append(qualifiedTableName) .append(" where ") ! .append( StringHelper.join( " = ? and ", getIdentifierColumnNames() ) ) .append(" = ?") .toString(); *************** *** 390,398 **** .append( setters.toString() ) .append(" where ") ! .append( StringHelper.join( " = ? and ", identifierColumnNames ) ) //TODO:refactor out copied code .append(" = ?"); if ( isVersioned() ) { buf.append(" and ") ! .append(versionColumnName) .append(" = ?"); } --- 336,344 ---- .append( setters.toString() ) .append(" where ") ! .append( StringHelper.join( " = ? and ", getIdentifierColumnNames() ) ) //TODO:refactor out copied code .append(" = ?"); if ( isVersioned() ) { buf.append(" and ") ! .append( getVersionColumnName() ) .append(" = ?"); } *************** *** 406,418 **** StringBuffer buf = new StringBuffer(100) .append("select ") ! .append( identifierColumnNames[0] ) .append(" from ") .append(qualifiedTableName) .append(" where ") ! .append( StringHelper.join( " = ? and ", identifierColumnNames ) ) //TODO:refactor out copied code .append(" = ?"); if ( isVersioned() ) { buf.append(" and ") ! .append(versionColumnName) .append(" = ?"); } --- 352,364 ---- StringBuffer buf = new StringBuffer(100) .append("select ") ! .append( getIdentifierColumnNames()[0] ) .append(" from ") .append(qualifiedTableName) .append(" where ") ! .append( StringHelper.join( " = ? and ", getIdentifierColumnNames() ) ) //TODO:refactor out copied code .append(" = ?"); if ( isVersioned() ) { buf.append(" and ") ! .append( getVersionColumnName() ) .append(" = ?"); } *************** *** 435,439 **** if ( id!=null ) { getIdentifierType().nullSafeSet( st, id, index, session ); ! index += identifierColumnNames.length; } --- 381,385 ---- if ( id!=null ) { getIdentifierType().nullSafeSet( st, id, index, session ); ! index += getIdentifierColumnNames().length; } *************** *** 607,611 **** if ( isVersioned() ) { ! getVersionType().nullSafeSet( statement, version, identifierColumnNames.length + 1, session ); check( statement.executeUpdate(), id ); } --- 553,557 ---- if ( isVersioned() ) { ! getVersionType().nullSafeSet( statement, version, getIdentifierColumnNames().length + 1, session ); check( statement.executeUpdate(), id ); } *************** *** 686,776 **** tableNames = new String[] { qualifiedTableName }; - // IDENTIFIER - - int idColumnSpan = model.getIdentifier().getColumnSpan(); - identifierColumnNames = new String[idColumnSpan]; - - Value idValue = model.getIdentifier(); - - Iterator iter = idValue.getColumnIterator(); - int i=0; - while ( iter.hasNext() ) { - Column col = (Column) iter.next(); - identifierColumnNames[i] = col.getName(); - i++; - } - - - if ( idValue.isComposite() ) { - - iter = ( (cirrus.hibernate.map.Component) idValue ).getPropertyIterator(); - while ( iter.hasNext() ) { - - Property prop = (Property) iter.next(); - idTypesByPropertyPath.put( prop.getName(), prop.getType() ); - - String[] cols = new String[ prop.getColumnSpan() ]; - Iterator colIter= prop.getColumnIterator(); - int j=0; - while ( colIter.hasNext() ) { - Column col = (Column) colIter.next(); - cols[j++] = col.getName(); - } - - idColumnNamesByPropertyPath.put( prop.getName(), cols ); - if ( model.hasEmbeddedIdentifier() ) { - columnNamesByPropertyPath.put( prop.getName(), cols ); - typesByPropertyPath.put( prop.getName(), prop.getType() ); - } - - } - } - - - final String identityColumnInsertString; - IdentifierGenerator idgen = model.getIdentifier().getIdentifierGenerator(); - useIdentityColumn = dialect.supportsIdentityColumns() && ( idgen instanceof NativeGenerator ); - if (useIdentityColumn) { - identitySelectString = dialect.getIdentitySelectString(); - identityColumnInsertString = dialect.getIdentityInsertString(); - } - else { - identitySelectString = null; - identityColumnInsertString = null; - } - - // UNSAVED-VALUE: - - String cts = model.getIdentifier().getNullValue(); - if ( cts==null || "any".equals(cts) ) { - unsavedIdentifierValue=Cascades.SAVE_ANY; - } - else if ( "none".equals(cts) ) { - unsavedIdentifierValue=Cascades.SAVE_NONE; - } - else if ( "null".equals(cts) ) { - unsavedIdentifierValue=Cascades.SAVE_NULL; - } - else { - try { - unsavedIdentifierValue = new Cascades.IdentifierValue( ( (IdentifierType) model.getIdentifier().getType() ).stringToObject(cts) ); - } - catch (ClassCastException cce) { - throw new MappingException("Bad identifier type: " + model.getIdentifier().getType().getClass().getName() ); - } - catch (Exception e) { - throw new MappingException("Could not parse unsaved-value: " + cts); - } - } - - // VERSION: - - if ( model.isVersioned() ) { - versionColumnName = ( (Column) model.getVersion().getColumnIterator().next() ).getName(); - } - else { - versionColumnName = null; - } - // DISCRIMINATOR --- 632,635 ---- *************** *** 805,810 **** HashSet thisClassProperties = new HashSet(); ! iter = model.getPropertyClosureIterator(); ! i=0; while( iter.hasNext() ) { --- 664,669 ---- HashSet thisClassProperties = new HashSet(); ! Iterator iter = model.getPropertyClosureIterator(); ! int i=0; while( iter.hasNext() ) { *************** *** 873,877 **** deleteString = generateDeleteString(); insertString = generateInsertString(false, null); ! identityInsertString = useIdentityColumn ? generateInsertString(true, identityColumnInsertString) : null; updateString = generateUpdateString(); --- 732,736 ---- deleteString = generateDeleteString(); insertString = generateInsertString(false, null); ! identityInsertString = isIdentifierAssignedByInsert() ? generateInsertString( true, dialect.getIdentityInsertString() ) : null; updateString = generateUpdateString(); *************** *** 887,897 **** subclassClosure = new Class[subclassSpan]; subclassClosure[0] = mappedClass; ! if ( model.isPolymorphic() ) { ! subclassesByDiscriminatorValue = new HashMap(); ! subclassesByDiscriminatorValue.put( discriminatorValue, mappedClass ); ! } ! else { ! subclassesByDiscriminatorValue = null; ! } // SUBCLASSES --- 746,750 ---- subclassClosure = new Class[subclassSpan]; subclassClosure[0] = mappedClass; ! if ( model.isPolymorphic() ) subclassesByDiscriminatorValue.put( discriminatorValue, mappedClass ); // SUBCLASSES Index: MultiTableEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/MultiTableEntityPersister.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** MultiTableEntityPersister.java 25 Nov 2002 02:21:10 -0000 1.35 --- MultiTableEntityPersister.java 25 Nov 2002 05:18:00 -0000 1.36 *************** *** 5,10 **** import cirrus.hibernate.helpers.JDBCExceptionReporter; import cirrus.hibernate.helpers.StringHelper; - import cirrus.hibernate.id.IdentifierGenerator; - import cirrus.hibernate.id.NativeGenerator; import cirrus.hibernate.loader.EntityLoader; import cirrus.hibernate.loader.OuterJoinGenerator; --- 5,8 ---- *************** *** 16,20 **** import cirrus.hibernate.map.Subclass; import cirrus.hibernate.map.Table; - import cirrus.hibernate.map.Value; import java.io.InvalidObjectException; --- 14,17 ---- *************** *** 44,50 **** import cirrus.hibernate.type.DiscriminatorType; import cirrus.hibernate.type.EntityType; - import cirrus.hibernate.type.IdentifierType; import cirrus.hibernate.type.Type; - import cirrus.hibernate.engine.Cascades; import cirrus.hibernate.engine.SessionFactoryImplementor; import cirrus.hibernate.engine.SessionImplementor; --- 41,45 ---- *************** *** 71,81 **** private transient final String[] identityInsertStrings; private transient final String[] updateStrings; - private transient final String identitySelectString; - private transient final boolean useIdentityColumn; - - private transient final String[] identifierColumnNames; - private transient final Cascades.IdentifierValue unsavedIdentifierValue; - private transient final int[] joinedFetch; private transient final int[] propertyColumnSpans; --- 66,70 ---- *************** *** 88,94 **** private transient final int[] subclassPropertyTableNumberClosure; - private transient final String discriminatorColumnName; - private transient final String versionColumnName; - private transient final String[] columnNames; private transient final String[] subclassColumnClosure; --- 77,80 ---- *************** *** 100,117 **** private transient final HashMap tableNumberByPropertyPath = new HashMap(); ! private transient final HashMap subclassesByDiscriminatorValue; private transient final String[] discriminators; private transient final String[] notNullColumns; private transient final int[] tableNumbers; - - private transient final HashMap columnNamesByPropertyPath = new HashMap(); - private transient final HashMap typesByPropertyPath = new HashMap(); - - private transient final HashMap idColumnNamesByPropertyPath = new HashMap(); - private transient final HashMap idTypesByPropertyPath = new HashMap(); private transient final DiscriminatorType discriminatorType; private transient final Object discriminatorValue; private transient final String discriminatorSQLString; protected transient UniqueEntityLoader loader; --- 86,98 ---- private transient final HashMap tableNumberByPropertyPath = new HashMap(); ! private transient final HashMap subclassesByDiscriminatorValue = new HashMap(); private transient final String[] discriminators; private transient final String[] notNullColumns; private transient final int[] tableNumbers; private transient final DiscriminatorType discriminatorType; private transient final Object discriminatorValue; private transient final String discriminatorSQLString; + private transient final String discriminatorColumnName; protected transient UniqueEntityLoader loader; *************** *** 164,170 **** return definedOnSubclass[i]; } ! ! public String[] getIdentifierColumnNames() { ! return identifierColumnNames; } --- 145,151 ---- return definedOnSubclass[i]; } ! ! public String getTableName() { ! return qualifiedTableName; } *************** *** 172,180 **** return discriminatorColumnName; } ! ! public boolean hasCompositeKey() { ! return identifierColumnNames.length>1; ! } ! public String[] getSubclassColumnClosure() { return subclassColumnClosure; --- 153,157 ---- return discriminatorColumnName; } ! public String[] getSubclassColumnClosure() { return subclassColumnClosure; *************** *** 186,206 **** return subclassPropertyTypeClosure.length; } - public Type getPropertyType(String path) { - Type idType = super.getPropertyType(path); - if (idType!=null) return idType; - - return (Type) typesByPropertyPath.get(path); - } - public Type getIdentifierPropertyType(String path) { - return (Type) idTypesByPropertyPath.get(path); - } - public String[] getPropertyColumnNames(String path) { - return (String[]) columnNamesByPropertyPath.get(path); - } - - - public String getTableName() { - return qualifiedTableName; - } public String[] getSubclassPropertyColumnNames(int i) { --- 163,166 ---- *************** *** 212,218 **** } - public String[] getIdentifierPropertyColumnNames(String path) { - return (String[]) idColumnNamesByPropertyPath.get(path); - } public DiscriminatorType getDiscriminatorType() { return discriminatorType; --- 172,175 ---- *************** *** 235,246 **** } - public boolean isIdentifierAssignedByInsert() { - return useIdentityColumn; - } - - public boolean isUnsaved(Serializable id) { - return unsavedIdentifierValue.isUnsaved(id); - } - public Serializable getIdentifierSpace() { return qualifiedTableName; --- 192,195 ---- *************** *** 254,264 **** /** - * The query that returns the generated identifier for an identity column - */ - protected final String sqlIdentitySelect() { - return identitySelectString; - } - - /** * The query that deletes a row by id (and version) */ --- 203,206 ---- *************** *** 303,307 **** if ( isVersioned() && i==0 ) { buf.append(" and ") ! .append(versionColumnName) .append(" = ?") ; } --- 245,249 ---- if ( isVersioned() && i==0 ) { buf.append(" and ") ! .append( getVersionColumnName() ) .append(" = ?") ; } *************** *** 351,355 **** } else if (insertIdentifierColumns) { ! buf.append( StringHelper.repeat( "?, ", identifierColumnNames.length-1 ) ) .append("?"); } --- 293,297 ---- } else if (insertIdentifierColumns) { ! buf.append( StringHelper.repeat( "?, ", getIdentifierColumnNames().length-1 ) ) .append("?"); } *************** *** 365,442 **** /** - * Generate the SQL that selects a row by id using <tt>FOR UPDATE</tt> - */ - protected String generateSelectForUpdateString() { - return generateSelectString() + " for update"; - } - - /** - * Generate the SQL that selects a row by id using <tt>FOR UPDATE</tt> - */ - protected String generateSelectForUpdateNowaitString() { - return generateSelectString() + " for update nowait"; - } - - /** - * Generate the SQL that selects a row by id - */ - protected String generateSelectString() { - - String[] tables = subclassTableNameClosure; - - StringBuffer buf = new StringBuffer(100) - .append("select ") - .append(tables[0] + '.') - .append( StringHelper.join( ", " + tables[0] + '.', identifierColumnNames ) ); - - if ( hasSubclasses() ) { - buf.append(", case"); - for ( int i=0; i< discriminators.length; i++ ) { - buf.append(" when ") - .append( tables[ tableNumbers[i] ] ) - .append('.') - .append( notNullColumns[i] ) - .append(" is not null then ") - .append( discriminators[i] ); - } - buf.append(" end as ") - .append( getDiscriminatorColumnName() ); - } - - buf.append( subclassColumnClosure.length==0 ? "" : ", "); - for ( int i=0; i<subclassColumnClosure.length; i++ ) { - buf.append( subclassTableNameClosure[ subclassColumnTableNumberClosure[i] ] ) - .append('.') - .append( subclassColumnClosure[i] ) - .append(" as ") - .append( subclassColumnClosureAliases[i] ); - if (i<subclassColumnClosure.length-1) buf.append(", "); - } - buf.append(" from ").append( tables[0] ); - for ( int i=1; i<tables.length; i++ ) { - buf.append(" left outer join ") - .append( tables[i] ) - .append(" on "); - for ( int j=0; j<identifierColumnNames.length; j++ ) { - buf.append( tables[0] ) - .append('.') - .append( identifierColumnNames[j] ) - .append('=') - .append( tables[i] ) - .append('.') - .append( subclassTableKeyColumns[i][j] ); - if (j!=identifierColumnNames.length-1) buf.append(" and "); - } - } - buf.append(" where ") - .append(tables[0] + '.') - .append( StringHelper.join( " = ? and " + tables[0] + '.', identifierColumnNames ) ) - .append(" = ?"); - - - return buf.toString(); - } - - /** * Generate the SQL that updates a row by id (and version) */ --- 307,310 ---- *************** *** 469,473 **** if ( isVersioned() && j==0 ) { buf.append(" and ") ! .append(versionColumnName) .append(" = ?"); } --- 337,341 ---- if ( isVersioned() && j==0 ) { buf.append(" and ") ! .append( getVersionColumnName() ) .append(" = ?"); } *************** *** 484,496 **** StringBuffer buf = new StringBuffer(100) .append("select ") ! .append( identifierColumnNames[0] ) .append(" from ") .append(qualifiedTableName) .append(" where ") ! .append( StringHelper.join( " = ? and ", identifierColumnNames ) ) //TODO:refactor out copied code .append(" = ?"); if ( isVersioned() ) { buf.append(" and ") ! .append(versionColumnName) .append(" = ?"); } --- 352,364 ---- StringBuffer buf = new StringBuffer(100) .append("select ") ! .append( getIdentifierColumnNames()[0] ) .append(" from ") .append(qualifiedTableName) .append(" where ") ! .append( StringHelper.join( " = ? and ", getIdentifierColumnNames() ) ) //TODO:refactor out copied code .append(" = ?"); if ( isVersioned() ) { buf.append(" and ") ! .append( getVersionColumnName() ) .append(" = ?"); } *************** *** 533,537 **** if ( id!=null ) { getIdentifierType().nullSafeSet( statement, id, index, session ); ! index+=identifierColumnNames.length; } --- 401,405 ---- if ( id!=null ) { getIdentifierType().nullSafeSet( statement, id, index, session ); ! index+=getIdentifierColumnNames().length; } *************** *** 722,726 **** try { ! if ( isVersioned() ) getVersionType().nullSafeSet( statements[0], version, identifierColumnNames.length + 1, session ); for ( int i=tableNames.length-1; i>=0; i-- ) { --- 590,594 ---- try { ! if ( isVersioned() ) getVersionType().nullSafeSet( statements[0], version, getIdentifierColumnNames().length + 1, session ); for ( int i=tableNames.length-1; i>=0; i-- ) { *************** *** 810,868 **** Table table = model.getRootTable(); qualifiedTableName = table.getQualifiedName( factory.getDefaultSchema() ); ! ! // IDENTIFIER ! ! int idColumnSpan = model.getIdentifier().getColumnSpan(); ! identifierColumnNames = new String[idColumnSpan]; ! Value idValue = model.getIdentifier(); ! ! Iterator iter = idValue.getColumnIterator(); ! int i=0; ! while ( iter.hasNext() ) { ! Column col = (Column) iter.next(); ! identifierColumnNames[i] = col.getName(); ! i++; ! } ! ! ! if ( idValue.isComposite() ) { ! ! iter = ( (cirrus.hibernate.map.Component) idValue ).getPropertyIterator(); ! while ( iter.hasNext() ) { ! ! Property prop = (Property) iter.next(); ! idTypesByPropertyPath.put( prop.getName(), prop.getType() ); ! ! String[] cols = new String[ prop.getColumnSpan() ]; ! Iterator colIter= prop.getColumnIterator(); ! int j=0; ! while ( colIter.hasNext() ) { ! Column col = (Column) colIter.next(); ! cols[j++] = col.getName(); ! } ! ! idColumnNamesByPropertyPath.put( prop.getName(), cols ); ! if ( model.hasEmbeddedIdentifier() ) { ! columnNamesByPropertyPath.put( prop.getName(), cols ); ! typesByPropertyPath.put( prop.getName(), prop.getType() ); ! } ! } ! } ! - final String identityColumnInsertString; - IdentifierGenerator idgen = model.getIdentifier().getIdentifierGenerator(); - useIdentityColumn = dialect.supportsIdentityColumns() && ( idgen instanceof NativeGenerator ); - if (useIdentityColumn) { - identitySelectString = dialect.getIdentitySelectString(); - identityColumnInsertString = dialect.getIdentityInsertString(); - } - else { - identitySelectString = null; - identityColumnInsertString = null; - } - //MULTITABLES --- 678,705 ---- Table table = model.getRootTable(); qualifiedTableName = table.getQualifiedName( factory.getDefaultSchema() ); ! ! // DISCRIMINATOR ! if ( model.isPolymorphic() ) { ! discriminatorColumnName = "clazz_"; ! try { ! discriminatorType = (DiscriminatorType) Hibernate.INTEGER; ! discriminatorValue = new Integer(0); ! discriminatorSQLString = "0"; } ! catch (ClassCastException cce) { ! throw new MappingException("Illegal discriminator type: " + model.getDiscriminator().getType().getClass().getName() ); ! } ! catch (Exception e) { ! throw new MappingException("Could not format discriminator value to SQL string", e ); ! } ! } ! else { ! discriminatorColumnName = null; ! discriminatorType = null; ! discriminatorValue = null; ! discriminatorSQLString = null; ! } //MULTITABLES *************** *** 870,875 **** ArrayList keyColumns = new ArrayList(); tables.add(qualifiedTableName); ! keyColumns.add(identifierColumnNames); Iterator titer = model.getTableClosureIterator(); while ( titer.hasNext() ) { --- 707,713 ---- ArrayList keyColumns = new ArrayList(); tables.add(qualifiedTableName); ! keyColumns.add( getIdentifierColumnNames() ); + int idColumnSpan = getIdentifierType().getColumnSpan(factory); Iterator titer = model.getTableClosureIterator(); while ( titer.hasNext() ) { *************** *** 890,894 **** keyColumns = new ArrayList(); tables.add(qualifiedTableName); ! keyColumns.add(identifierColumnNames); titer = model.getSubclassTableClosureIterator(); while ( titer.hasNext() ) { --- 728,732 ---- keyColumns = new ArrayList(); tables.add(qualifiedTableName); ! keyColumns.add( getIdentifierColumnNames() ); titer = model.getSubclassTableClosureIterator(); while ( titer.hasNext() ) { *************** *** 906,965 **** subclassTableKeyColumns = (String[][]) keyColumns.toArray( new String[0][] ); - // UNSAVED-VALUE: - - String cts = model.getIdentifier().getNullValue(); - if ( cts==null || "any".equals(cts) ) { - unsavedIdentifierValue=Cascades.SAVE_ANY; - } - else if ( "none".equals(cts) ) { - unsavedIdentifierValue=Cascades.SAVE_NONE; - } - else if ( "null".equals(cts) ) { - unsavedIdentifierValue=Cascades.SAVE_NULL; - } - else { - try { - unsavedIdentifierValue = new Cascades.IdentifierValue( ( (IdentifierType) model.getIdentifier().getType() ).stringToObject(cts) ); - } - catch (ClassCastException cce) { - throw new MappingException("Bad identifier type: " + model.getIdentifier().getType().getClass().getName() ); - } - catch (Exception e) { - throw new MappingException("Could not parse unsaved-value: " + cts); - } - } - - // VERSION: - - if ( model.isVersioned() ) { - versionColumnName = ( (Column) model.getVersion().getColumnIterator().next() ).getName(); - } - else { - versionColumnName = null; - } - - // DISCRIMINATOR - - if ( model.isPolymorphic() ) { - discriminatorColumnName = "clazz_"; - try { - discriminatorType = (DiscriminatorType) Hibernate.INTEGER; - discriminatorValue = new Integer(0); - discriminatorSQLString = "0"; - } - catch (ClassCastException cce) { - throw new MappingException("Illegal discriminator type: " + model.getDiscriminator().getType().getClass().getName() ); - } - catch (Exception e) { - throw new MappingException("Could not format discriminator value to SQL string", e ); - } - } - else { - discriminatorColumnName = null; - discriminatorType = null; - discriminatorValue = null; - discriminatorSQLString = null; - } - // PROPERTIES --- 744,747 ---- *************** *** 972,982 **** HashSet thisClassProperties = new HashSet(); ! iter = model.getPropertyClosureIterator(); ! i=0; while( iter.hasNext() ) { Property prop = (Property) iter.next(); thisClassProperties.add(prop); ! String tabname = prop.getValue().getTable().getQualifiedName( factory.getDefaultSchema() ); propertyTables[i] = getTableId(tabname, tableNames); propertyColumnSpans[i] = prop.getColumnSpan(); --- 754,765 ---- HashSet thisClassProperties = new HashSet(); ! Iterator iter = model.getPropertyClosureIterator(); ! int i=0; while( iter.hasNext() ) { Property prop = (Property) iter.next(); thisClassProperties.add(prop); ! Table tab = prop.getValue().getTable(); ! String tabname = tab.getQualifiedName( factory.getDefaultSchema() ); propertyTables[i] = getTableId(tabname, tableNames); propertyColumnSpans[i] = prop.getColumnSpan(); *************** *** 990,994 **** String colname = col.getName(); propCols[j] = colname; ! propAliases[j] = columnAlias(col); columns.add(colname); j++; --- 773,777 ---- String colname = col.getName(); propCols[j] = colname; ! propAliases[j] = col.getName() + tab.getUniqueInteger() + '_'; columns.add(colname); j++; *************** *** 1021,1025 **** definedBySubclass.add( new Boolean( !thisClassProperties.contains(prop) ) ); Iterator colIter = prop.getColumnIterator(); ! String tabname = prop.getValue().getTable().getQualifiedName( factory.getDefaultSchema() ); String[] cols = new String[ prop.getColumnSpan() ]; types.add( prop.getType() ); --- 804,809 ---- definedBySubclass.add( new Boolean( !thisClassProperties.contains(prop) ) ); Iterator colIter = prop.getColumnIterator(); ! Table tab = prop.getValue().getTable(); ! String tabname = tab.getQualifiedName( factory.getDefaultSchema() ); String[] cols = new String[ prop.getColumnSpan() ]; types.add( prop.getType() ); *************** *** 1032,1036 **** coltables.add(tabnum); cols[l++]=col.getName(); ! aliases.add( columnAlias(col) ); } propColumns.add(cols); --- 816,820 ---- coltables.add(tabnum); cols[l++]=col.getName(); ! aliases.add( col.getName() + tab.getUniqueInteger() + '_' ); } propColumns.add(cols); *************** *** 1058,1062 **** deleteStrings = generateDeleteStrings(); insertStrings = generateInsertStrings(false, null); ! identityInsertStrings = useIdentityColumn ? generateInsertStrings(true, identityColumnInsertString) : null; updateStrings = generateUpdateStrings(); --- 842,846 ---- deleteStrings = generateDeleteStrings(); insertStrings = generateInsertStrings(false, null); ! identityInsertStrings = isIdentifierAssignedByInsert() ? generateInsertStrings( true, dialect.getIdentityInsertString() ) : null; updateStrings = generateUpdateStrings(); *************** *** 1076,1080 **** subclassClosure[subclassSpan-1] = mappedClass; if ( model.isPolymorphic() ) { - subclassesByDiscriminatorValue = new HashMap(); subclassesByDiscriminatorValue.put(discriminatorValue, mappedClass); discriminators = new String[subclassSpan]; --- 860,863 ---- *************** *** 1089,1093 **** } else { - subclassesByDiscriminatorValue = null; discriminators = null; tableNumbers = null; --- 872,875 ---- *************** *** 1190,1194 **** subclassTableNameClosure[i], name+i, ! StringHelper.prefix(identifierColumnNames, name + '.'), subclassTableKeyColumns[i] ); --- 972,976 ---- subclassTableNameClosure[i], name+i, ! StringHelper.prefix( getIdentifierColumnNames(), name + '.' ), subclassTableKeyColumns[i] ); *************** *** 1204,1208 **** buf, name+i, ! StringHelper.prefix(identifierColumnNames, name + '.'), subclassTableKeyColumns[i] ); --- 986,990 ---- buf, name+i, ! StringHelper.prefix( getIdentifierColumnNames(), name + '.' ), subclassTableKeyColumns[i] ); *************** *** 1214,1218 **** public String getQueryWhereClause(String name) throws MappingException { ! //TODO: change to name3.id is not null if ( isInherited() ) { --- 996,1000 ---- public String getQueryWhereClause(String name) throws MappingException { ! //TODO: change to use inner joins instead of "not null" if ( isInherited() ) { *************** *** 1225,1232 **** .append( notNullColumns[last] ) .append(" is not null ") .toString(); } else { ! return null; } --- 1007,1018 ---- .append( notNullColumns[last] ) .append(" is not null ") + .append( outerJoinsAfterWhere(name) ) .toString(); } else { ! String ojw = outerJoinsAfterWhere(name); ! //remove leading " AND " ! if ( ojw.toUpperCase().startsWith(" AND ") ) ojw = ojw.substring(5); ! return ojw; } *************** *** 1282,1286 **** } buf.append(" end as ") ! .append( aliasColumn( getDiscriminatorColumnName(), suffix) ); } --- 1068,1072 ---- } buf.append(" end as ") ! .append( aliasColumn( discriminatorColumnName, suffix) ); } *************** *** 1298,1312 **** } return buf.toString(); - } - - private static final Map colAliases = new HashMap(); - private static int counter = 0; - private static synchronized String columnAlias(Column col) { - String alias = (String) colAliases.get(col); - if (alias==null) { - alias = col.getName() + counter++; - colAliases.put( col, alias ); - } - return alias; } --- 1084,1087 ---- |
From: <one...@us...> - 2002-11-25 05:18:02
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/map In directory sc8-pr-cvs1:/tmp/cvs-serv27042/hibernate/map Modified Files: Table.java Log Message: miscellaneous refactoring Index: Table.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/map/Table.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Table.java 24 Nov 2002 12:53:21 -0000 1.29 --- Table.java 25 Nov 2002 05:17:59 -0000 1.30 *************** *** 22,27 **** private PrimaryKey primaryKey; private int counter=0; ! public Table() {} public String getQualifiedName() { --- 22,31 ---- private PrimaryKey primaryKey; private int counter=0; + private final int uniqueInteger; + private static int tableCounter=0; ! public Table() { ! uniqueInteger = tableCounter++; ! } public String getQualifiedName() { *************** *** 181,184 **** --- 185,192 ---- public void setSchema(String schema) { this.schema = schema; + } + + public int getUniqueInteger() { + return uniqueInteger; } |
From: <one...@us...> - 2002-11-25 02:21:13
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv25122/cirrus/hibernate/persister Modified Files: EntityPersister.java Loadable.java MultiTableEntityPersister.java Log Message: use OuterJoinGenerator for normalized table mappings Index: EntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/EntityPersister.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** EntityPersister.java 24 Nov 2002 15:45:50 -0000 1.39 --- EntityPersister.java 25 Nov 2002 02:21:09 -0000 1.40 *************** *** 964,969 **** } ! public String fromClauseFragment(String name, String on) { ! return fromClauseFragment(name) + ' ' + on; } --- 964,973 ---- } ! public String outerJoinsAfterFrom(String name) { ! return ""; ! } ! ! public String outerJoinsAfterWhere(String name) { ! return ""; } Index: Loadable.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/Loadable.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Loadable.java 5 Nov 2002 03:44:01 -0000 1.11 --- Loadable.java 25 Nov 2002 02:21:10 -0000 1.12 *************** *** 97,103 **** public String fromClauseFragment(String name); /** ! * Get the from clause fragment, given a query alias and an ON clause */ ! public String fromClauseFragment(String name, String on); } --- 97,107 ---- public String fromClauseFragment(String name); /** ! * Get any the outer join SQL fragments that appear in the <tt>FROM</tt> clause */ ! public String outerJoinsAfterFrom(String name); ! /** ! * Get any the outer join SQL fragments that appear in the <tt>WHERE</tt> clause ! */ ! public String outerJoinsAfterWhere(String name); } Index: MultiTableEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/MultiTableEntityPersister.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** MultiTableEntityPersister.java 24 Nov 2002 15:45:50 -0000 1.34 --- MultiTableEntityPersister.java 25 Nov 2002 02:21:10 -0000 1.35 *************** *** 8,11 **** --- 8,12 ---- import cirrus.hibernate.id.NativeGenerator; import cirrus.hibernate.loader.EntityLoader; + import cirrus.hibernate.loader.OuterJoinGenerator; import cirrus.hibernate.loader.UniqueEntityLoader; import cirrus.hibernate.map.Column; *************** *** 1173,1205 **** public String fromClauseFragment(String name) { - return fromClauseFragment(name, ""); - } - - public String fromClauseFragment(String name, String on) { - String[] tables = subclassTableNameClosure; StringBuffer buf = new StringBuffer(100); ! buf.append( tables[0] ) .append(' ') .append(name) ! .append(' ') ! .append(on); ! for ( int i=1; i<tables.length; i++ ) { ! buf.append(" left outer join ") ! .append( tables[i] ) ! .append(' ') ! .append(name) ! .append(i) ! .append(" on "); ! for ( int j=0; j<identifierColumnNames.length; j++ ) { ! buf.append(name) ! .append('.') ! .append( identifierColumnNames[j] ) ! .append('=') ! .append(name) ! .append(i) ! .append('.') ! .append( subclassTableKeyColumns[i][j] ); ! if (j!=identifierColumnNames.length-1) buf.append(" and "); ! } } return buf.toString(); --- 1174,1210 ---- public String fromClauseFragment(String name) { StringBuffer buf = new StringBuffer(100); ! buf.append( subclassTableNameClosure[0] ) .append(' ') .append(name) ! .append( outerJoinsAfterFrom(name) ); ! return buf.toString(); ! } ! ! public String outerJoinsAfterFrom(String name) { ! StringBuffer buf = new StringBuffer(20); ! OuterJoinGenerator ojg = factory.getDialect().getOuterJoinGenerator(); ! for ( int i=1; i<subclassTableNameClosure.length; i++ ) { ! ojg.appendOuterJoinStringAfterFrom( ! buf, ! subclassTableNameClosure[i], ! name+i, ! StringHelper.prefix(identifierColumnNames, name + '.'), ! subclassTableKeyColumns[i] ! ); ! } ! return buf.toString(); ! } ! ! public String outerJoinsAfterWhere(String name) { ! StringBuffer buf = new StringBuffer(20); ! OuterJoinGenerator ojg = factory.getDialect().getOuterJoinGenerator(); ! for ( int i=1; i<subclassTableNameClosure.length; i++ ) { ! ojg.appendOuterJoinStringAfterWhere( ! buf, ! name+i, ! StringHelper.prefix(identifierColumnNames, name + '.'), ! subclassTableKeyColumns[i] ! ); } return buf.toString(); |
From: <one...@us...> - 2002-11-25 02:21:13
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/query In directory sc8-pr-cvs1:/tmp/cvs-serv25122/cirrus/hibernate/query Modified Files: QueryTranslator.java Log Message: use OuterJoinGenerator for normalized table mappings Index: QueryTranslator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/query/QueryTranslator.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** QueryTranslator.java 24 Nov 2002 06:30:12 -0000 1.48 --- QueryTranslator.java 25 Nov 2002 02:21:10 -0000 1.49 *************** *** 626,632 **** //render the " and foo.class in ( 'Foo', 'Bar' ) " bit String where = p.getQueryWhereClause(name); if ( where!=null ) { ! if (!first) inClassWheres.append(" and "); first=false; inClassWheres.append(where); } --- 626,639 ---- //render the " and foo.class in ( 'Foo', 'Bar' ) " bit String where = p.getQueryWhereClause(name); + String ojWhere = p.outerJoinsAfterWhere(name); if ( where!=null ) { ! if (!first) inClassWheres.append(" and "); ! first=false; inClassWheres.append(where); + } + if (ojWhere.length()>1) { //UGLY + if (first) ojWhere = ojWhere.substring(5); //get rid of leading " AND "? + first=false; + inClassWheres.append(ojWhere); } |
From: <one...@us...> - 2002-11-25 02:21:13
|
Update of /cvsroot/hibernate/Hibernate/doc In directory sc8-pr-cvs1:/tmp/cvs-serv25122/doc Modified Files: hibernate.aft Log Message: use OuterJoinGenerator for normalized table mappings Index: hibernate.aft =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/hibernate.aft,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** hibernate.aft 24 Nov 2002 16:19:04 -0000 1.28 --- hibernate.aft 25 Nov 2002 02:21:10 -0000 1.29 *************** *** 56,60 **** 1. Some features of the query language are not supported for databases which do not have subqueries. ! 2. The table-per-subclass mapping strategy is supported only for databases with ANSI-style |OUTER JOIN| and |CASE| 3. Firebird InterClient 2.01 is _strongly_ recommended in preference to other versions of Interbase Interclient. * http://www.ibphoenix.com --- 56,60 ---- 1. Some features of the query language are not supported for databases which do not have subqueries. ! 2. The table-per-subclass mapping strategy is supported only for databases with ANSI-style |CASE...WHEN| 3. Firebird InterClient 2.01 is _strongly_ recommended in preference to other versions of Interbase Interclient. * http://www.ibphoenix.com |