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...> - 2003-02-23 13:51:29
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/src/images In directory sc8-pr-cvs1:/tmp/cvs-serv17927/doc/reference/src/images Added Files: AuthorWork.zargo CustomerOrderProduct.zargo EmployerEmployee.zargo Log Message: New location for source images --- NEW FILE: AuthorWork.zargo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: CustomerOrderProduct.zargo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: EmployerEmployee.zargo --- (This appears to be a binary file; contents omitted.) |
From: <tu...@us...> - 2003-02-23 13:50:34
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/images In directory sc8-pr-cvs1:/tmp/cvs-serv17410/doc/reference/images Added Files: full_cream.svg hibernate_logo_a.png lite.svg overview.svg Log Message: New image formats --- NEW FILE: full_cream.svg --- <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [ <!ATTLIST svg xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink"> ]> <!-- Created with Sodipodi ("http://www.sodipodi.com/") --> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="354.331" height="336.614" id="svg1"> <defs id="defs3"> <linearGradient x1="0" y1="0" x2="1" y2="0" id="linearGradient127" gradientUnits="objectBoundingBox" spreadMethod="pad"> <stop style="stop-color:#000000;stop-opacity:1;" offset="0" id="stop128" /> <stop style="stop-color:#ffffff;stop-opacity:1;" offset="1" id="stop129" /> </linearGradient> <linearGradient x1="0" y1="0" x2="1" y2="0" id="linearGradient130" xlink:href="#linearGradient127" gradientUnits="objectBoundingBox" spreadMethod="pad" /> <radialGradient cx="0.5" cy="0.5" fx="0.5" fy="0.5" r="0.5" id="radialGradient131" xlink:href="#linearGradient127" gradientUnits="objectBoundingBox" spreadMethod="pad" /> </defs> <g transform="matrix(0.823795,0,0,0.823795,0.120302,5.25349)" style="font-size:12;" id="g659"> <rect width="212.257" height="57.2441" x="17.9576" y="100.132" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect137" /> <rect width="285.502" height="118.523" x="13.4238" y="95.9309" transform="matrix(0.743454,0,0,0.482981,6.46949,52.2178)" style="fill:#d2d2d2;fill-rule:evenodd;stroke-width:1pt;" id="rect132" /> </g> <rect width="325.86" height="63.6537" x="17.4083" y="15.194" style="font-size:12;fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect136" /> <rect width="325.86" height="63.6537" x="13.6713" y="12.4966" style="font-size:12;fill:#d2d2d2;fill-rule:evenodd;stroke-width:1pt;" id="rect126" /> <g transform="matrix(1.14345,0,0,0.729078,-1.67818,105.325)" style="font-size:12;" id="g164"> <rect width="285.502" height="77.2688" x="16.6979" y="222.966" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect138" /> <rect width="285.502" height="77.2688" x="14.7335" y="221.002" transform="translate(-1.30962,-1.30992)" style="fill:#d2d2d2;fill-rule:evenodd;stroke-width:1pt;" id="rect133" /> </g> <text x="170.824753" y="58.402939" transform="scale(0.823795,0.823795)" style="font-size:18;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text183"> <tspan x="170.824997" y="58.402901" id="tspan360"> Application</tspan> </text> <text x="178.076340" y="364.281433" transform="scale(0.823795,0.823795)" style="font-size:18;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text197"> <tspan x="178.076004" y="364.281006" id="tspan421"> Database</tspan> </text> <text x="68.605331" y="138.524582" transform="scale(0.823795,0.823795)" style="font-size:16;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text216"> <tspan x="68.605301" y="138.524994" id="tspan384"> SessionFactory</tspan> </text> <rect width="67.0014" height="101.35" x="196.927" y="89.2389" style="font-size:12;fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect387" /> <rect width="67.0014" height="101.35" x="194.633" y="86.4389" style="font-size:12;fill:#d2d2d2;fill-rule:evenodd;stroke-width:1pt;" id="rect388" /> <text x="249.108841" y="173.885559" transform="scale(0.823795,0.823795)" style="font-size:16;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text389"> <tspan x="249.108994" y="173.886002" id="tspan392"> Session</tspan> </text> <rect width="73.0355" height="101.35" x="270.995" y="90.0018" style="font-size:12;fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect395" /> <rect width="73.0355" height="101.35" x="267.869" y="87.2018" style="font-size:12;fill:#d2d2d2;fill-rule:evenodd;stroke-width:1pt;" id="rect396" /> <text x="328.593658" y="174.715622" transform="scale(0.823795,0.823795)" style="font-size:16;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text397"> <tspan x="328.593994" y="174.716003" id="tspan563"> Transaction</tspan> </text> <g transform="matrix(0.29544,0,0,0.397877,9.70533,103.96)" style="font-size:12;" id="g565"> <rect width="285.502" height="118.523" x="16.6979" y="99.2053" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect566" /> <rect width="285.502" height="118.523" x="13.4238" y="95.9309" style="fill:#d2d2d2;fill-rule:evenodd;stroke-width:1pt;" id="rect567" /> </g> <text x="25.592752" y="204.497803" transform="scale(0.823795,0.823795)" style="font-size:10;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text568"> <tspan x="25.592800" y="204.498001" id="tspan662"> TransactionFactory</tspan> </text> <g transform="matrix(0.298082,0,0,0.397877,99.6898,103.96)" style="font-size:12;" id="g573"> <rect width="285.502" height="118.523" x="16.6979" y="99.2053" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect574" /> <rect width="285.502" height="118.523" x="13.4238" y="95.9309" style="fill:#d2d2d2;fill-rule:evenodd;stroke-width:1pt;" id="rect575" /> </g> <text x="134.030670" y="205.532791" transform="scale(0.823795,0.823795)" style="font-size:10;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text576"> <tspan x="134.031006" y="205.533005" id="tspan664"> ConnectionProvider</tspan> </text> <g transform="matrix(1.14345,0,0,0.729078,-1.67818,38.9539)" style="font-size:12;" id="g587"> <rect width="285.502" height="77.2688" x="16.6979" y="222.966" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect588" /> <rect width="285.502" height="77.2688" x="14.7335" y="221.002" transform="translate(-1.30962,-1.30992)" style="fill:#d2d2d2;fill-rule:evenodd;stroke-width:1pt;" id="rect589" /> </g> <rect width="90.951" height="44.4829" x="25.6196" y="206.028" style="font-size:12;fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect594" /> <rect width="90.951" height="44.4829" x="24.4229" y="204.135" style="font-size:12;fill:#b3b3b3;fill-rule:evenodd;stroke-width:1pt;" id="rect595" /> <text x="85.575645" y="282.300354" transform="scale(0.823795,0.823795)" style="font-size:18;font-weight:normal;stroke-width:1pt;font-family:Helvetica;text-anchor:middle;" id="text596"> <tspan x="85.575600" y="282.299988" id="tspan607"> JNDI</tspan> </text> <rect width="90.951" height="44.4829" x="236.937" y="206.791" style="font-size:12;fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect610" /> <rect width="90.951" height="44.4829" x="235.741" y="204.898" style="font-size:12;fill:#b3b3b3;fill-rule:evenodd;stroke-width:1pt;" id="rect611" /> <text x="342.093201" y="283.226410" transform="scale(0.823795,0.823795)" style="font-size:18;font-weight:normal;stroke-width:1pt;font-family:Helvetica;text-anchor:middle;" id="text612"> <tspan x="342.092987" y="283.226013" id="tspan621"> JTA</tspan> </text> <rect width="90.951" height="44.4829" x="130.134" y="206.791" style="font-size:12;fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect616" /> <rect width="90.951" height="44.4829" x="128.937" y="204.898" style="font-size:12;fill:#b3b3b3;fill-rule:evenodd;stroke-width:1pt;" id="rect617" /> <text x="212.445343" y="283.226410" transform="scale(0.823795,0.823795)" style="font-size:18;font-weight:normal;stroke-width:1pt;font-family:Helvetica;text-anchor:middle;" id="text618"> <tspan x="212.445007" y="283.226013" id="tspan623"> JDBC</tspan> </text> <g transform="matrix(0.823795,0,0,0.823795,0.120302,6.19341)" style="font-size:12;" id="g637"> <g transform="matrix(0.499515,0,0,0.415467,-0.237339,5.61339)" id="g167"> <rect width="199.065" height="61.5532" x="61.8805" y="68.4288" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect134" /> <rect width="199.065" height="61.5532" x="59.2613" y="65.8095" style="fill:#e0e0e0;fill-rule:evenodd;stroke-width:1pt;" id="rect135" /> </g> <text x="33.749969" y="50.589706" style="font-size:11;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text188"> <tspan x="33.750000" y="50.589699" id="tspan635"> Transient Objects</tspan> </text> </g> <g transform="matrix(0.823795,0,0,0.823795,0.120302,5.25349)" style="font-size:12;" id="g644"> <g transform="matrix(0.297486,0,0,0.516482,230.251,36.9178)" id="g364"> <rect width="199.065" height="61.5532" x="61.8805" y="68.4288" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect365" /> <rect width="199.065" height="61.5532" x="59.2613" y="65.8095" style="fill:#e0e0e0;fill-rule:evenodd;stroke-width:1pt;" id="rect366" /> </g> <text x="277.123230" y="85.155571" style="font-size:11;font-weight:normal;stroke-width:1pt;font-family:Helvetica;text-anchor:middle;" id="text367"> <tspan x="277.122986" y="85.155602" id="tspan631"> Persistent</tspan> <tspan x="277.122986" y="96.155602" id="tspan633"> Objects</tspan> </text> </g> </svg> --- NEW FILE: hibernate_logo_a.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: lite.svg --- <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [ <!ATTLIST svg xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink"> ]> <!-- Created with Sodipodi ("http://www.sodipodi.com/") --> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="318.898" height="248.031" id="svg1"> <defs id="defs3"> <linearGradient x1="0" y1="0" x2="1" y2="0" id="linearGradient127" gradientUnits="objectBoundingBox" spreadMethod="pad"> <stop style="stop-color:#000000;stop-opacity:1;" offset="0" id="stop128" /> <stop style="stop-color:#ffffff;stop-opacity:1;" offset="1" id="stop129" /> </linearGradient> <linearGradient x1="0" y1="0" x2="1" y2="0" id="linearGradient130" xlink:href="#linearGradient127" gradientUnits="objectBoundingBox" spreadMethod="pad" /> <radialGradient cx="0.5" cy="0.5" fx="0.5" fy="0.5" r="0.5" id="radialGradient131" xlink:href="#linearGradient127" gradientUnits="objectBoundingBox" spreadMethod="pad" /> </defs> <rect width="291.837" height="57.0074" x="17.3169" y="18.646" style="font-size:12;fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect136" /> <rect width="291.837" height="57.0074" x="13.9703" y="16.2302" style="font-size:12;fill:#d2d2d2;fill-rule:evenodd;stroke-width:1pt;" id="rect126" /> <g transform="matrix(0.326107,0,0,0.765831,9.59261,8.98517)" style="font-size:12;" id="g161"> <rect width="285.502" height="118.523" x="16.6979" y="99.2053" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect137" /> <rect width="285.502" height="118.523" x="13.4238" y="95.9309" style="fill:#d2d2d2;fill-rule:evenodd;stroke-width:1pt;" id="rect132" /> </g> <g transform="matrix(1.02406,0,0,0.652953,0.223384,39.9254)" style="font-size:12;" id="g164"> <rect width="285.502" height="77.2688" x="16.6979" y="222.966" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect138" /> <rect width="285.502" height="77.2688" x="14.7335" y="221.002" transform="translate(-1.30962,-1.30992)" style="fill:#d2d2d2;fill-rule:evenodd;stroke-width:1pt;" id="rect133" /> </g> <g transform="matrix(0.449834,0,0,0.338463,-3.15909,9.73319)" style="font-size:12;" id="g167"> <rect width="199.065" height="61.5532" x="61.8805" y="68.4288" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect134" /> <rect width="199.065" height="61.5532" x="59.2613" y="65.8095" style="fill:#e0e0e0;fill-rule:evenodd;stroke-width:1pt;" id="rect135" /> </g> <text x="302.277679" y="65.943230" transform="scale(0.73778,0.73778)" style="font-size:18;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text183"> <tspan x="302.277954" y="65.943184" id="tspan360"> Application</tspan> </text> <text x="36.235924" y="63.796055" transform="scale(0.73778,0.73778)" style="font-size:14;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text188"> <tspan x="36.235950" y="63.796051" id="tspan427"> Transient Objects</tspan> </text> <text x="180.416245" y="290.543701" transform="scale(0.73778,0.73778)" style="font-size:18;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text197"> <tspan x="180.415939" y="290.543549" id="tspan421"> Database</tspan> </text> <text x="25.037701" y="179.154755" transform="scale(0.73778,0.73778)" style="font-size:16;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text216"> <tspan x="25.037655" y="179.154648" id="tspan384"> SessionFactory</tspan> </text> <g transform="matrix(0.252763,0,0,0.765831,109.104,8.98517)" style="font-size:12;" id="g386"> <rect width="285.502" height="118.523" x="16.6979" y="99.2053" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect387" /> <rect width="285.502" height="118.523" x="13.4238" y="95.9309" style="fill:#d2d2d2;fill-rule:evenodd;stroke-width:1pt;" id="rect388" /> </g> <g transform="matrix(0.297394,0,0,0.572692,101.502,21.6359)" style="font-size:12;" id="g364"> <rect width="199.065" height="61.5532" x="61.8805" y="68.4288" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect365" /> <rect width="199.065" height="61.5532" x="59.2613" y="65.8095" style="fill:#e0e0e0;fill-rule:evenodd;stroke-width:1pt;" id="rect366" /> </g> <text x="202.746506" y="102.992203" transform="scale(0.73778,0.73778)" style="font-size:14;font-weight:normal;stroke-width:1pt;font-family:Helvetica;text-anchor:middle;" id="text367"> <tspan x="202.746948" y="102.992249" id="tspan423"> Persistent</tspan> <tspan x="202.746948" y="116.992355" id="tspan425"> Objects</tspan> </text> <text x="174.458496" y="180.080795" transform="scale(0.73778,0.73778)" style="font-size:16;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text389"> <tspan x="174.458618" y="180.080338" id="tspan392"> Session</tspan> </text> <g transform="matrix(0.127369,0,0,0.765831,188.675,8.98517)" style="font-size:12;" id="g394"> <rect width="285.502" height="118.523" x="16.6979" y="99.2053" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect395" /> <rect width="285.502" height="118.523" x="13.4238" y="95.9309" style="fill:#d2d2d2;fill-rule:evenodd;stroke-width:1pt;" id="rect396" /> </g> <text x="260.413269" y="179.154739" transform="scale(0.73778,0.73778)" style="font-size:16;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text397"> <tspan x="260.412964" y="179.154343" id="tspan400"> JDBC</tspan> </text> <g transform="matrix(0.127369,0,0,0.765831,229.156,8.98517)" style="font-size:12;" id="g405"> <rect width="285.502" height="118.523" x="16.6979" y="99.2053" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect406" /> <rect width="285.502" height="118.523" x="13.4238" y="95.9309" style="fill:#d2d2d2;fill-rule:evenodd;stroke-width:1pt;" id="rect407" /> </g> <text x="320.606903" y="179.154739" transform="scale(0.73778,0.73778)" style="font-size:16;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text408"> <tspan x="320.606964" y="179.154343" id="tspan417"> JNDI</tspan> </text> <g transform="matrix(0.127369,0,0,0.765831,269.281,8.98517)" style="font-size:12;" id="g411"> <rect width="285.502" height="118.523" x="16.6979" y="99.2053" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect412" /> <rect width="285.502" height="118.523" x="13.4238" y="95.9309" style="fill:#d2d2d2;fill-rule:evenodd;stroke-width:1pt;" id="rect413" /> </g> <text x="377.096313" y="179.154739" transform="scale(0.73778,0.73778)" style="font-size:16;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text414"> <tspan x="377.095947" y="179.154343" id="tspan419"> JDA</tspan> </text> </svg> --- NEW FILE: overview.svg --- <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [ <!ATTLIST svg xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink"> ]> <!-- Created with Sodipodi ("http://www.sodipodi.com/") --> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="248.031" height="248.031" id="svg1"> <defs id="defs3"> <linearGradient x1="0" y1="0" x2="1" y2="0" id="linearGradient127" gradientUnits="objectBoundingBox" spreadMethod="pad"> <stop style="stop-color:#000000;stop-opacity:1;" offset="0" id="stop128" /> <stop style="stop-color:#ffffff;stop-opacity:1;" offset="1" id="stop129" /> </linearGradient> <linearGradient x1="0" y1="0" x2="1" y2="0" id="linearGradient130" xlink:href="#linearGradient127" gradientUnits="objectBoundingBox" spreadMethod="pad" /> <radialGradient cx="0.5" cy="0.5" fx="0.5" fy="0.5" r="0.5" id="radialGradient131" xlink:href="#linearGradient127" gradientUnits="objectBoundingBox" spreadMethod="pad" /> </defs> <g transform="matrix(0.771934,0,0,0.771934,4.36019,-3.02123)" style="font-size:12;" id="g158"> <rect width="285.502" height="77.2688" x="16.6979" y="17.3527" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect136" /> <rect width="285.502" height="77.2688" x="14.7335" y="15.3883" transform="translate(-1.30962,-1.30992)" style="fill:#d2d2d2;fill-rule:evenodd;stroke-width:1pt;" id="rect126" /> </g> <g transform="matrix(0.771934,0,0,0.771934,4.36019,3.04452)" style="font-size:12;" id="g161"> <rect width="285.502" height="118.523" x="16.6979" y="99.2053" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect137" /> <rect width="285.502" height="118.523" x="13.4238" y="95.9309" style="fill:#d2d2d2;fill-rule:evenodd;stroke-width:1pt;" id="rect132" /> </g> <g transform="matrix(0.771934,0,0,0.771934,4.36019,8.0993)" style="font-size:12;" id="g164"> <rect width="285.502" height="77.2688" x="16.6979" y="222.966" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect138" /> <rect width="285.502" height="77.2688" x="14.7335" y="221.002" transform="translate(-1.30962,-1.30992)" style="fill:#d2d2d2;fill-rule:evenodd;stroke-width:1pt;" id="rect133" /> </g> <g transform="matrix(0.771934,0,0,0.543505,2.59104,21.1103)" style="font-size:12;" id="g167"> <rect width="199.065" height="61.5532" x="61.8805" y="68.4288" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect134" /> <rect width="199.065" height="61.5532" x="59.2613" y="65.8095" style="fill:#e0e0e0;fill-rule:evenodd;stroke-width:1pt;" id="rect135" /> </g> <text x="105.392174" y="56.568123" transform="scale(0.771934,0.771934)" style="font-size:24;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text183"> <tspan x="105.392273" y="56.568146" id="tspan186"> Application</tspan> </text> <text x="81.820183" y="103.149330" transform="scale(0.771934,0.771934)" style="font-size:20;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text188"> <tspan x="81.820213" y="103.149727" id="tspan206"> Persistent Objects</tspan> </text> <text x="111.548180" y="278.927887" transform="scale(0.771934,0.771934)" style="font-size:24;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text197"> <tspan x="111.547874" y="278.927551" id="tspan200"> Database</tspan> </text> <text x="94.436180" y="153.805740" transform="scale(0.771934,0.771934)" style="font-size:24;font-weight:normal;stroke-width:1pt;font-family:Helvetica;" id="text216"> <tspan x="94.436180" y="153.805740" id="tspan221"> HIBERNATE</tspan> </text> <g transform="matrix(0.771934,0,0,0.771934,2.59083,1.02261)" style="font-size:12;" id="g254"> <g transform="translate(4.58374,2.61928)" id="g176"> <g transform="matrix(0.571429,0,0,0.67347,-10.6174,117.093)" id="g170"> <rect width="199.065" height="61.5532" x="61.8805" y="68.4288" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect171" /> <rect width="199.065" height="61.5532" x="59.2613" y="65.8095" style="fill:#e0e0e0;fill-rule:evenodd;stroke-width:1pt;" id="rect172" /> </g> <g transform="matrix(0.571429,0,0,0.67347,138.682,117.093)" id="g173"> <rect width="199.065" height="61.5532" x="61.8805" y="68.4288" style="fill:#757575;fill-rule:evenodd;stroke-width:1pt;" id="rect174" /> <rect width="199.065" height="61.5532" x="59.2613" y="65.8095" style="fill:#e0e0e0;fill-rule:evenodd;stroke-width:1pt;" id="rect175" /> </g> </g> <text x="47.259438" y="182.367538" style="font-weight:bold;stroke-width:1pt;font-family:Courier;" id="text191"> <tspan x="47.259399" y="182.367996" id="tspan212"> hibernate.</tspan> <tspan x="47.259399" y="194.367996" id="tspan214"> properties</tspan> </text> <text x="198.523010" y="188.260941" style="font-weight:normal;stroke-width:1pt;font-family:helvetica;" id="text194"> <tspan id="tspan195"> XML Mapping</tspan> </text> </g> </svg> |
From: <one...@us...> - 2003-02-23 13:49:07
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/helpers In directory sc8-pr-cvs1:/tmp/cvs-serv16542 Modified Files: DTDEntityResolver.java Log Message: applied Chris Nockleberg's patch for gnu jaxp Index: DTDEntityResolver.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/helpers/DTDEntityResolver.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DTDEntityResolver.java 27 Jul 2002 08:30:58 -0000 1.5 --- DTDEntityResolver.java 23 Feb 2003 13:49:03 -0000 1.6 *************** *** 28,32 **** else { log.debug("found " + systemId + " in classpath"); ! return new InputSource(dtdStream); } } --- 28,35 ---- else { log.debug("found " + systemId + " in classpath"); ! InputSource source = new InputSource(dtdStream); ! source.setPublicId(publicId); ! source.setSystemId(systemId); ! return source; } } |
From: <tu...@us...> - 2003-02-23 13:49:01
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/pdf In directory sc8-pr-cvs1:/tmp/cvs-serv16229/doc/reference/pdf Modified Files: hibernate_reference.pdf Log Message: Updated Index: hibernate_reference.pdf =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/pdf/hibernate_reference.pdf,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** hibernate_reference.pdf 28 Jan 2003 13:26:41 -0000 1.2 --- hibernate_reference.pdf 23 Feb 2003 13:48:53 -0000 1.3 *************** *** 1,15741 **** %PDF-1.3 ! 1 0 obj ! << /S /GoTo /D (1.0) >> ! endobj 4 0 obj ! (Hibernate Reference Documentation) endobj 5 0 obj ! << /S /GoTo /D (2.0) >> endobj [...20274 lines suppressed...] ! 0000365441 00000 n ! 0000365683 00000 n ! 0000365921 00000 n ! 0000366032 00000 n ! 0000366146 00000 n ! 0000366255 00000 n ! 0000366341 00000 n ! 0000366454 00000 n ! 0000366570 00000 n ! 0000366677 00000 n ! 0000366787 00000 n trailer << ! /Size 501 ! /Root 2 0 R ! /Info 4 0 R >> startxref ! 375640 %%EOF |
From: <tu...@us...> - 2003-02-23 13:48:56
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/images In directory sc8-pr-cvs1:/tmp/cvs-serv16229/doc/reference/images Modified Files: AuthorWork.gif CustomerOrderProduct.gif EmployerEmployee.gif Log Message: Updated Index: AuthorWork.gif =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/images/AuthorWork.gif,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Binary files /tmp/cvsX6ZA07 and /tmp/cvso2Av37 differ Index: CustomerOrderProduct.gif =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/images/CustomerOrderProduct.gif,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Binary files /tmp/cvsUa8frb and /tmp/cvsg3XCDc differ Index: EmployerEmployee.gif =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/images/EmployerEmployee.gif,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Binary files /tmp/cvsGI6Mrc and /tmp/cvsamIfGe differ |
Update of /cvsroot/hibernate/Hibernate2/doc/reference/images In directory sc8-pr-cvs1:/tmp/cvs-serv15754/doc/reference/images Removed Files: AuthorWork.zargo CustomerOrderProduct.zargo EmployerEmployee.zargo full_cream.eps full_cream.pdf full_cream.png lite.eps lite.pdf lite.png overview.eps overview.pdf overview.png Log Message: No longer needed --- AuthorWork.zargo DELETED --- --- CustomerOrderProduct.zargo DELETED --- --- EmployerEmployee.zargo DELETED --- --- full_cream.eps DELETED --- --- full_cream.pdf DELETED --- --- full_cream.png DELETED --- --- lite.eps DELETED --- --- lite.pdf DELETED --- --- lite.png DELETED --- --- overview.eps DELETED --- --- overview.pdf DELETED --- --- overview.png DELETED --- |
From: <one...@us...> - 2003-02-23 13:47:23
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util In directory sc8-pr-cvs1:/tmp/cvs-serv14911/hibernate/util Modified Files: DTDEntityResolver.java Log Message: applied Chris Nockleberg's patch for gnu jaxp Index: DTDEntityResolver.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/DTDEntityResolver.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DTDEntityResolver.java 5 Jan 2003 02:11:25 -0000 1.3 --- DTDEntityResolver.java 23 Feb 2003 13:47:18 -0000 1.4 *************** *** 28,32 **** else { log.debug("found " + systemId + " in classpath"); ! return new InputSource(dtdStream); } } --- 28,35 ---- else { log.debug("found " + systemId + " in classpath"); ! InputSource source = new InputSource(dtdStream); ! source.setPublicId(publicId); ! source.setSystemId(systemId); ! return source; } } |
From: <one...@us...> - 2003-02-23 13:47:22
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv14911/hibernate/test Modified Files: FooBarTest.java Log Message: applied Chris Nockleberg's patch for gnu jaxp Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBarTest.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** FooBarTest.java 23 Feb 2003 07:22:11 -0000 1.26 --- FooBarTest.java 23 Feb 2003 13:47:18 -0000 1.27 *************** *** 183,187 **** s.find("from s in class Stuff where s.foo.string is not null"); assertTrue( ! s.find("from s in class Stuff where s.foo > 'a' order by s.foo").size()==1 ); t.commit(); --- 183,187 ---- s.find("from s in class Stuff where s.foo.string is not null"); assertTrue( ! s.find("from s in class Stuff where s.foo > '0' order by s.foo").size()==1 ); t.commit(); |
Update of /cvsroot/hibernate/Hibernate2/doc/reference/images/callouts In directory sc8-pr-cvs1:/tmp/cvs-serv15018/doc/reference/images/callouts Added Files: 10.gif 10.png 11.gif 11.png 12.gif 12.png 13.gif 13.png 14.gif 14.png 15.gif 15.png 1.gif 1.png 2.gif 2.png 3.gif 3.png 4.gif 4.png 5.gif 5.png 6.gif 6.png 7.gif 7.png 8.gif 8.png 9.gif 9.png Log Message: DocBook images for HTML output --- NEW FILE: 10.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 10.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 11.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 11.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 12.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 12.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 13.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 13.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 14.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 14.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 15.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 15.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 1.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 1.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 2.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 3.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 3.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 4.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 4.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 5.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 5.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 6.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 6.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 7.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 7.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 8.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 8.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 9.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: 9.png --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/hibernate/Hibernate2/doc/reference/images/admons In directory sc8-pr-cvs1:/tmp/cvs-serv15018/doc/reference/images/admons Added Files: blank.png caution.gif caution.png caution.tif draft.png home.gif home.png important.gif important.png important.tif next.gif next.png note.gif note.png note.tif prev.gif prev.png tip.gif tip.png tip.tif toc-blank.png toc-minus.png toc-plus.png up.gif up.png warning.gif warning.png warning.tif Log Message: DocBook images for HTML output --- NEW FILE: blank.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: caution.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: caution.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: caution.tif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: draft.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: home.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: home.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: important.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: important.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: important.tif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: next.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: next.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: note.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: note.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: note.tif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: prev.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: prev.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tip.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tip.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tip.tif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toc-blank.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toc-minus.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toc-plus.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: up.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: up.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: warning.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: warning.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: warning.tif --- (This appears to be a binary file; contents omitted.) |
From: <tu...@us...> - 2003-02-23 13:45:54
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/images/callouts In directory sc8-pr-cvs1:/tmp/cvs-serv14373/doc/reference/images/callouts Log Message: Directory /cvsroot/hibernate/Hibernate2/doc/reference/images/callouts added to the repository |
From: <tu...@us...> - 2003-02-23 13:45:45
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/images/admons In directory sc8-pr-cvs1:/tmp/cvs-serv14281/doc/reference/images/admons Log Message: Directory /cvsroot/hibernate/Hibernate2/doc/reference/images/admons added to the repository |
From: <tu...@us...> - 2003-02-23 13:45:31
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/html In directory sc8-pr-cvs1:/tmp/cvs-serv13704/doc/reference/html Modified Files: adv-or-mapping.html architecture.html best-practices.html examples.html index.html manipulating-data.html or-mapping.html persistent-classes.html query-language.html session-configuration.html transactions.html Log Message: Updated Index: adv-or-mapping.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/html/adv-or-mapping.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** adv-or-mapping.html 28 Jan 2003 13:25:09 -0000 1.2 --- adv-or-mapping.html 23 Feb 2003 13:45:25 -0000 1.3 *************** *** 1,5 **** <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Chapter 5. Advanced O/R Mapping</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.49"><link rel="home" href="index.html" title="Hibernate Reference Documentation"><link rel="up" href="index.html" title="Hibernate Reference Documentation"><link rel="previous" href="or-mapping.html" title="Chapter 4. Basic O/R Mapping"><link rel="next" href="manipulating-data.html" title="Chapter 6. Manipulating Persistent Data"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. Advanced O/R Mapping</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="or-mapping.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="manipulating-data.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="adv-or-mapping"></a>Chapter 5. Advanced O/R Mapping</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="adv-or-mapping.html#adv-or-mapping-s1">Collections</a></dt><dd><dl><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-1">Persistent Collections</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-9">Garbage Collection</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-10">Bidirectional Associations</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-11">Ternary Associations</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-12">Collection Example</a></dt></dl></dd><dt><a href="adv-or-mapping.html#adv-or-mapping-s2">Components</a></dt><dd><dl><dt><a href="adv-or-mapping.html#adv-or-mapping-s2-1">As Dependent Objects</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s2-2">In Collections</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s2-2b">As a Map Index</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s2-3">As Composite Identifiers</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s2-4">Dynabean components</a></dt></dl></dd><dt><a href="adv-or-mapping.html#adv-or-mapping-s3">Cache</a></dt><dd><dl><dt><a href="adv-or-mapping.html#adv-or-mapping-s3-1">Mapping</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s3-2">Read Only Cache</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s3-3">Read / Write Cache</a></dt></dl></dd><dt><a href="adv-or-mapping.html#adv-or-mapping-s4">Proxies for Lazy Initialization</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="adv-or-mapping-s1"></a>Collections</h2></div></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-1"></a>Persistent Collections</h3></div></div><p> This section does not contain much example Java code. We assume you already know how to use Java's collections framework. If so, theres not really anything more --- 1,5 ---- <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Chapter 5. Advanced O/R Mapping</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="HIBERNATE - Relational Persistence for Idiomatic Java"><link rel="up" href="index.html" title="HIBERNATE - Relational Persistence for Idiomatic Java"><link rel="previous" href="or-mapping.html" title="Chapter 4. Basic O/R Mapping"><link rel="next" href="manipulating-data.html" title="Chapter 6. Manipulating Persistent Data"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. Advanced O/R Mapping</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="or-mapping.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="manipulating-data.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="adv-or-mapping"></a>Chapter 5. Advanced O/R Mapping</h2></div></div><div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="adv-or-mapping-s1"></a>5.1. Collections</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="adv-or-mapping-s1-1"></a>5.1.1. Persistent Collections</h3></div></div><div></div></div><p> This section does not contain much example Java code. We assume you already know [...981 lines suppressed...] ! Certain operations do <span class="emphasis"><em>not</em></span> require proxy initialization ! </p><div class="itemizedlist"><ul type="disc" compact><li><p> ! <tt class="literal">equals()</tt>, if the persistent class does not override ! <tt class="literal">equals()</tt> </p></li><li><p> ! <tt class="literal">hashCode()</tt>, if the persistent class does not override ! <tt class="literal">hashCode()</tt> </p></li><li><p> The identifier getter method </p></li></ul></div><p> ! Hibernate will detect persistent classes that override <tt class="literal">equals()</tt> or ! <tt class="literal">hashCode()</tt>. </p><p> ! Please note that Hibernate no longer uses <tt class="literal">java.lang.reflect.Proxy</tt> for its proxies. Instead it uses the excellent CGLIB package. </p><p> Exceptions that occur while initializing a proxy are wrapped in a ! <tt class="literal">LazyInitializationException</tt>. ! </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="or-mapping.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="manipulating-data.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 4. Basic O/R Mapping </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 6. Manipulating Persistent Data</td></tr></table></div></body></html> \ No newline at end of file Index: architecture.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/html/architecture.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** architecture.html 28 Jan 2003 13:25:09 -0000 1.2 --- architecture.html 23 Feb 2003 13:45:25 -0000 1.3 *************** *** 1,7 **** <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Chapter 1. Architecture</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.49"><link rel="home" href="index.html" title="Hibernate Reference Documentation"><link rel="up" href="index.html" title="Hibernate Reference Documentation"><link rel="previous" href="index.html" title="Hibernate Reference Documentation"><link rel="next" href="session-configuration.html" title="Chapter 2. SessionFactory Configuration"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. Architecture</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="session-configuration.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="architecture"></a>Chapter 1. Architecture</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="architecture.html#architecture-s1">Overview</a></dt><dt><a href="architecture.html#architecture-s2">Persistent Object Identity</a></dt><dt><a href="architecture.html#architecture-s3">JMX Integration</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="architecture-s1"></a>Overview</h2></div></div><p> A (very) high-level view of the Hibernate architecture: ! </p><div class="mediaobject"><img src="../images/overview.gif" align="center"></div><p> This diagram shows Hibernate using the database and configuration data to provide persistence services (and persistent objects) to the application. --- 1,7 ---- <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Chapter 1. Architecture</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="HIBERNATE - Relational Persistence for Idiomatic Java"><link rel="up" href="index.html" title="HIBERNATE - Relational Persistence for Idiomatic Java"><link rel="previous" href="index.html" title="HIBERNATE - Relational Persistence for Idiomatic Java"><link rel="next" href="session-configuration.html" title="Chapter 2. SessionFactory Configuration"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. Architecture</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="session-configuration.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="architecture"></a>Chapter 1. Architecture</h2></div></div><div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="architecture-s1"></a>1.1. Overview</h2></div></div><div></div></div><p> A (very) high-level view of the Hibernate architecture: ! </p><div class="mediaobject" align="center"><img src="../images/overview.gif" align="middle"></div><p> This diagram shows Hibernate using the database and configuration data to provide persistence services (and persistent objects) to the application. *************** *** 12,79 **** provide its own JDBC connections and manage its own transactions. This approach uses a minimal subset of Hibernate's APIs: ! </p><div class="mediaobject"><img src="../images/lite.gif" align="center"></div><p> The "full cream" architecture abstracts the application away from the underlying JDBC / JTA APIs and lets Hibernate take care of the details. ! </p><div class="mediaobject"><img src="../images/full_cream.gif" align="center"></div><p> Heres some definitions of the objects in the diagrams: ! </p><div class="itemizedlist"><ul type="disc"><li><p> ! <tt>net.sf.hibernate.SessionFactory</tt> ! </p></li><li><p> ! <tt>net.sf.hibernate.Session</tt> ! </p></li><li><p> ! <tt>net.sf.hibernate.Transaction</tt> ! </p></li><li><p> ! <tt>net.sf.hibernate.TransactionFactory</tt> ! </p></li><li><p> ! <tt>net.sf.hibernate.connection.ConnectionProvider</tt> ! </p></li><li><p> ! persistent objects and collections ! </p></li><li><p> ! transient objects and collections ! </p></li></ul></div><div class="variablelist"><dl><dt><span class="term">SessionFactory</span></dt><dd><p> ! A threadsafe (immutable) cache of compiled mappings. A factory for ! <tt>Session</tt>. A client of <tt>ConnectionProvider</tt>. ! </p></dd><dt><span class="term">Session</span></dt><dd><p> ! A single-threaded, short-lived object representing a conversation between ! the application and the persistent store. Wraps a JDBC connection. Factory ! for <tt>Transaction</tt>. Manages persistent objects to the ! application. ! </p></dd><dt><span class="term">Persistent Objects and Collections</span></dt><dd><p> ! Short-lived, single threaded objects containing persistent state and business ! function. These might be ordinary JavaBeans, the only special thing about them ! is that they are currently associated with (exactly one) ! <tt>Session</tt>. ! </p></dd><dt><span class="term">Transient Objects and Collections</span></dt><dd><p> ! Instances of persistent classes that are not currently associated with a ! <tt>Session</tt>. They may have been instantiated by ! the application and not (yet) persisted or they may have been instantiated by a ! closed <tt>Session</tt>. ! </p></dd><dt><span class="term">Transaction</span></dt><dd><p> ! ( Optional ) A single-threaded, short-lived object used by the application to ! specify atomic units of work. Abstracts application from underlying JDBC, ! JTA or CORBA transaction. A <tt>Session</tt> might span several ! <tt>Transaction</tt>s. ! </p></dd><dt><span class="term">ConnectionProvider</span></dt><dd><p> ! ( Optional ) A factory for JDBC connections. Abstracts application from ! underlying <tt>Datasource</tt> or <tt>DriverManager</tt>. ! Not exposed to application. ! </p></dd><dt><span class="term">TransactionFactory</span></dt><dd><p> ! ( Optional ) A factory for <tt>Transaction</tt>. Not exposed to the ! application. ! </p></dd></dl></div><p> Given a "lite" architecture, the application bypasses the ! <tt>Transaction</tt> / <tt>TransactionFactory</tt> and / or ! <tt>ConnectionProvider</tt> APIs to talk to JTA or JDBC directly. ! </p></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="architecture-s2"></a>Persistent Object Identity</h2></div></div><p> The application may concurrently access the same persistent state in two different sessions. However, an instance of a persistent class is never shared ! between two <tt>Session</tt> instances. Hence there are two different notions of identity: ! </p><table class="simplelist" border="0" summary="Simple list"><tr><td>Persistent Identity</td><td> ! <tt>foo.getId().equals( bar.getId() )</tt> ! </td></tr><tr><td>JVM Identity</td><td> ! <tt>foo==bar</tt> ! </td></tr></table><p> ! Then for objects returned by a <span class="emphasis"><i>particular</i></span> <tt>Session</tt>, the two notions are equivalent. However, while the application might concurrently access the "same" (persistent identity) business object in two different sessions, the two --- 12,67 ---- provide its own JDBC connections and manage its own transactions. This approach uses a minimal subset of Hibernate's APIs: ! </p><div class="mediaobject" align="center"><img src="../images/lite.gif" align="middle"></div><p> The "full cream" architecture abstracts the application away from the underlying JDBC / JTA APIs and lets Hibernate take care of the details. ! </p><div class="mediaobject" align="center"><img src="../images/full_cream.gif" align="middle"></div><p> Heres some definitions of the objects in the diagrams: ! ! </p><div class="variablelist"><dl><dt><span class="term">SessionFactory (<tt class="literal">net.sf.hibernate.SessionFactory</tt>)</span></dt><dd><p> ! A threadsafe (immutable) cache of compiled mappings. A factory for ! <tt class="literal">Session</tt>. A client of <tt class="literal">ConnectionProvider</tt>. ! </p></dd><dt><span class="term">Session (<tt class="literal">net.sf.hibernate.Session</tt>)</span></dt><dd><p> ! A single-threaded, short-lived object representing a conversation between ! the application and the persistent store. Wraps a JDBC connection. Factory ! for <tt class="literal">Transaction</tt>. Manages persistent objects to the ! application. ! </p></dd><dt><span class="term">Persistent Objects and Collections</span></dt><dd><p> ! Short-lived, single threaded objects containing persistent state and business ! function. These might be ordinary JavaBeans, the only special thing about them ! is that they are currently associated with (exactly one) ! <tt class="literal">Session</tt>. ! </p></dd><dt><span class="term">Transient Objects and Collections</span></dt><dd><p> ! Instances of persistent classes that are not currently associated with a ! <tt class="literal">Session</tt>. They may have been instantiated by ! the application and not (yet) persisted or they may have been instantiated by a ! closed <tt class="literal">Session</tt>. ! </p></dd><dt><span class="term">Transaction (<tt class="literal">net.sf.hibernate.Transaction</tt>)</span></dt><dd><p> ! (Optional) A single-threaded, short-lived object used by the application to ! specify atomic units of work. Abstracts application from underlying JDBC, ! JTA or CORBA transaction. A <tt class="literal">Session</tt> might span several ! <tt class="literal">Transaction</tt>s. ! </p></dd><dt><span class="term">ConnectionProvider (<tt class="literal">net.sf.hibernate.connection.ConnectionProvider</tt>)</span></dt><dd><p> ! (Optional) A factory for JDBC connections. Abstracts application from ! underlying <tt class="literal">Datasource</tt> or <tt class="literal">DriverManager</tt>. ! Not exposed to application. ! </p></dd><dt><span class="term">TransactionFactory (<tt class="literal">net.sf.hibernate.TransactionFactory</tt>)</span></dt><dd><p> ! (Optional) A factory for <tt class="literal">Transaction</tt>. Not exposed to the ! application. ! </p></dd></dl></div><p> ! </p><p> Given a "lite" architecture, the application bypasses the ! <tt class="literal">Transaction</tt> / <tt class="literal">TransactionFactory</tt> and / or ! <tt class="literal">ConnectionProvider</tt> APIs to talk to JTA or JDBC directly. ! </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="architecture-s2"></a>1.2. Persistent Object Identity</h2></div></div><div></div></div><p> The application may concurrently access the same persistent state in two different sessions. However, an instance of a persistent class is never shared ! between two <tt class="literal">Session</tt> instances. Hence there are two different notions of identity: ! </p><div class="variablelist"><dl><dt><span class="term">Persistent Identity</span></dt><dd><p> ! <tt class="literal">foo.getId().equals( bar.getId() )</tt> ! </p></dd><dt><span class="term">JVM Identity</span></dt><dd><p> ! <tt class="literal">foo==bar</tt> ! </p></dd></dl></div><p> ! Then for objects returned by a <span class="emphasis"><em>particular</em></span> <tt class="literal">Session</tt>, the two notions are equivalent. However, while the application might concurrently access the "same" (persistent identity) business object in two different sessions, the two *************** *** 82,90 **** This approach leaves Hibernate and the database to worry about concurrency (the application never needs to synchronize on any business object, as long as it sticks to a ! single thread per <tt>Session</tt>) or object identity (within a session the ! application may safely use <tt>==</tt> to compare objects). ! </p></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="architecture-s3"></a>JMX Integration</h2></div></div><p> JMX is the J2EE standard for management of Java components. Hibernate may be managed via a JMX standard MBean but because most application servers do not yet support JMX, Hibernate also affords some non-standard configuration mechanisms. ! </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="session-configuration.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Hibernate Reference Documentation </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 2. SessionFactory Configuration</td></tr></table></div></body></html> \ No newline at end of file --- 70,78 ---- This approach leaves Hibernate and the database to worry about concurrency (the application never needs to synchronize on any business object, as long as it sticks to a ! single thread per <tt class="literal">Session</tt>) or object identity (within a session the ! application may safely use <tt class="literal">==</tt> to compare objects). ! </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="architecture-s3"></a>1.3. JMX Integration</h2></div></div><div></div></div><p> JMX is the J2EE standard for management of Java components. Hibernate may be managed via a JMX standard MBean but because most application servers do not yet support JMX, Hibernate also affords some non-standard configuration mechanisms. ! </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="session-configuration.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">HIBERNATE - Relational Persistence for Idiomatic Java </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 2. SessionFactory Configuration</td></tr></table></div></body></html> \ No newline at end of file Index: best-practices.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/html/best-practices.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** best-practices.html 28 Jan 2003 13:25:09 -0000 1.2 --- best-practices.html 23 Feb 2003 13:45:25 -0000 1.3 *************** *** 1,8 **** <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Chapter 10. Best Practices</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.49"><link rel="home" href="index.html" title="Hibernate Reference Documentation"><link rel="up" href="index.html" title="Hibernate Reference Documentation"><link rel="previous" href="examples.html" title="Chapter 9. Examples"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 10. Best Practices</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="examples.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> </td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="best-practices"></a>Chapter 10. Best Practices</h2></div></div><div class="variablelist"><dl><dt><span class="term">Write fine-grained classes and map them using <tt><component></tt> ! or <tt><component-element></tt>.</span></dt><dd><p> ! Use an <tt>Address</tt> class to encapsulate <tt>street</tt>, ! <tt>suburb</tt>, <tt>state</tt>, <tt>postcode</tt>. This encourages code reuse and simplifies refactoring. </p></dd><dt><span class="term">Declare identifier properties on persistent classes.</span></dt><dd><p> --- 1,8 ---- <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Chapter 10. Best Practices</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="HIBERNATE - Relational Persistence for Idiomatic Java"><link rel="up" href="index.html" title="HIBERNATE - Relational Persistence for Idiomatic Java"><link rel="previous" href="examples.html" title="Chapter 9. Examples"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 10. Best Practices</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="examples.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> </td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="best-practices"></a>Chapter 10. Best Practices</h2></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">Write fine-grained classes and map them using <tt class="literal"><component></tt> ! or <tt class="literal"><component-element></tt>.</span></dt><dd><p> ! Use an <tt class="literal">Address</tt> class to encapsulate <tt class="literal">street</tt>, ! <tt class="literal">suburb</tt>, <tt class="literal">state</tt>, <tt class="literal">postcode</tt>. This encourages code reuse and simplifies refactoring. </p></dd><dt><span class="term">Declare identifier properties on persistent classes.</span></dt><dd><p> *************** *** 10,17 **** you should use them. We recommend that identifiers be 'synthetic' (generated, with no business meaning) and of a non-primitive type. For maximum flexibility, use ! <tt>java.lang.Long</tt> or <tt>java.lang.String</tt>. </p></dd><dt><span class="term">Place each class mapping in its own file.</span></dt><dd><p> ! Don't use a single monolithic mapping document. Map <tt>com.eg.Foo</tt> in ! the file <tt>com/eg/Foo.hbm.xml</tt>. This makes particularly good sense in a team environment. </p></dd><dt><span class="term">Load mappings as resources.</span></dt><dd><p> --- 10,17 ---- you should use them. We recommend that identifiers be 'synthetic' (generated, with no business meaning) and of a non-primitive type. For maximum flexibility, use ! <tt class="literal">java.lang.Long</tt> or <tt class="literal">java.lang.String</tt>. </p></dd><dt><span class="term">Place each class mapping in its own file.</span></dt><dd><p> ! Don't use a single monolithic mapping document. Map <tt class="literal">com.eg.Foo</tt> in ! the file <tt class="literal">com/eg/Foo.hbm.xml</tt>. This makes particularly good sense in a team environment. </p></dd><dt><span class="term">Load mappings as resources.</span></dt><dd><p> *************** *** 27,53 **** Hibernate lets the application manage JDBC connections. This approach should be considered a last-resort. If you can't use the built-in connections providers, consider providing your ! own implementation of <tt>net.sf.hibernate.connection.ConnectionProvider</tt>. </p></dd><dt><span class="term">Consider using a custom type.</span></dt><dd><p> Suppose you have a Java type, say from some library, that needs to be persisted but doesn't provide the accessors needed to map it as a component. You should consider implementing ! <tt>net.sf.hibernate.UserType</tt>. This approach frees the application code from implementing transformations to / from a Hibernate type. </p></dd><dt><span class="term">Use hand-coded JDBC in bottlenecks.</span></dt><dd><p> In performance-critical areas of the system, some kinds of operations (eg. mass update / ! delete) might benefit from direct JDBC. But please, wait until you <span class="emphasis"><i>know</i></span> something is a bottleneck. And don't assume that direct JDBC is necessarily faster. If need to ! use direct JDBC, it might be worth opening a Hibernate <tt>Session</tt> and using that SQL connection. That way you can still use the same transaction strategy and underlying connection provider. ! </p></dd><dt><span class="term">Understand <tt>Session</tt> flushing.</span></dt><dd><p> From time to time the Session synchronizes its persistent state with the database. Performance will be affected if this process occurs too often. You may sometimes minimize unnecessary flushing by disabling automatic flushing or even by changing the order of queries and other operations within a particular transaction. ! </p></dd><dt><span class="term">In a three tiered architecture, consider using <tt>saveOrUpdate()</tt>.</span></dt><dd><p> When using a servlet / session bean architecture, you could pass persistent objects loaded in the session bean to and from the servlet / JSP layer. Use a new session to service each request. ! Use <tt>Session.update()</tt> or <tt>Session.saveOrUpdate()</tt> to update the persistent state of an object. </p></dd><dt><span class="term">In a two tiered architecture, consider using session disconnection.</span></dt><dd><p> --- 27,53 ---- Hibernate lets the application manage JDBC connections. This approach should be considered a last-resort. If you can't use the built-in connections providers, consider providing your ! own implementation of <tt class="literal">net.sf.hibernate.connection.ConnectionProvider</tt>. </p></dd><dt><span class="term">Consider using a custom type.</span></dt><dd><p> Suppose you have a Java type, say from some library, that needs to be persisted but doesn't provide the accessors needed to map it as a component. You should consider implementing ! <tt class="literal">net.sf.hibernate.UserType</tt>. This approach frees the application code from implementing transformations to / from a Hibernate type. </p></dd><dt><span class="term">Use hand-coded JDBC in bottlenecks.</span></dt><dd><p> In performance-critical areas of the system, some kinds of operations (eg. mass update / ! delete) might benefit from direct JDBC. But please, wait until you <span class="emphasis"><em>know</em></span> something is a bottleneck. And don't assume that direct JDBC is necessarily faster. If need to ! use direct JDBC, it might be worth opening a Hibernate <tt class="literal">Session</tt> and using that SQL connection. That way you can still use the same transaction strategy and underlying connection provider. ! </p></dd><dt><span class="term">Understand <tt class="literal">Session</tt> flushing.</span></dt><dd><p> From time to time the Session synchronizes its persistent state with the database. Performance will be affected if this process occurs too often. You may sometimes minimize unnecessary flushing by disabling automatic flushing or even by changing the order of queries and other operations within a particular transaction. ! </p></dd><dt><span class="term">In a three tiered architecture, consider using <tt class="literal">saveOrUpdate()</tt>.</span></dt><dd><p> When using a servlet / session bean architecture, you could pass persistent objects loaded in the session bean to and from the servlet / JSP layer. Use a new session to service each request. ! Use <tt class="literal">Session.update()</tt> or <tt class="literal">Session.saveOrUpdate()</tt> to update the persistent state of an object. </p></dd><dt><span class="term">In a two tiered architecture, consider using session disconnection.</span></dt><dd><p> *************** *** 56,60 **** </p></dd><dt><span class="term">Don't treat exceptions as recoverable.</span></dt><dd><p> This is more of a necessary paractice than a "best" practice. When an exception occurs, roll back ! the <tt>Transaction</tt> and close the <tt>Session</tt>. If you don't, Hibernate can't guarantee that in-memory state accurately represents persistent state ! </p></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="examples.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top">Chapter 9. Examples </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html> \ No newline at end of file --- 56,60 ---- </p></dd><dt><span class="term">Don't treat exceptions as recoverable.</span></dt><dd><p> This is more of a necessary paractice than a "best" practice. When an exception occurs, roll back ! the <tt class="literal">Transaction</tt> and close the <tt class="literal">Session</tt>. If you don't, Hibernate can't guarantee that in-memory state accurately represents persistent state ! </p></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="examples.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top">Chapter 9. Examples </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html> \ No newline at end of file Index: examples.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/html/examples.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** examples.html 28 Jan 2003 13:25:09 -0000 1.2 --- examples.html 23 Feb 2003 13:45:25 -0000 1.3 *************** *** 1,11 **** <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Chapter 9. Examples</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.49"><link rel="home" href="index.html" title="Hibernate Reference Documentation"><link rel="up" href="index.html" title="Hibernate Reference Documentation"><link rel="previous" href="transactions.html" title="Chapter 8. Transactions And Concurrency"><link rel="next" href="best-practices.html" title="Chapter 10. Best Practices"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 9. Examples</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="transactions.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="best-practices.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="examples"></a>Chapter 9. Examples</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="examples.html#examples-s0">Employer / Employee</a></dt><dt><a href="examples.html#examples-s1">Author / Work</a></dt><dt><a href="examples.html#examples-s2">Customer / Order / Product</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="examples-s0"></a>Employer / Employee</h2></div></div><p> ! The following model of the relationship between <tt>Employer</tt> and ! <tt>Employee</tt> uses an actual entity class (<tt>Employment</tt>) to represent the association. This is done because there might be more than one period of employment for the same two parties. Components are used to model monetory values and employee names. ! </p><div class="mediaobject"><img src="../images/EmployerEmployee.gif" align="center"></div><p> Heres a possible mapping document: </p><pre class="programlisting"><hibernate-mapping> --- 1,11 ---- <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Chapter 9. Examples</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="HIBERNATE - Relational Persistence for Idiomatic Java"><link rel="up" href="index.html" title="HIBERNATE - Relational Persistence for Idiomatic Java"><link rel="previous" href="transactions.html" title="Chapter 8. Transactions And Concurrency"><link rel="next" href="best-practices.html" title="Chapter 10. Best Practices"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 9. Examples</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="transactions.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="best-practices.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="examples"></a>Chapter 9. Examples</h2></div></div><div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="examples-s0"></a>9.1. Employer/Employee</h2></div></div><div></div></div><p> ! The following model of the relationship between <tt class="literal">Employer</tt> and ! <tt class="literal">Employee</tt> uses an actual entity class (<tt class="literal">Employment</tt>) to represent the association. This is done because there might be more than one period of employment for the same two parties. Components are used to model monetory values and employee names. ! </p><div class="mediaobject" align="center"><img src="../images/EmployerEmployee.gif" align="middle"></div><p> Heres a possible mapping document: </p><pre class="programlisting"><hibernate-mapping> *************** *** 57,61 **** </hibernate-mapping></pre><p> ! And heres the table schema generated by <tt>SchemaExport</tt>. </p><pre class="programlisting">create table employers ( id BIGINT not null, --- 57,61 ---- </hibernate-mapping></pre><p> ! And heres the table schema generated by <tt class="literal">SchemaExport</tt>. </p><pre class="programlisting">create table employers ( id BIGINT not null, *************** *** 84,99 **** ) ! alter table employment_periods add constraint employment_periodsFK0 foreign key (employer_id) references employers ! alter table employment_periods add constraint employment_periodsFK1 foreign key (employee_id) references employees create sequence employee_id_seq create sequence employment_id_seq ! create sequence employer_id_seq</pre></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="examples-s1"></a>Author / Work</h2></div></div><p> ! Consider the following model of the relationships between <tt>Work</tt>, ! <tt>Author</tt> and <tt>Person</tt>. We represent the relationship ! between <tt>Work</tt> and <tt>Author</tt> as a many-to-many ! association. We choose to represent the relationship between <tt>Author</tt> ! and <tt>Person</tt> as one-to-one association. Another possibility would be to ! have <tt>Author</tt> extend <tt>Person</tt>. ! </p><div class="mediaobject"><img src="../images/AuthorWork.gif" align="center"></div><p> The following mapping document correctly represents these relationships: </p><pre class="programlisting"><hibernate-mapping> --- 84,101 ---- ) ! alter table employment_periods ! add constraint employment_periodsFK0 foreign key (employer_id) references employers ! alter table employment_periods ! add constraint employment_periodsFK1 foreign key (employee_id) references employees create sequence employee_id_seq create sequence employment_id_seq ! create sequence employer_id_seq</pre></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="examples-s1"></a>9.2. Author/Work</h2></div></div><div></div></div><p> ! Consider the following model of the relationships between <tt class="literal">Work</tt>, ! <tt class="literal">Author</tt> and <tt class="literal">Person</tt>. We represent the relationship ! between <tt class="literal">Work</tt> and <tt class="literal">Author</tt> as a many-to-many ! association. We choose to represent the relationship between <tt class="literal">Author</tt> ! and <tt class="literal">Person</tt> as one-to-one association. Another possibility would be to ! have <tt class="literal">Author</tt> extend <tt class="literal">Person</tt>. ! </p><div class="mediaobject" align="center"><img src="../images/AuthorWork.gif" align="middle"></div><p> The following mapping document correctly represents these relationships: </p><pre class="programlisting"><hibernate-mapping> *************** *** 126,130 **** <id name="id" column="id"> ! <generator class="assigned"/> <!-- The Author must have the same identifier as the Person --> </id> --- 128,133 ---- <id name="id" column="id"> ! <!-- The Author must have the same identifier as the Person --> ! <generator class="assigned"/> </id> *************** *** 147,155 **** </hibernate-mapping></pre><p> ! There are four tables in this mapping. <tt>works</tt>, ! <tt>authors</tt> and <tt>persons</tt> hold work, author ! and person data respectively. <tt>author_work</tt> is an association table linking authors to works. Heres the table schema, as generated by ! <tt>SchemaExport</tt>. </p><pre class="programlisting">create table works ( id BIGINT not null generated by default as identity, --- 150,158 ---- </hibernate-mapping></pre><p> ! There are four tables in this mapping. <tt class="literal">works</tt>, ! <tt class="literal">authors</tt> and <tt class="literal">persons</tt> hold work, author ! and person data respectively. <tt class="literal">author_work</tt> is an association table linking authors to works. Heres the table schema, as generated by ! <tt class="literal">SchemaExport</tt>. </p><pre class="programlisting">create table works ( id BIGINT not null generated by default as identity, *************** *** 180,195 **** ) ! alter table authors add constraint authorsFK0 foreign key (id) references persons ! alter table author_work add constraint author_workFK0 foreign key (author_id) references authors ! alter table author_work add constraint author_workFK1 foreign key (work_id) references works</pre></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="examples-s2"></a>Customer / Order / Product</h2></div></div><p> ! Now consider a model of the relationships between <tt>Customer</tt>, ! <tt>Order</tt> and <tt>LineItem</tt> and <tt>Product</tt>. ! There is a one-to-many association between <tt>Customer</tt> and ! <tt>Order</tt>, but how should we represent <tt>Order</tt> / ! <tt>LineItem</tt> / <tt>Product</tt>? I've chosen to map ! <tt>LineItem</tt> as an association class representing the many-to-many ! association between <tt>Order</tt> and <tt>Product</tt>. In Hibernate, this is called a composite element. ! </p><div class="mediaobject"><img src="../images/CustomerOrderProduct.gif" align="center"></div><p> The mapping document: </p><pre class="programlisting"><hibernate-mapping> --- 183,201 ---- ) ! alter table authors ! add constraint authorsFK0 foreign key (id) references persons ! alter table author_work ! add constraint author_workFK0 foreign key (author_id) references authors ! alter table author_work ! add constraint author_workFK1 foreign key (work_id) references works</pre></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="examples-s2"></a>9.3. Customer/Order/Product</h2></div></div><div></div></div><p> ! Now consider a model of the relationships between <tt class="literal">Customer</tt>, ! <tt class="literal">Order</tt> and <tt class="literal">LineItem</tt> and <tt class="literal">Product</tt>. ! There is a one-to-many association between <tt class="literal">Customer</tt> and ! <tt class="literal">Order</tt>, but how should we represent <tt class="literal">Order</tt> / ! <tt class="literal">LineItem</tt> / <tt class="literal">Product</tt>? I've chosen to map ! <tt class="literal">LineItem</tt> as an association class representing the many-to-many ! association between <tt class="literal">Order</tt> and <tt class="literal">Product</tt>. In Hibernate, this is called a composite element. ! </p><div class="mediaobject" align="center"><img src="../images/AuthorWork.gif" align="middle"></div><p> The mapping document: </p><pre class="programlisting"><hibernate-mapping> *************** *** 230,236 **** </hibernate-mapping></pre><p> ! <tt>customers</tt>, <tt>orders</tt>, <tt>line_items</tt> and ! <tt>products</tt> hold customer, order, order line item and product data ! respectively. <tt>line_items</tt> also acts as an association table linking orders with products. </p><pre class="programlisting">create table customers ( --- 236,242 ---- </hibernate-mapping></pre><p> ! <tt class="literal">customers</tt>, <tt class="literal">orders</tt>, <tt class="literal">line_items</tt> and ! <tt class="literal">products</tt> hold customer, order, order line item and product data ! respectively. <tt class="literal">line_items</tt> also acts as an association table linking orders with products. </p><pre class="programlisting">create table customers ( *************** *** 261,265 **** ) ! alter table orders add constraint ordersFK0 foreign key (customer_id) references customers ! alter table line_items add constraint line_itemsFK0 foreign key (product_id) references products ! alter table line_items add constraint line_itemsFK1 foreign key (order_id) references orders</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="transactions.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="best-practices.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 8. Transactions And Concurrency </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 10. Best Practices</td></tr></table></div></body></html> \ No newline at end of file --- 267,274 ---- ) ! alter table orders ! add constraint ordersFK0 foreign key (customer_id) references customers ! alter table line_items ! add constraint line_itemsFK0 foreign key (product_id) references products ! alter table line_items ! add constraint line_itemsFK1 foreign key (order_id) references orders</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="transactions.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="best-practices.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 8. Transactions And Concurrency </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 10. Best Practices</td></tr></table></div></body></html> \ No newline at end of file Index: index.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/html/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.html 28 Jan 2003 13:25:09 -0000 1.2 --- index.html 23 Feb 2003 13:45:25 -0000 1.3 *************** *** 1,3 **** <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Hibernate Reference Documentation</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.49"><link rel="home" href="index.html" title="Hibernate Reference Documentation"><link rel="next" href="architecture.html" title="Chapter 1. Architecture"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Hibernate Reference Documentation</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="architecture.html">Next</a></td></tr></table><hr></div><div class="book"><div class="titlepage"><div><h1 class="title"><a name="d0e1"></a>Hibernate Reference Documentation</h1></div><div><h2 class="subtitle">Relational Persistence for Idiomatic Java</h2></div><div><h2 class="subtitle">http://hibernate.sourceforge.net/</h2></div><div><h2 class="subtitle">Version: 2.0 beta1</h2></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>1. <a href="architecture.html">Architecture</a></dt><dd><dl><dt><a href="architecture.html#architecture-s1">Overview</a></dt><dt><a href="architecture.html#architecture-s2">Persistent Object Identity</a></dt><dt><a href="architecture.html#architecture-s3">JMX Integration</a></dt></dl></dd><dt>2. <a href="session-configuration.html">SessionFactory Configuration</a></dt><dd><dl><dt><a href="session-configuration.html#session-configuration-s1">Programmatic Configuration</a></dt><dt><a href="session-configuration.html#session-configuration-s2">Obtaining a SessionFactory</a></dt><dt><a href="session-configuration.html#session-configuration-s3">User provided JDBC connection</a></dt><dt><a href="session-configuration.html#session-configuration-s4">Hibernate provided JDBC connection</a></dt><dt><a href="session-configuration.html#session-configuration-s5">Other properties</a></dt><dt><a href="session-configuration.html#session-configuration-s6">XML Configuration File</a></dt><dt><a href="session-configuration.html#session-configuration-s7">Logging</a></dt></dl></dd><dt>3. <a href="persistent-classes.html">Persistent Classes</a></dt><dd><dl><dt><a href="persistent-classes.html#persistent-classes-s1">Simple Example</a></dt><dd><dl><dt><a href="persistent-classes.html#persistent-classes-s1-1">Declare accessors and mutators for persistent fields</a></dt><dt><a href="persistent-classes.html#persistent-classes-s1-2">Implement a default constructor</a></dt><dt><a href="persistent-classes.html#persistent-classes-s1-3">Provide an identifier property (optional)</a></dt></dl></dd><dt><a href="persistent-classes.html#persistent-classes-s2">Inheritance</a></dt><dt><a href="persistent-classes.html#persistent-classes-s3">Persistent Lifecycle Callbacks</a></dt><dt><a href="persistent-classes.html#persistent-classes-s4">Validatable</a></dt></dl></dd><dt>4. <a href="or-mapping.html">Basic O/R Mapping</a></dt><dd><dl><dt><a href="or-mapping.html#or-mapping-s1">Mapping declaration</a></dt><dd><dl><dt><a href="or-mapping.html#or-mapping-s1-1">Doctype</a></dt><dt><a href="or-mapping.html#or-mapping-s1-2">hibernate-mapping</a></dt><dt><a href="or-mapping.html#or-mapping-s1-3">class</a></dt><dt><a href="or-mapping.html#or-mapping-s1-4">id</a></dt><dt><a href="or-mapping.html#or-mapping-s1-4b">composite-id</a></dt><dt><a href="or-mapping.html#or-mapping-s1-5">discriminator</a></dt><dt><a href="or-mapping.html#or-mapping-s1-6">version (optional)</a></dt><dt><a href="or-mapping.html#or-mapping-s1-6b">timestamp (optional)</a></dt><dt><a href="or-mapping.html#or-mapping-s1-7">property</a></dt><dt><a href="or-mapping.html#or-mapping-s1-8">many-to-one</a></dt><dt><a href="or-mapping.html#or-mapping-s1-9">one-to-one</a></dt><dt><a href="or-mapping.html#or-mapping-s1-10">component, dynabean</a></dt><dt><a href="or-mapping.html#or-mapping-s1-11">subclass</a></dt><dt><a href="or-mapping.html#or-mapping-s1-11b">joined-subclass</a></dt><dt><a href="or-mapping.html#or-mapping-s1-12">map, set, list, bag</a></dt></dl></dd><dt><a href="or-mapping.html#or-mapping-s2">Hibernate Types</a></dt><dd><dl><dt><a href="or-mapping.html#or-mapping-s2-1">Entities and values</a></dt><dt><a href="or-mapping.html#or-mapping-s2-2">Basic value types</a></dt><dt><a href="or-mapping.html#or-mapping-s2-3">Persistent enum types</a></dt><dt><a href="or-mapping.html#or-mapping-s2-4">Custom value types</a></dt><dt><a href="or-mapping.html#or-mapping-s2-5">The object type</a></dt></dl></dd></dl></dd><dt>5. <a href="adv-or-mapping.html">Advanced O/R Mapping</a></dt><dd><dl><dt><a href="adv-or-mapping.html#adv-or-mapping-s1">Collections</a></dt><dd><dl><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-1">Persistent Collections</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt><a href="adv-or-mapping... [truncated message content] |
From: <tu...@us...> - 2003-02-23 13:45:30
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/html_single In directory sc8-pr-cvs1:/tmp/cvs-serv13704/doc/reference/html_single Modified Files: index.html Log Message: Updated Index: index.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/html_single/index.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** index.html 2 Feb 2003 07:02:31 -0000 1.3 --- index.html 23 Feb 2003 13:45:24 -0000 1.4 *************** *** 1,7 **** <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Hibernate Reference Documentation</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.49"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book"><div class="titlepage"><div><h1 class="title"><a name="d0e1"></a>Hibernate Reference Documentation</h1></div><div><h2 class="subtitle">Relational Persistence for Idiomatic Java</h2></div><div><h2 class="subtitle">http://hibernate.sourceforge.net/</h2></div><div><h2 class="subtitle">Version: 2.0 beta1</h2></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>1. <a href="#architecture">Architecture</a></dt><dd><dl><dt><a href="#architecture-s1">Overview</a></dt><dt><a href="#architecture-s2">Persistent Object Identity</a></dt><dt><a href="#architecture-s3">JMX Integration</a></dt></dl></dd><dt>2. <a href="#session-configuration">SessionFactory Configuration</a></dt><dd><dl><dt><a href="#session-configuration-s1">Programmatic Configuration</a></dt><dt><a href="#session-configuration-s2">Obtaining a SessionFactory</a></dt><dt><a href="#session-configuration-s3">User provided JDBC connection</a></dt><dt><a href="#session-configuration-s4">Hibernate provided JDBC connection</a></dt><dt><a href="#session-configuration-s5">Other properties</a></dt><dt><a href="#session-configuration-s6">XML Configuration File</a></dt><dt><a href="#session-configuration-s7">Logging</a></dt></dl></dd><dt>3. <a href="#persistent-classes">Persistent Classes</a></dt><dd><dl><dt><a href="#persistent-classes-s1">Simple Example</a></dt><dd><dl><dt><a href="#persistent-classes-s1-1">Declare accessors and mutators for persistent fields</a></dt><dt><a href="#persistent-classes-s1-2">Implement a default constructor</a></dt><dt><a href="#persistent-classes-s1-3">Provide an identifier property (optional)</a></dt></dl></dd><dt><a href="#persistent-classes-s2">Inheritance</a></dt><dt><a href="#persistent-classes-s3">Persistent Lifecycle Callbacks</a></dt><dt><a href="#persistent-classes-s4">Validatable</a></dt></dl></dd><dt>4. <a href="#or-mapping">Basic O/R Mapping</a></dt><dd><dl><dt><a href="#or-mapping-s1">Mapping declaration</a></dt><dd><dl><dt><a href="#or-mapping-s1-1">Doctype</a></dt><dt><a href="#or-mapping-s1-2">hibernate-mapping</a></dt><dt><a href="#or-mapping-s1-3">class</a></dt><dt><a href="#or-mapping-s1-4">id</a></dt><dt><a href="#or-mapping-s1-4b">composite-id</a></dt><dt><a href="#or-mapping-s1-5">discriminator</a></dt><dt><a href="#or-mapping-s1-6">version (optional)</a></dt><dt><a href="#or-mapping-s1-6b">timestamp (optional)</a></dt><dt><a href="#or-mapping-s1-7">property</a></dt><dt><a href="#or-mapping-s1-8">many-to-one</a></dt><dt><a href="#or-mapping-s1-9">one-to-one</a></dt><dt><a href="#or-mapping-s1-10">component, dynabean</a></dt><dt><a href="#or-mapping-s1-11">subclass</a></dt><dt><a href="#or-mapping-s1-11b">joined-subclass</a></dt><dt><a href="#or-mapping-s1-12">map, set, list, bag</a></dt></dl></dd><dt><a href="#or-mapping-s2">Hibernate Types</a></dt><dd><dl><dt><a href="#or-mapping-s2-1">Entities and values</a></dt><dt><a href="#or-mapping-s2-2">Basic value types</a></dt><dt><a href="#or-mapping-s2-3">Persistent enum types</a></dt><dt><a href="#or-mapping-s2-4">Custom value types</a></dt><dt><a href="#or-mapping-s2-5">The object type</a></dt></dl></dd></dl></dd><dt>5. <a href="#adv-or-mapping">Advanced O/R Mapping</a></dt><dd><dl><dt><a href="#adv-or-mapping-s1">Collections</a></dt><dd><dl><dt><a href="#adv-or-mapping-s1-1">Persistent Collections</a></dt><dt><a href="#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt><a href="#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt><a href="#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt><a href="#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt><a href="#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt><a href="#adv-or-mapping-s1-9">Garbage Collection</a></dt><dt><a href="#adv-or-mapping-s1-10">Bidirectional Associations</a></dt><dt><a href="#adv-or-mapping-s1-11">Ternary Associations</a></dt><dt><a href="#adv-or-mapping-s1-12">Collection Example</a></dt></dl></dd><dt><a href="#adv-or-mapping-s2">Components</a></dt><dd><dl><dt><a href="#adv-or-mapping-s2-1">As Dependent Objects</a></dt><dt><a href="#adv-or-mapping-s2-2">In Collections</a></dt><dt><a href="#adv-or-mapping-s2-2b">As a Map Index</a></dt><dt><a href="#adv-or-mapping-s2-3">As Composite Identifiers</a></dt><dt><a href="#adv-or-mapping-s2-4">Dynabean components</a></dt></dl></dd><dt><a href="#adv-or-mapping-s3">Cache</a></dt><dd><dl><dt><a href="#adv-or-mapping-s3-1">Mapping</a></dt><dt><a href="#adv-or-mapping-s3-2">Read Only Cache</a></dt><dt><a href="#adv-or-mapping-s3-3">Read / Write Cache</a></dt></dl></dd><dt><a href="#adv-or-mapping-s4">Proxies for Lazy Initialization</a></dt></dl></dd><dt>6. <a href="#manipulating-data">Manipulating Persistent Data</a></dt><dd><dl><dt><a href="#manipulating-data-s1">Creating a persistent object</a></dt><dt><a href="#manipulating-data-s2">Loading an object</a></dt><dt><a href="#manipulating-data-s3">Querying</a></dt><dd><dl><dt><a href="#manipulating-data-s4">Scalar queries</a></dt><dt><a href="#manipulating-data-s5">The Query interface</a></dt><dt><a href="#manipulating-data-s5b">Scrollable iteration</a></dt><dt><a href="#manipulating-data-s6">Filtering collections</a></dt></dl></dd><dt><a href="#manipulating-data-s7">Updating objects saved or loaded in the current session</a></dt><dt><a href="#manipulating-data-s8">Updating objects saved or loaded in a previous session</a></dt><dt><a href="#manipulating-data-s9">Deleting persistent objects</a></dt><dt><a href="#manipulating-data-s10">Graphs of objects</a></dt><dd><dl><dt><a href="#manipulating-data-s11a">Lifecycle objects</a></dt><dt><a href="#manipulating-data-s11b">Persistence by Reachability</a></dt></dl></dd><dt><a href="#manipulating-data-s12">Flushing</a></dt><dt><a href="#manipulating-data-s13">Ending a Session</a></dt><dd><dl><dt><a href="#manipulating-data-s13-1">Flushing the session</a></dt><dt><a href="#manipulating-data-s13-2">Committing the transaction</a></dt><dt><a href="#manipulating-data-s13-3">Closing the session</a></dt><dt><a href="#manipulating-data-s13-4">Exception handling</a></dt></dl></dd><dt><a href="#manipulating-data-s14">Interceptors</a></dt></dl></dd><dt>7. <a href="#query-language">Hibernate Query Language</a></dt><dd><dl><dt><a href="#query-language-s1">Case Sensitivity</a></dt><dt><a href="#query-language-s2">The from clause</a></dt><dt><a href="#query-language-s3">The select clause</a></dt><dt><a href="#query-language-s3b">polymorphism</a></dt><dt><a href="#query-language-s4">from collections</a></dt><dt><a href="#query-language-s5">The where clause</a></dt><dt><a href="#query-language-s6">Expressions</a></dt><dt><a href="#query-language-s7">The order by clause</a></dt><dt><a href="#query-language-s8">The group by clause</a></dt><dt><a href="#query-language-s9">Subqueries</a></dt></dl></dd><dt>8. <a href="#transactions">Transactions And Concurrency</a></dt><dd><dl><dt><a href="#transactions-s1">Configurations, Sessions and Factories</a></dt><dt><a href="#transactions-s2">Threads and connections</a></dt><dt><a href="#transactions-s3">Optimistic Locking / Versioning</a></dt><dd><dl><dt><a href="#transactions-s3-1">Long session with automatic versioning</a></dt><dt><a href="#transactions-s3-2">Many sessions with automatic versioning</a></dt><dt><a href="#transactions-s3-3">Application version checking</a></dt></dl></dd><dt><a href="#transactions-s4">Session disconnection</a></dt><dt><a href="#transactions-s5">Pessimistic Locking</a></dt></dl></dd><dt>9. <a href="#examples">Examples</a></dt><dd><dl><dt><a href="#examples-s0">Employer / Employee</a></dt><dt><a href="#examples-s1">Author / Work</a></dt><dt><a href="#examples-s2">Customer / Order / Product</a></dt></dl></dd><dt>10. <a href="#best-practices">Best Practices</a></dt></dl></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="architecture"></a>Chapter 1. Architecture</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#architecture-s1">Overview</a></dt><dt><a href="#architecture-s2">Persistent Object Identity</a></dt><dt><a href="#architecture-s3">JMX Integration</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="architecture-s1"></a>Overview</h2></div></div><p> A (very) high-level view of the Hibernate architecture: ! </p><div class="mediaobject"><img src="../images/overview.gif" align="center"></div><p> This diagram shows Hibernate using the database and configuration data to provide persistence services (and persistent objects) to the application. --- 1,7 ---- <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> [...5521 lines suppressed...] When using a servlet / session bean architecture, you could pass persistent objects loaded in ! the session bean to and from the servlet / JSP layer. Use a new session to service each request. ! Use <tt class="literal">Session.update()</tt> or <tt class="literal">Session.saveOrUpdate()</tt> to update the persistent state of an object. </p></dd><dt><span class="term">In a two tiered architecture, consider using session disconnection.</span></dt><dd><p> *************** *** 3312,3317 **** remember to disconnect the session before returning control to the client. </p></dd><dt><span class="term">Don't treat exceptions as recoverable.</span></dt><dd><p> ! This is more of a necessary paractice than a "best" practice. When an exception occurs, roll back ! the <tt>Transaction</tt> and close the <tt>Session</tt>. If you don't, Hibernate can't guarantee that in-memory state accurately represents persistent state </p></dd></dl></div></div></div></body></html> --- 3418,3423 ---- remember to disconnect the session before returning control to the client. </p></dd><dt><span class="term">Don't treat exceptions as recoverable.</span></dt><dd><p> ! This is more of a necessary paractice than a "best" practice. When an exception occurs, roll back ! the <tt class="literal">Transaction</tt> and close the <tt class="literal">Session</tt>. If you don't, Hibernate can't guarantee that in-memory state accurately represents persistent state </p></dd></dl></div></div></div></body></html> |
From: <tu...@us...> - 2003-02-23 13:41:59
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/bin In directory sc8-pr-cvs1:/tmp/cvs-serv11698/doc/reference/bin Added Files: db2fopdf.sh db2html.sh Log Message: Bash scripts for doco generation with Saxon/Apache FOP --- NEW FILE: db2fopdf.sh --- #!/bin/bash # SAXON XSLT Processor, http://saxon.sourceforge.net/ SAXON=~/dev/lib/saxon.jar; # SAXON XSL Extensions, http://docbook.sourceforge.net/projects/xsl/ SAXEXT=/usr/share/sgml/docbook/xsl-stylesheets/extensions/saxon65.jar; # APACHE Formatting Objects, http://xml.apache.org/fop/ FOP=~/dev/lib/fop.jar; # Java Imaging, http://developer.java.sun.com/developer/earlyAccess/jai/ JAI=~/dev/lib/jai_codec.jar:~/dev/lib/jai_core.jar; USAGE="usage: db2fopdf.sh INFILE.xml STYLE.XSL OUTFILE.pdf" 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 PDF/FOP with Saxon from DocBook XML source: $1" CLASSPATH=$SAXON:$SAXEXT:$FOP:$JAI RAND=$RANDOM java -cp $CLASSPATH com.icl.saxon.StyleSheet -o $RAND $1 $2 RETVAL=$? if [ $RETVAL -eq 0 ] ; then java -cp $CLASSPATH org.apache.fop.apps.Fop $RAND $3 rm $RAND fi echo "Finished." --- NEW FILE: db2html.sh --- #!/bin/bash # SAXON XSLT Processor, http://saxon.sourceforge.net/ SAXON=~/dev/lib/saxon.jar; # SAXON XSL Extensions, http://docbook.sourceforge.net/projects/xsl/ SAXEXT=/usr/share/sgml/docbook/xsl-stylesheets/extensions/saxon65.jar; USAGE="usage: db2html.sh 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 DocBook XML source: $1" CLASSPATH=$SAXON:$SAXEXT CURRDIR=$PWD; if [ -d $3 ]; then cd $3; echo "Chunking HTML files in $CURRDIR/$3..."; INFILE="$CURRDIR/$1"; XSLFILE="$CURRDIR/$2"; java -cp $CLASSPATH com.icl.saxon.StyleSheet $INFILE $XSLFILE cd $CURRDIR; else java -cp $CLASSPATH com.icl.saxon.StyleSheet -o $3 $1 $2 fi echo "Finished." |
From: <tu...@us...> - 2003-02-23 13:41:17
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/bin In directory sc8-pr-cvs1:/tmp/cvs-serv11292/doc/reference/bin Log Message: Directory /cvsroot/hibernate/Hibernate2/doc/reference/bin added to the repository |
From: <one...@us...> - 2003-02-23 07:22:15
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv25986/persister Modified Files: NormalizedEntityPersister.java Log Message: continued refactoring of hql package Index: NormalizedEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/NormalizedEntityPersister.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** NormalizedEntityPersister.java 23 Feb 2003 01:32:21 -0000 1.10 --- NormalizedEntityPersister.java 23 Feb 2003 07:22:11 -0000 1.11 *************** *** 40,44 **** import net.sf.hibernate.sql.Delete; import net.sf.hibernate.sql.Insert; ! import net.sf.hibernate.sql.OuterJoinFragment; import net.sf.hibernate.sql.SimpleSelect; import net.sf.hibernate.sql.SelectFragment; --- 40,44 ---- import net.sf.hibernate.sql.Delete; import net.sf.hibernate.sql.Insert; ! import net.sf.hibernate.sql.JoinFragment; import net.sf.hibernate.sql.SimpleSelect; import net.sf.hibernate.sql.SelectFragment; *************** *** 931,936 **** } ! private OuterJoinFragment outerjoin(String name, boolean innerJoin, boolean includeSubclasses) { ! OuterJoinFragment outerjoin = factory.getDialect().createOuterJoinFragment(); for ( int i=1; i<subclassTableNameClosure.length; i++ ) { if (includeSubclasses || isClassOrSuperclassTable[i]) { --- 931,936 ---- } ! private JoinFragment outerjoin(String name, boolean innerJoin, boolean includeSubclasses) { ! JoinFragment outerjoin = factory.getDialect().createOuterJoinFragment(); for ( int i=1; i<subclassTableNameClosure.length; i++ ) { if (includeSubclasses || isClassOrSuperclassTable[i]) { *************** *** 940,944 **** StringHelper.prefix( getIdentifierColumnNames(), name + StringHelper.DOT ), subclassTableKeyColumns[i], ! innerJoin && isClassOrSuperclassTable[i] ? OuterJoinFragment.INNER_JOIN : OuterJoinFragment.LEFT_OUTER_JOIN ); } --- 940,944 ---- StringHelper.prefix( getIdentifierColumnNames(), name + StringHelper.DOT ), subclassTableKeyColumns[i], ! innerJoin && isClassOrSuperclassTable[i] ? JoinFragment.INNER_JOIN : JoinFragment.LEFT_OUTER_JOIN ); } |
From: <one...@us...> - 2003-02-23 07:22:15
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql In directory sc8-pr-cvs1:/tmp/cvs-serv25986/sql Added Files: ANSIJoinFragment.java JoinFragment.java OracleJoinFragment.java QueryJoinFragment.java Removed Files: ANSIOuterJoinFragment.java OracleOuterJoinFragment.java OuterJoinFragment.java QueryOuterJoinFragment.java Log Message: continued refactoring of hql package --- NEW FILE: ANSIJoinFragment.java --- //$Id: ANSIJoinFragment.java,v 1.1 2003/02/23 07:22:11 oneovthafew Exp $ package net.sf.hibernate.sql; import net.sf.hibernate.AssertionFailure; import net.sf.hibernate.util.StringHelper; public class ANSIJoinFragment extends JoinFragment { private StringBuffer buffer = new StringBuffer(); private StringBuffer conditions = new StringBuffer(); public void addJoin(String tableName, String alias, String[] fkColumns, String[] pkColumns, int joinType) { String joinString; switch (joinType) { case INNER_JOIN: joinString = " inner join "; break; case LEFT_OUTER_JOIN: joinString = " left outer join "; break; case RIGHT_OUTER_JOIN: joinString = " right outer join "; break; case FULL_JOIN: joinString = " full outer join "; break; default: throw new AssertionFailure("undefined join type"); } buffer.append(joinString) .append(tableName) .append(' ') .append(alias) .append(" on "); for ( int j=0; j<fkColumns.length; j++) { if (fkColumns[j].indexOf('.')<1) throw new AssertionFailure("missing alias"); buffer.append( fkColumns[j] ) .append('=') .append(alias) .append(StringHelper.DOT) .append( pkColumns[j] ); if ( j<fkColumns.length-1 ) buffer.append(" and "); } } public String toFromFragmentString() { return buffer.toString(); } public String toWhereFragmentString() { return conditions.toString(); } public void addJoins(String fromFragment, String whereFragment) { buffer.append(fromFragment); //where fragment must be empty! } public JoinFragment copy() { ANSIJoinFragment copy = new ANSIJoinFragment(); copy.buffer = new StringBuffer( buffer.toString() ); return copy; } public void addCondition(String alias, String[] columns, String condition) { for ( int i=0; i<columns.length; i++ ) { conditions.append(" and ") .append(alias) .append(StringHelper.DOT) .append( columns[i] ) .append(condition); } } public void addCrossJoin(String tableName, String alias) { buffer.append(StringHelper.COMMA_SPACE) .append(tableName) .append(' ') .append(alias); } public void addCondition( String alias, String[] fkColumns, String[] pkColumns) { throw new UnsupportedOperationException(); } public void addCondition(String condition) { throw new UnsupportedOperationException(); } } --- NEW FILE: JoinFragment.java --- //$Id: JoinFragment.java,v 1.1 2003/02/23 07:22:11 oneovthafew Exp $ package net.sf.hibernate.sql; public abstract class JoinFragment { public abstract void addJoin(String tableName, String alias, String[] fkColumns, String[] pkColumns, int joinType); public abstract void addCrossJoin(String tableName, String alias); public abstract void addJoins(String fromFragment, String whereFragment); public abstract String toFromFragmentString(); public abstract String toWhereFragmentString(); public abstract void addCondition(String alias, String[] columns, String condition); public abstract void addCondition(String alias, String[] fkColumns, String[] pkColumns); public abstract void addCondition(String condition); public abstract JoinFragment copy(); public static final int INNER_JOIN = 0; public static final int FULL_JOIN = -1; public static final int LEFT_OUTER_JOIN = 1; public static final int RIGHT_OUTER_JOIN = 2; public void addFragment(JoinFragment ojf) { addJoins( ojf.toFromFragmentString(), ojf.toWhereFragmentString() ); } } --- NEW FILE: OracleJoinFragment.java --- //$Id: OracleJoinFragment.java,v 1.1 2003/02/23 07:22:11 oneovthafew Exp $ package net.sf.hibernate.sql; import net.sf.hibernate.util.StringHelper; public class OracleJoinFragment extends JoinFragment { private StringBuffer afterFrom = new StringBuffer(); private StringBuffer afterWhere = new StringBuffer(); public void addJoin(String tableName, String alias, String[] fkColumns, String[] pkColumns, int joinType) { addCrossJoin(tableName, alias); for ( int j=0; j<fkColumns.length; j++) { afterWhere.append(" and ") .append( fkColumns[j] ); if (joinType==RIGHT_OUTER_JOIN || joinType==FULL_JOIN) afterWhere.append("(+)"); afterWhere.append('=') .append(alias) .append(StringHelper.DOT) .append( pkColumns[j] ); if (joinType==LEFT_OUTER_JOIN || joinType==FULL_JOIN) afterWhere.append("(+)"); } } public String toFromFragmentString() { return afterFrom.toString(); } public String toWhereFragmentString() { return afterWhere.toString(); } public void addJoins(String fromFragment, String whereFragment) { afterFrom.append(fromFragment); afterWhere.append(whereFragment); } public JoinFragment copy() { OracleJoinFragment copy = new OracleJoinFragment(); copy.afterFrom = new StringBuffer( afterFrom.toString() ); copy.afterWhere = new StringBuffer( afterWhere.toString() ); return copy; } public void addCondition(String alias, String[] columns, String condition) { for ( int i=0; i<columns.length; i++ ) { afterWhere.append(" and ") .append(alias) .append(StringHelper.DOT) .append( columns[i] ) .append(condition); } } public void addCrossJoin(String tableName, String alias) { afterFrom.append(StringHelper.COMMA_SPACE) .append(tableName) .append(' ') .append(alias); } public void addCondition( String alias, String[] fkColumns, String[] pkColumns) { throw new UnsupportedOperationException(); } public void addCondition(String condition) { afterWhere.append(condition); } } --- NEW FILE: QueryJoinFragment.java --- //$Id: QueryJoinFragment.java,v 1.1 2003/02/23 07:22:11 oneovthafew Exp $ package net.sf.hibernate.sql; import net.sf.hibernate.util.StringHelper; public class QueryJoinFragment extends JoinFragment { private StringBuffer afterFrom = new StringBuffer(); private StringBuffer afterWhere = new StringBuffer(); public void addJoin(String tableName, String alias, String[] fkColumns, String[] pkColumns, int joinType) { addCrossJoin(tableName, alias); addCondition(alias, fkColumns, pkColumns); } public String toFromFragmentString() { return afterFrom.toString(); } public String toWhereFragmentString() { return afterWhere.toString(); } public void addJoins(String fromFragment, String whereFragment) { afterFrom.append(fromFragment); afterWhere.append(whereFragment); } public JoinFragment copy() { QueryJoinFragment copy = new QueryJoinFragment(); copy.afterFrom = new StringBuffer( afterFrom.toString() ); copy.afterWhere = new StringBuffer( afterWhere.toString() ); return copy; } public void addCondition(String alias, String[] columns, String condition) { for ( int i=0; i<columns.length; i++ ) { afterWhere.append(" and ") .append(alias) .append(StringHelper.DOT) .append( columns[i] ) .append(condition); } } public void addCrossJoin(String tableName, String alias) { afterFrom.append(StringHelper.COMMA_SPACE) .append(tableName) .append(' ') .append(alias); } public void addCondition(String alias, String[] fkColumns, String[] pkColumns) { for ( int j=0; j<fkColumns.length; j++) { afterWhere.append(" and ") .append( fkColumns[j] ) .append('=') .append(alias) .append(StringHelper.DOT) .append( pkColumns[j] ); } } public void addCondition(String condition) { afterWhere.append(condition); } } --- ANSIOuterJoinFragment.java DELETED --- --- OracleOuterJoinFragment.java DELETED --- --- OuterJoinFragment.java DELETED --- --- QueryOuterJoinFragment.java DELETED --- |
From: <one...@us...> - 2003-02-23 07:22:15
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv25986/test Modified Files: FooBarTest.java Log Message: continued refactoring of hql package Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBarTest.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** FooBarTest.java 23 Feb 2003 01:32:21 -0000 1.25 --- FooBarTest.java 23 Feb 2003 07:22:11 -0000 1.26 *************** *** 907,910 **** --- 907,915 ---- assertTrue( list.size()==2, "component query" ); s.find("from foo in class Foo where not exists (from bar in class Bar where bar.id = foo.id)"); + + s.find("select foo.foo from foo in class Foo where foo = some(select x from x in class Foo where x.long > foo.foo.long)"); + s.find("from foo in class Foo where foo = some(select x from x in class Foo where x.long > foo.foo.long) and foo.foo.string='baz'"); + s.find("from foo in class Foo where foo.foo.string='baz' and foo = some(select x from x in class Foo where x.long > foo.foo.long)"); + s.find("from foo in class Foo where foo = some(select x from x in class Foo where x.long > foo.foo.long)"); s.iterate("select foo.string, foo.date, foo.foo.string, foo.id from foo in class Foo, baz in class Baz where foo in baz.fooArray.elements and foo.string like 'foo'"); |
From: <one...@us...> - 2003-02-23 07:22:14
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql In directory sc8-pr-cvs1:/tmp/cvs-serv25986/hql Modified Files: FromParser.java PathExpressionParser.java QueryTranslator.java WhereParser.java Log Message: continued refactoring of hql package Index: FromParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/FromParser.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FromParser.java 23 Feb 2003 01:32:20 -0000 1.5 --- FromParser.java 23 Feb 2003 07:22:11 -0000 1.6 *************** *** 7,12 **** import net.sf.hibernate.QueryException; import net.sf.hibernate.persister.Loadable; ! import net.sf.hibernate.sql.OuterJoinFragment; ! import net.sf.hibernate.sql.QueryOuterJoinFragment; import net.sf.hibernate.util.StringHelper; --- 7,12 ---- import net.sf.hibernate.QueryException; import net.sf.hibernate.persister.Loadable; ! import net.sf.hibernate.sql.JoinFragment; ! import net.sf.hibernate.sql.QueryJoinFragment; import net.sf.hibernate.util.StringHelper; *************** *** 75,79 **** if (fromClass) { Loadable p = q.getPersisterUsingImports(token); ! OuterJoinFragment ojf = new QueryOuterJoinFragment(); ojf.addCrossJoin( p.getTableName(), name ); q.addFromType( name, p.getMappedClass(), ojf ); --- 75,79 ---- if (fromClass) { Loadable p = q.getPersisterUsingImports(token); ! JoinFragment ojf = new QueryJoinFragment(); ojf.addCrossJoin( p.getTableName(), name ); q.addFromType( name, p.getMappedClass(), ojf ); *************** *** 82,86 **** peParser.presetCollectionName(name); ParserHelper.parse(peParser, token, ParserHelper.PATH_SEPERATORS, q); ! peParser.addFromCollection(q, name, OuterJoinFragment.INNER_JOIN); } name = null; --- 82,86 ---- peParser.presetCollectionName(name); ParserHelper.parse(peParser, token, ParserHelper.PATH_SEPERATORS, q); ! peParser.addFromCollection(q, name, JoinFragment.INNER_JOIN); } name = null; Index: PathExpressionParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/PathExpressionParser.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PathExpressionParser.java 23 Feb 2003 01:32:20 -0000 1.7 --- PathExpressionParser.java 23 Feb 2003 07:22:11 -0000 1.8 *************** *** 10,15 **** import net.sf.hibernate.persister.Loadable; import net.sf.hibernate.persister.Queryable; ! import net.sf.hibernate.sql.OuterJoinFragment; ! import net.sf.hibernate.sql.QueryOuterJoinFragment; import net.sf.hibernate.type.EntityType; import net.sf.hibernate.type.PersistentCollectionType; --- 10,15 ---- import net.sf.hibernate.persister.Loadable; import net.sf.hibernate.persister.Queryable; ! import net.sf.hibernate.sql.JoinFragment; ! import net.sf.hibernate.sql.QueryJoinFragment; import net.sf.hibernate.type.EntityType; import net.sf.hibernate.type.PersistentCollectionType; *************** *** 36,40 **** protected String currentName; protected String currentProperty; ! protected OuterJoinFragment join; protected String[] columns; protected String[] collectionElementColumns; --- 36,40 ---- protected String currentName; protected String currentProperty; ! protected JoinFragment join; protected String[] columns; protected String[] collectionElementColumns; *************** *** 56,60 **** private void addJoin(String table, String name, String[] rhsCols, QueryTranslator q) throws QueryException { String[] lhsCols = currentColumns(q); ! join.addJoin(table, name, lhsCols, rhsCols, OuterJoinFragment.INNER_JOIN); } --- 56,60 ---- private void addJoin(String table, String name, String[] rhsCols, QueryTranslator q) throws QueryException { String[] lhsCols = currentColumns(q); ! join.addJoin(table, name, lhsCols, rhsCols, JoinFragment.INNER_JOIN); } *************** *** 65,69 **** q.addType(currentName, clazz); Loadable p = q.getPersister(clazz); ! join.addJoin( p.getTableName(), currentName, joinColumns, p.getIdentifierColumnNames(), OuterJoinFragment.INNER_JOIN ); return currentName; } --- 65,69 ---- q.addType(currentName, clazz); Loadable p = q.getPersister(clazz); ! join.addJoin( p.getTableName(), currentName, joinColumns, p.getIdentifierColumnNames(), JoinFragment.INNER_JOIN ); return currentName; } *************** *** 77,85 **** reset(); //reset the dotcount (but not the path) currentName = alias; //after reset! ! OuterJoinFragment ojf = q.getPathJoin(path); ! join.addJoins( ! StringHelper.EMPTY_STRING, //ojf.toFromFragmentString(), ! ojf.toWhereFragmentString() ! ); //after reset! } else if ( ".".equals(token) ) { --- 77,82 ---- reset(); //reset the dotcount (but not the path) currentName = alias; //after reset! ! JoinFragment ojf = q.getPathJoin(path); ! join.addCondition( ojf.toWhereFragmentString() ); //after reset! } else if ( ".".equals(token) ) { *************** *** 220,224 **** private void reset() { ! join = new QueryOuterJoinFragment(); dotcount=0; currentName=null; --- 217,221 ---- private void reset() { ! join = new QueryJoinFragment(); dotcount=0; currentName=null; *************** *** 287,291 **** q.addCollection(collectionName, collectionRole); ! OuterJoinFragment ojf = new QueryOuterJoinFragment(); ojf.addCrossJoin( memberPersister.getQualifiedTableName(), collectionName ); q.addJoin(collectionName, ojf); --- 284,288 ---- q.addCollection(collectionName, collectionRole); ! JoinFragment ojf = new QueryJoinFragment(); ojf.addCrossJoin( memberPersister.getQualifiedTableName(), collectionName ); q.addJoin(collectionName, ojf); *************** *** 308,312 **** String alias; String[] elementColumns; ! OuterJoinFragment join; StringBuffer indexValue = new StringBuffer(); } --- 305,309 ---- String alias; String[] elementColumns; ! JoinFragment join; StringBuffer indexValue = new StringBuffer(); } *************** *** 331,335 **** } ! public OuterJoinFragment getWhereJoin() { return join; } --- 328,332 ---- } ! public JoinFragment getWhereJoin() { return join; } Index: QueryTranslator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/QueryTranslator.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** QueryTranslator.java 23 Feb 2003 01:32:20 -0000 1.11 --- QueryTranslator.java 23 Feb 2003 07:22:11 -0000 1.12 *************** *** 32,37 **** import net.sf.hibernate.persister.Loadable; import net.sf.hibernate.persister.Queryable; ! import net.sf.hibernate.sql.OuterJoinFragment; ! import net.sf.hibernate.sql.QueryOuterJoinFragment; import net.sf.hibernate.type.EntityType; import net.sf.hibernate.type.Type; --- 32,37 ---- import net.sf.hibernate.persister.Loadable; import net.sf.hibernate.persister.Queryable; ! import net.sf.hibernate.sql.JoinFragment; ! import net.sf.hibernate.sql.QueryJoinFragment; import net.sf.hibernate.type.EntityType; import net.sf.hibernate.type.Type; *************** *** 83,87 **** private List returnTypes = new ArrayList(); private final List fromTypes = new ArrayList(); - private final Map fromJoins = new HashMap(); private final List scalarTypes = new ArrayList(); private final Map namedParameters = new HashMap(); --- 83,86 ---- *************** *** 281,294 **** } - Queryable getEntityPersisterForName(String name) throws QueryException { - Class type = getType(name); - if (type==null) { - return null; - } - else { - return getPersister(type); - } - } - Queryable getPersisterForName(String name) throws QueryException { Class type = getType(name); --- 280,283 ---- *************** *** 347,355 **** } ! void addFromType(String name, Class type, OuterJoinFragment join) { addType(name, type); fromTypes.add(name); ! fromJoins.put(name, join); ! //addJoin(join); //TODO: remove this!! } --- 336,343 ---- } ! void addFromType(String name, Class type, JoinFragment join) { addType(name, type); fromTypes.add(name); ! addJoin(name, join); } *************** *** 386,390 **** } ! void addJoin(String name, OuterJoinFragment newjoin) { if ( !joins.containsKey(name) ) { joins.put(name, newjoin); --- 374,378 ---- } ! void addJoin(String name, JoinFragment newjoin) { if ( !joins.containsKey(name) ) { joins.put(name, newjoin); *************** *** 452,460 **** String outerJoinedProperties=null; ! OuterJoinFragment outerjoin=null; String selectProperties; String selectIdentifiers; ! if (false) { ! //if ( !isShallowQuery() && returnTypes.size()==1 && typeMap.size()==1 ) { OuterJoinLoader ojl = new OuterJoinLoader( factory.getDialect() ); String name = (String) returnTypes.get(0); --- 440,447 ---- String outerJoinedProperties=null; ! JoinFragment outerjoin=null; String selectProperties; String selectIdentifiers; ! if ( !isShallowQuery() && returnTypes.size()==1 && typeMap.size()==1 ) { OuterJoinLoader ojl = new OuterJoinLoader( factory.getDialect() ); String name = (String) returnTypes.get(0); *************** *** 499,506 **** if ( outerJoinedProperties!=null && outerJoinedProperties.length() > 0 ) selectPropertiesString += ", " + outerJoinedProperties; //TODO: for some dialiects it would be appropriate to add the renderOrderByPropertiesSelect() to other select strings ! OuterJoinFragment mergedJoins = mergeJoins(outerjoin); ! fromWhereString = " FROM" + mergedJoins.toFromFragmentString().substring(1) + renderWhereClause(mergedJoins, outerjoin); ! ! //System.out.println( ">>>> " + renderFromClause(outerjoin) ); if ( scalarTypes.size()!=size ) { --- 486,491 ---- if ( outerJoinedProperties!=null && outerJoinedProperties.length() > 0 ) selectPropertiesString += ", " + outerJoinedProperties; //TODO: for some dialiects it would be appropriate to add the renderOrderByPropertiesSelect() to other select strings ! JoinFragment mergedJoins = mergeJoins(outerjoin); ! fromWhereString = " FROM" + mergedJoins.toFromFragmentString().substring(1) + renderWhereClause(mergedJoins); if ( scalarTypes.size()!=size ) { *************** *** 645,650 **** } ! private OuterJoinFragment mergeJoins(OuterJoinFragment outerjoin) throws MappingException, QueryException { ! OuterJoinFragment ojf = new QueryOuterJoinFragment(); //classes --- 630,635 ---- } ! private JoinFragment mergeJoins(JoinFragment outerjoin) throws MappingException, QueryException { ! JoinFragment ojf = new QueryJoinFragment(); //classes *************** *** 655,659 **** boolean includeSubclasses = returnTypes.contains(name) && !isShallowQuery(); ! OuterJoinFragment join = (OuterJoinFragment) fromJoins.get(name); if (join!=null) { ojf.addFragment(join); --- 640,644 ---- boolean includeSubclasses = returnTypes.contains(name) && !isShallowQuery(); ! JoinFragment join = (JoinFragment) joins.get(name); if (join!=null) { ojf.addFragment(join); *************** *** 667,683 **** // add any outerjoins required for association fetching // TODO: (need to move inside loop, eventually) ! if (outerjoin!=null) ojf.addJoins( outerjoin.toFromFragmentString(), StringHelper.EMPTY_STRING ); ! iter = joins.entrySet().iterator(); while ( iter.hasNext() ) { ! Map.Entry e = (Map.Entry) iter.next(); ! String name = (String) e.getKey(); ! if ( !fromJoins.containsKey(name) ) { //TODO: I hate this.... ! ojf.addFragment( (OuterJoinFragment) e.getValue() ); ! Queryable p = getEntityPersisterForName(name); ! if (p!=null) { ! ojf.addJoins( p.fromJoinFragment(name, true, false), StringHelper.EMPTY_STRING ); ! } ! } } --- 652,661 ---- // add any outerjoins required for association fetching // TODO: (need to move inside loop, eventually) ! if (outerjoin!=null) ojf.addFragment(outerjoin); ! iter = collections.keySet().iterator(); while ( iter.hasNext() ) { ! JoinFragment collJoin = (JoinFragment) joins.get( (String) iter.next() ); ! if (collJoin!=null) ojf.addFragment(collJoin); } *************** *** 685,723 **** } ! /*private String renderFromClause(OuterJoinFragment outerjoin) throws QueryException, MappingException { ! //FROM ! StringBuffer buf = new StringBuffer(120) ! .append(" FROM"); ! Iterator iter = typeMap.keySet().iterator(); ! while ( iter.hasNext() ) { ! //render the " foo_table foo," bit ! String name = (String) iter.next(); ! Queryable p = getPersisterForName(name); ! boolean includeSubclasses = returnTypes.contains(name) && !isShallowQuery(); ! buf.append(' ') ! .append( p.fromTableFragment(name) ) ! .append( p.fromJoinFragment(name, true, includeSubclasses) ); ! if ( iter.hasNext() || collections.size()!=0 ) buf.append(','); ! } ! ! // add any outerjoins required for association fetching ! // TODO: (need to move inside loop, eventually) ! if (outerjoin!=null) buf.append( outerjoin.toFromFragmentString() ); ! ! iter = collections.entrySet().iterator(); ! while ( iter.hasNext() ) { ! buf.append(' '); ! Map.Entry entry = (Map.Entry) iter.next(); ! String name = (String) entry.getKey(); ! String role = (String) entry.getValue(); ! CollectionPersister p = getCollectionPersister(role); ! buf.append( p.getQualifiedTableName() ).append(' ').append(name); ! if ( iter.hasNext() ) buf.append(','); ! } ! ! return buf.toString(); ! }*/ ! ! private String renderWhereClause(OuterJoinFragment mergedJoins, OuterJoinFragment outerjoin) throws QueryException, MappingException { //SET UP IDENTIFIER SPACES. TODO: move elsewhere! --- 663,667 ---- } ! private String renderWhereClause(JoinFragment mergedJoins) throws QueryException, MappingException { //SET UP IDENTIFIER SPACES. TODO: move elsewhere! *************** *** 730,743 **** } - // add any outerjoins required for fetching associations - // TODO: (need to move inside loop, eventually) - String part1; - if (outerjoin!=null) { - part1 = outerjoin.toWhereFragmentString().substring(5); //remove the leading " and " - } - else { - part1=""; - } - StringBuffer buf = new StringBuffer(120); --- 674,677 ---- *************** *** 748,763 **** String part3 = whereTokenBuf.toString().trim(); - boolean hasPart1 = part1.length()!=0; boolean hasPart2 = part2.length()!=0; boolean hasPart3 = part3.length()!=0; ! if ( hasPart1 || hasPart2 || hasPart3 ) buf.append(" WHERE "); ! if ( hasPart1 ) buf.append(part1); ! if ( hasPart1 && hasPart2 ) buf.append(" AND "); ! if ( hasPart2 ) buf.append( part2.substring(5) ); //remove leading "and " ! if ( hasPart3 ) { ! if ( hasPart1 || hasPart2 ) buf.append(" AND ("); buf.append(part3); ! if ( hasPart1 || hasPart2 ) buf.append(')'); } --- 682,694 ---- String part3 = whereTokenBuf.toString().trim(); boolean hasPart2 = part2.length()!=0; boolean hasPart3 = part3.length()!=0; ! if (hasPart2 || hasPart3) buf.append(" WHERE "); ! if (hasPart2) buf.append( part2.substring(5) ); //remove leading "and " ! if (hasPart3) { ! if (hasPart2) buf.append(" AND ("); buf.append(part3); ! if (hasPart2) buf.append(')'); } *************** *** 835,839 **** if (keyColumnNames.length!=1) throw new QueryException("composite-key collection in filter: " + collectionRole); ! OuterJoinFragment join = new QueryOuterJoinFragment(); if ( persister.isOneToMany() ) { join.addCrossJoin( persister.getQualifiedTableName(), elementName ); --- 766,770 ---- if (keyColumnNames.length!=1) throw new QueryException("composite-key collection in filter: " + collectionRole); ! JoinFragment join = new QueryJoinFragment(); if ( persister.isOneToMany() ) { join.addCrossJoin( persister.getQualifiedTableName(), elementName ); *************** *** 854,858 **** StringHelper.prefix(eltColumnNames, collectionName + StringHelper.DOT), idColumnNames, ! OuterJoinFragment.INNER_JOIN ); } --- 785,789 ---- StringHelper.prefix(eltColumnNames, collectionName + StringHelper.DOT), idColumnNames, ! JoinFragment.INNER_JOIN ); } *************** *** 869,877 **** } ! OuterJoinFragment getPathJoin(String path) { ! return (OuterJoinFragment) pathJoins.get(path); } ! void addPathAliasAndJoin(String path, String alias, OuterJoinFragment join) { pathAliases.put(path, alias); pathJoins.put( path, join.copy() ); --- 800,808 ---- } ! JoinFragment getPathJoin(String path) { ! return (JoinFragment) pathJoins.get(path); } ! void addPathAliasAndJoin(String path, String alias, JoinFragment join) { pathAliases.put(path, alias); pathJoins.put( path, join.copy() ); Index: WhereParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/WhereParser.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** WhereParser.java 23 Feb 2003 01:32:20 -0000 1.5 --- WhereParser.java 23 Feb 2003 07:22:11 -0000 1.6 *************** *** 14,19 **** import net.sf.hibernate.util.StringHelper; import net.sf.hibernate.persister.Queryable; ! import net.sf.hibernate.sql.OuterJoinFragment; ! import net.sf.hibernate.sql.QueryOuterJoinFragment; import net.sf.hibernate.type.EntityType; import net.sf.hibernate.type.LiteralType; --- 14,19 ---- import net.sf.hibernate.util.StringHelper; import net.sf.hibernate.persister.Queryable; ! import net.sf.hibernate.sql.JoinFragment; ! import net.sf.hibernate.sql.QueryJoinFragment; import net.sf.hibernate.type.EntityType; import net.sf.hibernate.type.LiteralType; *************** *** 371,376 **** } else { ! OuterJoinFragment ojf = pathExpressionParser.getWhereJoin(); ! OuterJoinFragment fromClause = new QueryOuterJoinFragment(); fromClause.addJoins( ojf.toFromFragmentString(), StringHelper.EMPTY_STRING ); q.addJoin( pathExpressionParser.getName(), fromClause ); --- 371,376 ---- } else { ! JoinFragment ojf = pathExpressionParser.getWhereJoin(); ! JoinFragment fromClause = new QueryJoinFragment(); fromClause.addJoins( ojf.toFromFragmentString(), StringHelper.EMPTY_STRING ); q.addJoin( pathExpressionParser.getName(), fromClause ); |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader In directory sc8-pr-cvs1:/tmp/cvs-serv25986/loader Modified Files: CollectionLoader.java EntityLoader.java OneToManyLoader.java OuterJoinLoader.java Log Message: continued refactoring of hql package Index: CollectionLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/CollectionLoader.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CollectionLoader.java 15 Feb 2003 01:00:53 -0000 1.9 --- CollectionLoader.java 23 Feb 2003 07:22:11 -0000 1.10 *************** *** 14,18 **** import net.sf.hibernate.persister.Loadable; import net.sf.hibernate.sql.ConditionFragment; ! import net.sf.hibernate.sql.OuterJoinFragment; import net.sf.hibernate.sql.Select; import net.sf.hibernate.type.Type; --- 14,18 ---- import net.sf.hibernate.persister.Loadable; import net.sf.hibernate.sql.ConditionFragment; ! import net.sf.hibernate.sql.JoinFragment; import net.sf.hibernate.sql.Select; import net.sf.hibernate.type.Type; *************** *** 47,51 **** for ( int i=0; i<joins; i++ ) suffixes[i] = Integer.toString(i) + StringHelper.UNDERSCORE; ! OuterJoinFragment ojf = outerJoins(associations); Select select = new Select() .setSelectClause( --- 47,51 ---- for ( int i=0; i<joins; i++ ) suffixes[i] = Integer.toString(i) + StringHelper.UNDERSCORE; ! JoinFragment ojf = outerJoins(associations); Select select = new Select() .setSelectClause( Index: EntityLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/EntityLoader.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** EntityLoader.java 1 Feb 2003 12:22:35 -0000 1.10 --- EntityLoader.java 23 Feb 2003 07:22:11 -0000 1.11 *************** *** 13,17 **** import net.sf.hibernate.persister.Loadable; import net.sf.hibernate.sql.ConditionFragment; ! import net.sf.hibernate.sql.OuterJoinFragment; import net.sf.hibernate.sql.Select; import net.sf.hibernate.type.Type; --- 13,17 ---- import net.sf.hibernate.persister.Loadable; import net.sf.hibernate.sql.ConditionFragment; ! import net.sf.hibernate.sql.JoinFragment; import net.sf.hibernate.sql.Select; import net.sf.hibernate.type.Type; *************** *** 41,45 **** for ( int i=0; i<=joins; i++ ) suffixes[i] = (joins==0) ? StringHelper.EMPTY_STRING : Integer.toString(i) + StringHelper.UNDERSCORE; ! OuterJoinFragment ojf = outerJoins(associations); sql = new Select() .setSelectClause( --- 41,45 ---- for ( int i=0; i<=joins; i++ ) suffixes[i] = (joins==0) ? StringHelper.EMPTY_STRING : Integer.toString(i) + StringHelper.UNDERSCORE; ! JoinFragment ojf = outerJoins(associations); sql = new Select() .setSelectClause( Index: OneToManyLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/OneToManyLoader.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** OneToManyLoader.java 15 Feb 2003 01:00:54 -0000 1.10 --- OneToManyLoader.java 23 Feb 2003 07:22:11 -0000 1.11 *************** *** 14,18 **** import net.sf.hibernate.persister.Loadable; import net.sf.hibernate.sql.ConditionFragment; ! import net.sf.hibernate.sql.OuterJoinFragment; import net.sf.hibernate.sql.Select; import net.sf.hibernate.type.EntityType; --- 14,18 ---- import net.sf.hibernate.persister.Loadable; import net.sf.hibernate.sql.ConditionFragment; ! import net.sf.hibernate.sql.JoinFragment; import net.sf.hibernate.sql.Select; import net.sf.hibernate.type.EntityType; *************** *** 55,59 **** for ( int i=0; i<=joins; i++ ) suffixes[i] = (joins==0) ? StringHelper.EMPTY_STRING : Integer.toString(i) + StringHelper.UNDERSCORE; ! OuterJoinFragment ojf = outerJoins(associations); Select select = new Select() .setSelectClause( --- 55,59 ---- for ( int i=0; i<=joins; i++ ) suffixes[i] = (joins==0) ? StringHelper.EMPTY_STRING : Integer.toString(i) + StringHelper.UNDERSCORE; ! JoinFragment ojf = outerJoins(associations); Select select = new Select() .setSelectClause( Index: OuterJoinLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/OuterJoinLoader.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** OuterJoinLoader.java 23 Feb 2003 01:32:20 -0000 1.12 --- OuterJoinLoader.java 23 Feb 2003 07:22:11 -0000 1.13 *************** *** 15,19 **** import net.sf.hibernate.persister.Loadable; import net.sf.hibernate.persister.NormalizedEntityPersister; ! import net.sf.hibernate.sql.OuterJoinFragment; import net.sf.hibernate.type.AbstractComponentType; import net.sf.hibernate.type.EntityType; --- 15,19 ---- import net.sf.hibernate.persister.Loadable; import net.sf.hibernate.persister.NormalizedEntityPersister; ! import net.sf.hibernate.sql.JoinFragment; import net.sf.hibernate.type.AbstractComponentType; import net.sf.hibernate.type.EntityType; *************** *** 249,254 **** * Generate a sequence of <tt>LEFT OUTER JOIN</tt> clauses for the given associations. */ ! public final OuterJoinFragment outerJoins(List associations) { ! OuterJoinFragment outerjoin = dialect.createOuterJoinFragment(); Iterator iter = associations.iterator(); while ( iter.hasNext() ) { --- 249,254 ---- * Generate a sequence of <tt>LEFT OUTER JOIN</tt> clauses for the given associations. */ ! public final JoinFragment outerJoins(List associations) { ! JoinFragment outerjoin = dialect.createOuterJoinFragment(); Iterator iter = associations.iterator(); while ( iter.hasNext() ) { *************** *** 259,263 **** oj.foreignKeyColumns, oj.subpersister.getIdentifierColumnNames(), ! OuterJoinFragment.LEFT_OUTER_JOIN ); outerjoin.addJoins( --- 259,263 ---- oj.foreignKeyColumns, oj.subpersister.getIdentifierColumnNames(), ! JoinFragment.LEFT_OUTER_JOIN ); outerjoin.addJoins( |
From: <one...@us...> - 2003-02-23 07:22:14
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect In directory sc8-pr-cvs1:/tmp/cvs-serv25986/dialect Modified Files: Dialect.java OracleDialect.java SAPDBDialect.java Log Message: continued refactoring of hql package Index: Dialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/Dialect.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Dialect.java 1 Feb 2003 12:22:35 -0000 1.7 --- Dialect.java 23 Feb 2003 07:22:11 -0000 1.8 *************** *** 9,15 **** import net.sf.hibernate.cfg.Environment; import net.sf.hibernate.sql.ANSICaseFragment; ! import net.sf.hibernate.sql.ANSIOuterJoinFragment; import net.sf.hibernate.sql.CaseFragment; ! import net.sf.hibernate.sql.OuterJoinFragment; import net.sf.hibernate.util.ReflectHelper; import net.sf.hibernate.util.StringHelper; --- 9,15 ---- import net.sf.hibernate.cfg.Environment; import net.sf.hibernate.sql.ANSICaseFragment; ! import net.sf.hibernate.sql.ANSIJoinFragment; import net.sf.hibernate.sql.CaseFragment; ! import net.sf.hibernate.sql.JoinFragment; import net.sf.hibernate.util.ReflectHelper; import net.sf.hibernate.util.StringHelper; *************** *** 323,328 **** * @return OuterJoinGenerator */ ! public OuterJoinFragment createOuterJoinFragment() { ! return new ANSIOuterJoinFragment(); } --- 323,328 ---- * @return OuterJoinGenerator */ ! public JoinFragment createOuterJoinFragment() { ! return new ANSIJoinFragment(); } Index: OracleDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/OracleDialect.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** OracleDialect.java 1 Feb 2003 12:22:35 -0000 1.7 --- OracleDialect.java 23 Feb 2003 07:22:11 -0000 1.8 *************** *** 4,9 **** import net.sf.hibernate.sql.CaseFragment; import net.sf.hibernate.sql.DecodeCaseFragment; ! import net.sf.hibernate.sql.OracleOuterJoinFragment; ! import net.sf.hibernate.sql.OuterJoinFragment; /** --- 4,9 ---- import net.sf.hibernate.sql.CaseFragment; import net.sf.hibernate.sql.DecodeCaseFragment; ! import net.sf.hibernate.sql.OracleJoinFragment; ! import net.sf.hibernate.sql.JoinFragment; /** *************** *** 15,20 **** super(); } ! public OuterJoinFragment createOuterJoinFragment() { ! return new OracleOuterJoinFragment(); } public CaseFragment createCaseFragment() { --- 15,20 ---- super(); } ! public JoinFragment createOuterJoinFragment() { ! return new OracleJoinFragment(); } public CaseFragment createCaseFragment() { Index: SAPDBDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/SAPDBDialect.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SAPDBDialect.java 1 Feb 2003 12:22:35 -0000 1.7 --- SAPDBDialect.java 23 Feb 2003 07:22:11 -0000 1.8 *************** *** 8,13 **** import net.sf.hibernate.sql.CaseFragment; import net.sf.hibernate.sql.DecodeCaseFragment; ! import net.sf.hibernate.sql.OracleOuterJoinFragment; ! import net.sf.hibernate.sql.OuterJoinFragment; import net.sf.hibernate.util.StringHelper; --- 8,13 ---- import net.sf.hibernate.sql.CaseFragment; import net.sf.hibernate.sql.DecodeCaseFragment; ! import net.sf.hibernate.sql.OracleJoinFragment; ! import net.sf.hibernate.sql.JoinFragment; import net.sf.hibernate.util.StringHelper; *************** *** 92,97 **** } ! public OuterJoinFragment createOuterJoinFragment() { ! return new OracleOuterJoinFragment(); } --- 92,97 ---- } ! public JoinFragment createOuterJoinFragment() { ! return new OracleJoinFragment(); } |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql In directory sc8-pr-cvs1:/tmp/cvs-serv11798/sf/hibernate/sql Modified Files: ANSIOuterJoinFragment.java OracleOuterJoinFragment.java OuterJoinFragment.java Added Files: QueryOuterJoinFragment.java Log Message: refactored hql package (incomplete) --- NEW FILE: QueryOuterJoinFragment.java --- //$Id: QueryOuterJoinFragment.java,v 1.1 2003/02/23 01:32:21 oneovthafew Exp $ package net.sf.hibernate.sql; import net.sf.hibernate.util.StringHelper; public class QueryOuterJoinFragment extends OuterJoinFragment { private StringBuffer afterFrom = new StringBuffer(); private StringBuffer afterWhere = new StringBuffer(); public void addJoin(String tableName, String alias, String[] fkColumns, String[] pkColumns, int joinType) { addCrossJoin(tableName, alias); addCondition(alias, fkColumns, pkColumns); } public String toFromFragmentString() { return afterFrom.toString(); } public String toWhereFragmentString() { return afterWhere.toString(); } public void addJoins(String fromFragment, String whereFragment) { afterFrom.append(fromFragment); afterWhere.append(whereFragment); } public OuterJoinFragment copy() { QueryOuterJoinFragment copy = new QueryOuterJoinFragment(); copy.afterFrom = new StringBuffer( afterFrom.toString() ); copy.afterWhere = new StringBuffer( afterWhere.toString() ); return copy; } public void addCondition(String alias, String[] columns, String condition) { for ( int i=0; i<columns.length; i++ ) { afterWhere.append(" and ") .append(alias) .append(StringHelper.DOT) .append( columns[i] ) .append(condition); } } public void addCrossJoin(String tableName, String alias) { afterFrom.append(StringHelper.COMMA_SPACE) .append(tableName) .append(' ') .append(alias); } public void addCondition(String alias, String[] fkColumns, String[] pkColumns) { for ( int j=0; j<fkColumns.length; j++) { afterWhere.append(" and ") .append( fkColumns[j] ) .append('=') .append(alias) .append(StringHelper.DOT) .append( pkColumns[j] ); } } } Index: ANSIOuterJoinFragment.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql/ANSIOuterJoinFragment.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ANSIOuterJoinFragment.java 24 Jan 2003 10:21:37 -0000 1.2 --- ANSIOuterJoinFragment.java 23 Feb 2003 01:32:21 -0000 1.3 *************** *** 8,15 **** private StringBuffer buffer = new StringBuffer(); ! public void addJoin(String tableName, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin) { ! ! buffer.append( innerJoin ? " inner join " : " left outer join ") .append(tableName) .append(' ') --- 8,34 ---- private StringBuffer buffer = new StringBuffer(); + private StringBuffer conditions = new StringBuffer(); ! public void addJoin(String tableName, String alias, String[] fkColumns, String[] pkColumns, int joinType) { ! ! String joinString; ! switch (joinType) { ! case INNER_JOIN: ! joinString = " inner join "; ! break; ! case LEFT_OUTER_JOIN: ! joinString = " left outer join "; ! break; ! case RIGHT_OUTER_JOIN: ! joinString = " right outer join "; ! break; ! case FULL_JOIN: ! joinString = " full outer join "; ! break; ! default: ! throw new AssertionFailure("undefined join type"); ! } ! ! buffer.append(joinString) .append(tableName) .append(' ') *************** *** 34,38 **** public String toWhereFragmentString() { ! return StringHelper.EMPTY_STRING; } --- 53,57 ---- public String toWhereFragmentString() { ! return conditions.toString(); } *************** *** 40,43 **** --- 59,94 ---- buffer.append(fromFragment); //where fragment must be empty! + } + + public OuterJoinFragment copy() { + ANSIOuterJoinFragment copy = new ANSIOuterJoinFragment(); + copy.buffer = new StringBuffer( buffer.toString() ); + return copy; + } + + public void addCondition(String alias, String[] columns, String condition) { + for ( int i=0; i<columns.length; i++ ) { + conditions.append(" and ") + .append(alias) + .append(StringHelper.DOT) + .append( columns[i] ) + .append(condition); + } + } + + public void addCrossJoin(String tableName, String alias) { + buffer.append(StringHelper.COMMA_SPACE) + .append(tableName) + .append(' ') + .append(alias); + } + + public void addCondition( + String alias, + String[] fkColumns, + String[] pkColumns) { + + throw new UnsupportedOperationException(); + } Index: OracleOuterJoinFragment.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql/OracleOuterJoinFragment.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OracleOuterJoinFragment.java 20 Jan 2003 18:45:18 -0000 1.1 --- OracleOuterJoinFragment.java 23 Feb 2003 01:32:21 -0000 1.2 *************** *** 9,27 **** private StringBuffer afterWhere = new StringBuffer(); ! public void addJoin(String tableName, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin) { ! afterFrom.append(StringHelper.COMMA_SPACE) ! .append(tableName) ! .append(' ') ! .append(alias); for ( int j=0; j<fkColumns.length; j++) { afterWhere.append(" and ") ! .append( fkColumns[j] ) ! .append('=') .append(alias) .append(StringHelper.DOT) .append( pkColumns[j] ); ! if (!innerJoin) afterWhere.append("(+)"); } --- 9,25 ---- private StringBuffer afterWhere = new StringBuffer(); ! public void addJoin(String tableName, String alias, String[] fkColumns, String[] pkColumns, int joinType) { ! addCrossJoin(tableName, alias); for ( int j=0; j<fkColumns.length; j++) { afterWhere.append(" and ") ! .append( fkColumns[j] ); ! if (joinType==RIGHT_OUTER_JOIN || joinType==FULL_JOIN) afterWhere.append("(+)"); ! afterWhere.append('=') .append(alias) .append(StringHelper.DOT) .append( pkColumns[j] ); ! if (joinType==LEFT_OUTER_JOIN || joinType==FULL_JOIN) afterWhere.append("(+)"); } *************** *** 39,42 **** --- 37,73 ---- afterFrom.append(fromFragment); afterWhere.append(whereFragment); + } + + public OuterJoinFragment copy() { + OracleOuterJoinFragment copy = new OracleOuterJoinFragment(); + copy.afterFrom = new StringBuffer( afterFrom.toString() ); + copy.afterWhere = new StringBuffer( afterWhere.toString() ); + return copy; + } + + public void addCondition(String alias, String[] columns, String condition) { + for ( int i=0; i<columns.length; i++ ) { + afterWhere.append(" and ") + .append(alias) + .append(StringHelper.DOT) + .append( columns[i] ) + .append(condition); + } + } + + public void addCrossJoin(String tableName, String alias) { + afterFrom.append(StringHelper.COMMA_SPACE) + .append(tableName) + .append(' ') + .append(alias); + } + + public void addCondition( + String alias, + String[] fkColumns, + String[] pkColumns) { + + throw new UnsupportedOperationException(); + } Index: OuterJoinFragment.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql/OuterJoinFragment.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OuterJoinFragment.java 20 Jan 2003 18:45:18 -0000 1.1 --- OuterJoinFragment.java 23 Feb 2003 01:32:21 -0000 1.2 *************** *** 4,12 **** public abstract class OuterJoinFragment { ! public abstract void addJoin(String tableName, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin); public abstract void addJoins(String fromFragment, String whereFragment); public abstract String toFromFragmentString(); public abstract String toWhereFragmentString(); ! ! } --- 4,24 ---- public abstract class OuterJoinFragment { ! public abstract void addJoin(String tableName, String alias, String[] fkColumns, String[] pkColumns, int joinType); ! public abstract void addCrossJoin(String tableName, String alias); public abstract void addJoins(String fromFragment, String whereFragment); public abstract String toFromFragmentString(); public abstract String toWhereFragmentString(); ! public abstract void addCondition(String alias, String[] columns, String condition); ! public abstract void addCondition(String alias, String[] fkColumns, String[] pkColumns); ! ! public abstract OuterJoinFragment copy(); ! ! public static final int INNER_JOIN = 0; ! public static final int FULL_JOIN = -1; ! public static final int LEFT_OUTER_JOIN = 1; ! public static final int RIGHT_OUTER_JOIN = 2; ! ! public void addFragment(OuterJoinFragment ojf) { ! addJoins( ojf.toFromFragmentString(), ojf.toWhereFragmentString() ); ! } } |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql In directory sc8-pr-cvs1:/tmp/cvs-serv11798/sf/hibernate/hql Modified Files: FromParser.java GroupByParser.java OrderByParser.java PathExpressionParser.java QueryTranslator.java SelectParser.java WhereParser.java Log Message: refactored hql package (incomplete) Index: FromParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/FromParser.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FromParser.java 20 Jan 2003 12:48:10 -0000 1.4 --- FromParser.java 23 Feb 2003 01:32:20 -0000 1.5 *************** *** 2,6 **** --- 2,12 ---- package net.sf.hibernate.hql; + import java.util.HashSet; + import java.util.Set; + import net.sf.hibernate.QueryException; + import net.sf.hibernate.persister.Loadable; + import net.sf.hibernate.sql.OuterJoinFragment; + import net.sf.hibernate.sql.QueryOuterJoinFragment; import net.sf.hibernate.util.StringHelper; *************** *** 13,21 **** private boolean expectingIn; ! private boolean expectingComma; private boolean fromClass; private String name; private PathExpressionParser peParser = new PathExpressionParser(); public void token(String token, QueryTranslator q) throws QueryException { --- 19,36 ---- private boolean expectingIn; ! private boolean expectingJoin; ! private boolean expectingJoinToken; private boolean fromClass; + private String joinType; private String name; private PathExpressionParser peParser = new PathExpressionParser(); + private static final Set joinTokens = new HashSet(); + static { + joinTokens.add("left"); + joinTokens.add("right"); + joinTokens.add("full"); + } + public void token(String token, QueryTranslator q) throws QueryException { *************** *** 32,39 **** } } ! else if (expectingComma) { if ( token.equals(StringHelper.COMMA) ) { ! expectingComma = false; fromClass = false; } else { --- 47,65 ---- } } ! else if (expectingJoin) { if ( token.equals(StringHelper.COMMA) ) { ! expectingJoin = false; ! fromClass = false; ! joinType = StringHelper.COMMA; ! } ! else if ( lcToken.equals("join") ) { ! joinType += ' ' + lcToken; ! expectingJoin = false; fromClass = false; + expectingJoinToken=false; + } + else if ( joinTokens.contains(lcToken) ) { + joinType = ' ' + lcToken; + expectingJoinToken = true; } else { *************** *** 48,59 **** else { if (fromClass) { ! q.addFromType(name, token); } else { ParserHelper.parse(peParser, token, ParserHelper.PATH_SEPERATORS, q); ! peParser.addFromCollection(q, name); } name = null; ! expectingComma=true; } } --- 74,89 ---- else { if (fromClass) { ! Loadable p = q.getPersisterUsingImports(token); ! OuterJoinFragment ojf = new QueryOuterJoinFragment(); ! ojf.addCrossJoin( p.getTableName(), name ); ! q.addFromType( name, p.getMappedClass(), ojf ); } else { + peParser.presetCollectionName(name); ParserHelper.parse(peParser, token, ParserHelper.PATH_SEPERATORS, q); ! peParser.addFromCollection(q, name, OuterJoinFragment.INNER_JOIN); } name = null; ! expectingJoin=true; } } *************** *** 62,66 **** public void start(QueryTranslator q) { expectingIn = false; ! expectingComma = false; name = null; fromClass = false; --- 92,98 ---- public void start(QueryTranslator q) { expectingIn = false; ! expectingJoin = false; ! expectingJoinToken = false; ! joinType = null; name = null; fromClass = false; Index: GroupByParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/GroupByParser.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GroupByParser.java 5 Jan 2003 02:11:21 -0000 1.3 --- GroupByParser.java 23 Feb 2003 01:32:20 -0000 1.4 *************** *** 27,31 **** ParserHelper.parse(pathExpressionParser, token, ParserHelper.PATH_SEPERATORS, q); q.appendGroupByToken( pathExpressionParser.getWhereColumn() ); ! q.addJoin( pathExpressionParser.getWhereJoin() ); } else { --- 27,31 ---- ParserHelper.parse(pathExpressionParser, token, ParserHelper.PATH_SEPERATORS, q); q.appendGroupByToken( pathExpressionParser.getWhereColumn() ); ! q.addJoin( pathExpressionParser.getName(), pathExpressionParser.getWhereJoin() ); } else { Index: OrderByParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/OrderByParser.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OrderByParser.java 5 Jan 2003 02:11:21 -0000 1.3 --- OrderByParser.java 23 Feb 2003 01:32:20 -0000 1.4 *************** *** 26,30 **** ParserHelper.parse(pathExpressionParser, token, ParserHelper.PATH_SEPERATORS, q); q.appendOrderByToken( pathExpressionParser.getWhereColumn() ); ! q.addJoin( pathExpressionParser.getWhereJoin() ); } else { --- 26,30 ---- ParserHelper.parse(pathExpressionParser, token, ParserHelper.PATH_SEPERATORS, q); q.appendOrderByToken( pathExpressionParser.getWhereColumn() ); ! q.addJoin( pathExpressionParser.getName(), pathExpressionParser.getWhereJoin() ); } else { Index: PathExpressionParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/PathExpressionParser.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PathExpressionParser.java 20 Jan 2003 12:48:10 -0000 1.6 --- PathExpressionParser.java 23 Feb 2003 01:32:20 -0000 1.7 *************** *** 6,16 **** import net.sf.hibernate.Hibernate; import net.sf.hibernate.QueryException; - import net.sf.hibernate.util.StringHelper; import net.sf.hibernate.collection.CollectionPersister; - import net.sf.hibernate.persister.*; import net.sf.hibernate.persister.ClassPersister; ! import net.sf.hibernate.type.PersistentCollectionType; import net.sf.hibernate.type.EntityType; import net.sf.hibernate.type.Type; /** --- 6,19 ---- import net.sf.hibernate.Hibernate; import net.sf.hibernate.QueryException; import net.sf.hibernate.collection.CollectionPersister; import net.sf.hibernate.persister.ClassPersister; ! import net.sf.hibernate.persister.Loadable; ! import net.sf.hibernate.persister.Queryable; ! import net.sf.hibernate.sql.OuterJoinFragment; ! import net.sf.hibernate.sql.QueryOuterJoinFragment; import net.sf.hibernate.type.EntityType; + import net.sf.hibernate.type.PersistentCollectionType; import net.sf.hibernate.type.Type; + import net.sf.hibernate.util.StringHelper; /** *************** *** 33,37 **** protected String currentName; protected String currentProperty; ! protected StringBuffer join; protected String[] columns; protected String[] collectionElementColumns; --- 36,40 ---- protected String currentName; protected String currentProperty; ! protected OuterJoinFragment join; protected String[] columns; protected String[] collectionElementColumns; *************** *** 45,100 **** private boolean skippedId; private boolean continuation; ! private void addJoin(String name, String[] rhsCols, QueryTranslator q) throws QueryException { String[] lhsCols = currentColumns(q); ! for ( int i=0; i<rhsCols.length; i++) { ! join.append(" and ") ! .append( lhsCols[i] ) ! .append('=') ! .append(name) ! .append(StringHelper.DOT) ! .append( rhsCols[i] ); ! } } ! public String continueFromManyToMany(Class clazz, String[] joinColumns, QueryTranslator q) throws QueryException { start(q); continuation=true; currentName = q.createNameFor(clazz); ! q.addType( currentName, clazz.getName() ); ! ! for ( int i=0; i<joinColumns.length; i++ ) { ! join.append(" and ") ! .append( joinColumns[i] ) ! .append('=') ! .append(currentName) ! .append(StringHelper.DOT) ! .append( q.getPersister(clazz).getIdentifierColumnNames()[i] ); ! } return currentName; } - public String continueFromSubcollection(String role, String[] joinColumns, QueryTranslator q) throws QueryException { - start(q); - continuation=true; - collectionName = q.createNameForCollection(role); - collectionRole = role; - currentName=null; - currentProperty=null; - CollectionPersister p = q.getCollectionPersister(role); - collectionTable = p.getQualifiedTableName(); - - for ( int i=0; i<joinColumns.length; i++ ) { - join.append(" and ") - .append( joinColumns[i] ) - .append('=') - .append(collectionName) - .append(StringHelper.DOT) - .append( p.getKeyColumnNames()[i] ); - } - return collectionName; - } - - public void token(String token, QueryTranslator q) throws QueryException { --- 48,72 ---- private boolean skippedId; private boolean continuation; + private String presetCollectionName; ! void presetCollectionName(String name) { ! presetCollectionName=name; ! } ! ! private void addJoin(String table, String name, String[] rhsCols, QueryTranslator q) throws QueryException { String[] lhsCols = currentColumns(q); ! join.addJoin(table, name, lhsCols, rhsCols, OuterJoinFragment.INNER_JOIN); } ! String continueFromManyToMany(Class clazz, String[] joinColumns, QueryTranslator q) throws QueryException { start(q); continuation=true; currentName = q.createNameFor(clazz); ! q.addType(currentName, clazz); ! Loadable p = q.getPersister(clazz); ! join.addJoin( p.getTableName(), currentName, joinColumns, p.getIdentifierColumnNames(), OuterJoinFragment.INNER_JOIN ); return currentName; } public void token(String token, QueryTranslator q) throws QueryException { *************** *** 105,109 **** reset(); //reset the dotcount (but not the path) currentName = alias; //after reset! ! join.append( q.getPathJoin(path) ); //after reset! } else if ( ".".equals(token) ) { --- 77,85 ---- reset(); //reset the dotcount (but not the path) currentName = alias; //after reset! ! OuterJoinFragment ojf = q.getPathJoin(path); ! join.addJoins( ! StringHelper.EMPTY_STRING, //ojf.toFromFragmentString(), ! ojf.toWhereFragmentString() ! ); //after reset! } else if ( ".".equals(token) ) { *************** *** 167,176 **** String name = q.createNameFor(memberClass); ! q.addType( name, memberClass.getName() ); String[] keyColNames = memberPersister.getIdentifierColumnNames(); ! addJoin(name, keyColNames, q); currentName = name; currentProperty = token; ! q.addPathAliasAndJoin( path.substring( 0, path.lastIndexOf(StringHelper.DOT) ), name, join.toString() ); } --- 143,152 ---- String name = q.createNameFor(memberClass); ! q.addType(name, memberClass); String[] keyColNames = memberPersister.getIdentifierColumnNames(); ! addJoin( memberPersister.getTableName(), name, keyColNames, q ); currentName = name; currentProperty = token; ! q.addPathAliasAndJoin( path.substring( 0, path.lastIndexOf(StringHelper.DOT) ), name, join ); } *************** *** 182,187 **** CollectionPersister p = q.getCollectionPersister(collectionRole); String[] colNames = p.getKeyColumnNames(); ! String name = q.createNameForCollection(collectionRole); ! addJoin(name, colNames, q); doCollectionProperty(token, p, name); collectionName = name; --- 158,172 ---- CollectionPersister p = q.getCollectionPersister(collectionRole); String[] colNames = p.getKeyColumnNames(); ! ! String name; ! if ( presetCollectionName==null || !p.isOneToMany() ) { ! name = q.createNameForCollection(collectionRole); ! } ! else { ! name = presetCollectionName; ! } ! presetCollectionName = null; ! ! addJoin( p.getQualifiedTableName(), name, colNames, q ); doCollectionProperty(token, p, name); collectionName = name; *************** *** 235,239 **** private void reset() { ! join = new StringBuffer(50); dotcount=0; currentName=null; --- 220,224 ---- private void reset() { ! join = new QueryOuterJoinFragment(); dotcount=0; currentName=null; *************** *** 275,293 **** } if (collectionRole!=null) { //special case; expecting: [index] CollectionPersister memberPersister = q.getCollectionPersister(collectionRole); if ( !memberPersister.hasIndex() ) throw new QueryException("unindexed collection before []"); ! String[] keyCols = memberPersister.getKeyColumnNames(); ! if (!continuation) addJoin(collectionName, keyCols, q); ! ! String[] indexCols = memberPersister.getIndexColumnNames(); ! if ( indexCols.length!=1 ) throw new QueryException("composite-index appears in []"); ! join.append(" and ") ! .append(collectionName) ! .append(StringHelper.DOT) ! .append( indexCols[0] ) ! .append("="); String[] eltCols = memberPersister.getElementColumnNames(); --- 260,276 ---- } if (collectionRole!=null) { + //special case; expecting: [index] CollectionPersister memberPersister = q.getCollectionPersister(collectionRole); + if ( !memberPersister.hasIndex() ) throw new QueryException("unindexed collection before []"); ! String[] indexCols = memberPersister.getIndexColumnNames(); ! if ( indexCols.length!=1 ) throw new QueryException("composite-index appears in []"); String[] keyCols = memberPersister.getKeyColumnNames(); ! if (!continuation) { ! addJoin( memberPersister.getQualifiedTableName(), collectionName, keyCols, q ); ! } ! join.addCondition(collectionName, indexCols, " = "); String[] eltCols = memberPersister.getElementColumnNames(); *************** *** 299,307 **** elem.isOneToMany = memberPersister.isOneToMany(); elem.alias = collectionName; ! elem.join = join.toString(); collectionElements.addLast(elem); setExpectingCollectionIndex(); q.addCollection(collectionName, collectionRole); } else { --- 282,293 ---- elem.isOneToMany = memberPersister.isOneToMany(); elem.alias = collectionName; ! elem.join = join; collectionElements.addLast(elem); setExpectingCollectionIndex(); q.addCollection(collectionName, collectionRole); + OuterJoinFragment ojf = new QueryOuterJoinFragment(); + ojf.addCrossJoin( memberPersister.getQualifiedTableName(), collectionName ); + q.addJoin(collectionName, ojf); } else { *************** *** 314,318 **** //important!! continuation=false; ! } --- 300,304 ---- //important!! continuation=false; ! presetCollectionName = null; } *************** *** 322,326 **** String alias; String[] elementColumns; ! String join; StringBuffer indexValue = new StringBuffer(); } --- 308,312 ---- String alias; String[] elementColumns; ! OuterJoinFragment join; StringBuffer indexValue = new StringBuffer(); } *************** *** 328,346 **** private boolean expectingCollectionIndex; private LinkedList collectionElements = new LinkedList(); public CollectionElement lastCollectionElement() { return (CollectionElement) collectionElements.removeLast(); } public void setLastCollectionElementIndexValue(String value) { ( (CollectionElement) collectionElements.getLast() ).indexValue.append(value) ; } public boolean isExpectingCollectionIndex() { return expectingCollectionIndex; } protected void setExpectingCollectionIndex() throws QueryException { expectingCollectionIndex = true; } ! public String getWhereJoin() { ! return join.toString(); } --- 314,336 ---- private boolean expectingCollectionIndex; private LinkedList collectionElements = new LinkedList(); + public CollectionElement lastCollectionElement() { return (CollectionElement) collectionElements.removeLast(); } + public void setLastCollectionElementIndexValue(String value) { ( (CollectionElement) collectionElements.getLast() ).indexValue.append(value) ; } + public boolean isExpectingCollectionIndex() { return expectingCollectionIndex; } + protected void setExpectingCollectionIndex() throws QueryException { expectingCollectionIndex = true; } ! public OuterJoinFragment getWhereJoin() { ! return join; } *************** *** 357,367 **** } ! public String getCollectionSubquery(String extraJoin) throws QueryException { ! if (extraJoin!=null) join.append(extraJoin); return new StringBuffer( "SELECT " ) ! .append( StringHelper.join( ", ", collectionElementColumns ) ) ! .append(" FROM ").append(collectionTable).append(' ').append(collectionName) ! .append(" WHERE ").append( join.substring(5).toString() ) // remove initial " and " ! .toString(); } --- 347,366 ---- } ! public String getName() { ! return currentName==null ? collectionName : currentName; ! } ! ! public String getCollectionSubquery() throws QueryException { ! return new StringBuffer( "SELECT " ) ! .append( StringHelper.join( ", ", collectionElementColumns ) ) ! .append(" FROM ") ! .append(collectionTable) ! .append(' ') ! .append(collectionName) ! //.append( join.toFromFragmentString() ) ! .append(" WHERE ") ! .append( join.toWhereFragmentString().substring(5) ) // remove initial " and " ! .toString(); } *************** *** 370,374 **** } ! public void addFromCollection(QueryTranslator q, String elementName) throws QueryException { if ( collectionElementType==null ) throw new QueryException("must specify 'elements' for collection valued property in from clause: " + elementName); --- 369,373 ---- } ! public void addFromCollection(QueryTranslator q, String elementName, int joinType) throws QueryException { if ( collectionElementType==null ) throw new QueryException("must specify 'elements' for collection valued property in from clause: " + elementName); *************** *** 378,401 **** ); EntityType elemType = (EntityType) collectionElementType; - q.addFromType( elementName, elemType.getPersistentClass().getName() ); CollectionPersister persister = q.getCollectionPersister(collectionRole); if ( persister.isOneToMany() ) { ! q.addJoin( StringHelper.replace( join.toString(), collectionName, elementName ) ); } else { q.addCollection(collectionName, collectionRole); ! String[] keyColumnNames = q.getPersisterForName(elementName).getIdentifierColumnNames(); ! ! for ( int i=0; i<keyColumnNames.length; i++ ) { ! join.append(" and ") ! .append( collectionElementColumns[i] ) //already qualified ! .append('=') ! .append(elementName) ! .append(StringHelper.DOT) ! .append( keyColumnNames[i] ); ! } ! q.addJoin( join.toString() ); } } --- 377,395 ---- ); EntityType elemType = (EntityType) collectionElementType; CollectionPersister persister = q.getCollectionPersister(collectionRole); + if ( persister.isOneToMany() ) { ! //join.addCrossJoin( persister.getQualifiedTableName(), elementName ); } else { q.addCollection(collectionName, collectionRole); ! //join.addCrossJoin( persister.getQualifiedTableName(), collectionName ); ! Loadable p = q.getPersister( elemType.getPersistentClass() ); ! String[] keyColumnNames = p.getIdentifierColumnNames(); ! join.addJoin( p.getTableName(), elementName, collectionElementColumns, keyColumnNames, joinType); } + q.addFromType( elementName, elemType.getPersistentClass(), join ); + // q.addJoin(join); } Index: QueryTranslator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/QueryTranslator.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** QueryTranslator.java 24 Jan 2003 13:07:16 -0000 1.10 --- QueryTranslator.java 23 Feb 2003 01:32:20 -0000 1.11 *************** *** 30,38 **** import net.sf.hibernate.loader.Loader; import net.sf.hibernate.loader.OuterJoinLoader; - //import net.sf.hibernate.loader.OuterJoinLoader; - //import net.sf.hibernate.loader.OuterJoinLoader.OuterJoinableAssociation; import net.sf.hibernate.persister.Loadable; import net.sf.hibernate.persister.Queryable; import net.sf.hibernate.sql.OuterJoinFragment; import net.sf.hibernate.type.EntityType; import net.sf.hibernate.type.Type; --- 30,37 ---- import net.sf.hibernate.loader.Loader; import net.sf.hibernate.loader.OuterJoinLoader; import net.sf.hibernate.persister.Loadable; import net.sf.hibernate.persister.Queryable; import net.sf.hibernate.sql.OuterJoinFragment; + import net.sf.hibernate.sql.QueryOuterJoinFragment; import net.sf.hibernate.type.EntityType; import net.sf.hibernate.type.Type; *************** *** 79,94 **** dontSpace.add(StringHelper.CLOSE_PAREN); } ! private final HashMap typeMap = new HashMap(); ! private final HashMap collections = new HashMap(); ! private final HashMap names = new HashMap(); ! private ArrayList returnTypes = new ArrayList(); ! private final ArrayList fromTypes = new ArrayList(); ! private final ArrayList scalarTypes = new ArrayList(); ! private final HashMap namedParameters = new HashMap(); private final List scalarSelectTokens = new ArrayList(); private final List whereTokens = new ArrayList(); private final List havingTokens = new ArrayList(); ! private final StringBuffer joins = new StringBuffer(40); private final List orderByTokens = new ArrayList(); private final List groupByTokens = new ArrayList(); --- 78,94 ---- dontSpace.add(StringHelper.CLOSE_PAREN); } ! ! private final Map typeMap = new HashMap(); ! private final Map collections = new HashMap(); ! private List returnTypes = new ArrayList(); ! private final List fromTypes = new ArrayList(); ! private final Map fromJoins = new HashMap(); ! private final List scalarTypes = new ArrayList(); ! private final Map namedParameters = new HashMap(); private final List scalarSelectTokens = new ArrayList(); private final List whereTokens = new ArrayList(); private final List havingTokens = new ArrayList(); ! private final Map joins = new HashMap(); private final List orderByTokens = new ArrayList(); private final List groupByTokens = new ArrayList(); *************** *** 259,267 **** String createNameForCollection(String role) { ! return prefix( StringHelper.unqualify(role, "/") ) + nextCount() + StringHelper.UNDERSCORE; } ! String getType(String name) { ! String type = (String) typeMap.get(name); if ( type==null && superQuery!=null ) type = superQuery.getType(name); return type; --- 259,267 ---- String createNameForCollection(String role) { ! return prefix( StringHelper.unqualify(role) ) + nextCount() + StringHelper.UNDERSCORE; } ! Class getType(String name) { ! Class type = (Class) typeMap.get(name); if ( type==null && superQuery!=null ) type = superQuery.getType(name); return type; *************** *** 275,296 **** boolean isName(String name) { ! return typeMap.containsKey(name) || collections.containsKey(name) || ( superQuery!=null && superQuery.isName(name) ); } Queryable getPersisterForName(String name) throws QueryException { ! String typeName = getType(name); ! if (typeName==null) { ! return getPersister( ! ( (EntityType) getCollectionPersister( getRole(name) ).getElementType() ).getPersistentClass() ! ); } else { ! Queryable persister = getPersister(typeName); ! if (persister==null) throw new QueryException( "persistent class not found: " + typeName ); return persister; } } ! Queryable getPersister(String className) { String[] imports = factory.getImports(); try { --- 275,309 ---- boolean isName(String name) { ! return typeMap.containsKey(name) || ! collections.containsKey(name) || ( ! superQuery!=null && superQuery.isName(name) ! ); ! } ! ! Queryable getEntityPersisterForName(String name) throws QueryException { ! Class type = getType(name); ! if (type==null) { ! return null; ! } ! else { ! return getPersister(type); ! } } Queryable getPersisterForName(String name) throws QueryException { ! Class type = getType(name); ! if (type==null) { ! Type elemType = getCollectionPersister( getRole(name) ).getElementType(); ! if ( ! (elemType instanceof EntityType) ) return null; //YUCK! bugprone..... ! return getPersister( ( (EntityType) elemType ).getPersistentClass() ); } else { ! Queryable persister = getPersister(type); ! if (persister==null) throw new QueryException( "persistent class not found: " + type.getName() ); return persister; } } ! Queryable getPersisterUsingImports(String className) { String[] imports = factory.getImports(); try { *************** *** 326,332 **** } ! void addType(String name, String type) { typeMap.put(name, type); - names.put(type, name); } --- 339,344 ---- } ! void addType(String name, Class type) { typeMap.put(name, type); } *************** *** 335,341 **** } ! void addFromType(String name, String type) { addType(name, type); fromTypes.add(name); } --- 347,355 ---- } ! void addFromType(String name, Class type, OuterJoinFragment join) { addType(name, type); fromTypes.add(name); + fromJoins.put(name, join); + //addJoin(join); //TODO: remove this!! } *************** *** 372,381 **** } ! void addJoin(String token) { ! if ( joins.length()==0 && token.length()!=0 ) { ! joins.append( token.substring(5) ); // remove leading " and " (ugly and causes bugs!) ! } ! else { ! joins.append(token); } } --- 386,392 ---- } ! void addJoin(String name, OuterJoinFragment newjoin) { ! if ( !joins.containsKey(name) ) { ! joins.put(name, newjoin); } } *************** *** 444,448 **** String selectProperties; String selectIdentifiers; ! if ( !isShallowQuery() && returnTypes.size()==1 && typeMap.size()==1 ) { OuterJoinLoader ojl = new OuterJoinLoader( factory.getDialect() ); String name = (String) returnTypes.get(0); --- 455,460 ---- String selectProperties; String selectIdentifiers; ! if (false) { ! //if ( !isShallowQuery() && returnTypes.size()==1 && typeMap.size()==1 ) { OuterJoinLoader ojl = new OuterJoinLoader( factory.getDialect() ); String name = (String) returnTypes.get(0); *************** *** 487,491 **** if ( outerJoinedProperties!=null && outerJoinedProperties.length() > 0 ) selectPropertiesString += ", " + outerJoinedProperties; //TODO: for some dialiects it would be appropriate to add the renderOrderByPropertiesSelect() to other select strings ! fromWhereString = renderFromClause(outerjoin) + renderWhereClause(outerjoin); if ( scalarTypes.size()!=size ) { --- 499,506 ---- if ( outerJoinedProperties!=null && outerJoinedProperties.length() > 0 ) selectPropertiesString += ", " + outerJoinedProperties; //TODO: for some dialiects it would be appropriate to add the renderOrderByPropertiesSelect() to other select strings ! OuterJoinFragment mergedJoins = mergeJoins(outerjoin); ! fromWhereString = " FROM" + mergedJoins.toFromFragmentString().substring(1) + renderWhereClause(mergedJoins, outerjoin); ! ! //System.out.println( ">>>> " + renderFromClause(outerjoin) ); if ( scalarTypes.size()!=size ) { *************** *** 630,637 **** } ! private String renderFromClause(OuterJoinFragment outerjoin) throws QueryException, MappingException { //FROM StringBuffer buf = new StringBuffer(120) ! .append(" FROM"); Iterator iter = typeMap.keySet().iterator(); while ( iter.hasNext() ) { --- 645,692 ---- } ! private OuterJoinFragment mergeJoins(OuterJoinFragment outerjoin) throws MappingException, QueryException { ! OuterJoinFragment ojf = new QueryOuterJoinFragment(); ! ! //classes ! Iterator iter = typeMap.keySet().iterator(); ! while ( iter.hasNext() ) { ! String name = (String) iter.next(); ! Queryable p = getPersisterForName(name); ! boolean includeSubclasses = returnTypes.contains(name) && !isShallowQuery(); ! ! OuterJoinFragment join = (OuterJoinFragment) fromJoins.get(name); ! if (join!=null) { ! ojf.addFragment(join); ! ojf.addJoins( ! p.fromJoinFragment(name, true, includeSubclasses), ! p.queryWhereFragment(name, includeSubclasses) ! ); ! } ! } ! ! // add any outerjoins required for association fetching ! // TODO: (need to move inside loop, eventually) ! if (outerjoin!=null) ojf.addJoins( outerjoin.toFromFragmentString(), StringHelper.EMPTY_STRING ); ! ! iter = joins.entrySet().iterator(); ! while ( iter.hasNext() ) { ! Map.Entry e = (Map.Entry) iter.next(); ! String name = (String) e.getKey(); ! if ( !fromJoins.containsKey(name) ) { //TODO: I hate this.... ! ojf.addFragment( (OuterJoinFragment) e.getValue() ); ! Queryable p = getEntityPersisterForName(name); ! if (p!=null) { ! ojf.addJoins( p.fromJoinFragment(name, true, false), StringHelper.EMPTY_STRING ); ! } ! } ! } ! ! return ojf; ! } ! ! /*private String renderFromClause(OuterJoinFragment outerjoin) throws QueryException, MappingException { //FROM StringBuffer buf = new StringBuffer(120) ! .append(" FROM"); Iterator iter = typeMap.keySet().iterator(); while ( iter.hasNext() ) { *************** *** 662,699 **** return buf.toString(); ! } ! private String renderWhereClause(OuterJoinFragment outerjoin) throws QueryException, MappingException { Iterator iter = typeMap.keySet().iterator(); - StringBuffer inClassWheres = new StringBuffer(50); - - // add any outerjoins required for fetching associations - // TODO: (need to move inside loop, eventually) - if (outerjoin!=null) inClassWheres.append( outerjoin.toWhereFragmentString() ); - while ( iter.hasNext() ) { - String name = (String) iter.next(); Queryable p = getPersisterForName(name); addIdentifierSpace( p.getIdentifierSpace() ); - - //render the " and foo.class in ( 'Foo', 'Bar' ) " bit - String where = p.queryWhereFragment( name, returnTypes.contains(name) && !isShallowQuery() ); - if ( where!=null ) inClassWheres.append(where); } ! //if ( inClassWheres.toString().toLowerCase().startsWith(" and ") ) { ! inClassWheres.delete(0, 5); //remove the leading " and " ! //} StringBuffer buf = new StringBuffer(120); - //WHERE StringBuffer whereTokenBuf = new StringBuffer(40); appendTokens( whereTokenBuf, whereTokens.iterator() ); ! String part1 = inClassWheres.toString().trim(); ! String part2 = joins.toString().trim(); String part3 = whereTokenBuf.toString().trim(); --- 717,749 ---- return buf.toString(); ! }*/ ! private String renderWhereClause(OuterJoinFragment mergedJoins, OuterJoinFragment outerjoin) throws QueryException, MappingException { ! ! //SET UP IDENTIFIER SPACES. TODO: move elsewhere! Iterator iter = typeMap.keySet().iterator(); while ( iter.hasNext() ) { String name = (String) iter.next(); Queryable p = getPersisterForName(name); addIdentifierSpace( p.getIdentifierSpace() ); } ! // add any outerjoins required for fetching associations ! // TODO: (need to move inside loop, eventually) ! String part1; ! if (outerjoin!=null) { ! part1 = outerjoin.toWhereFragmentString().substring(5); //remove the leading " and " ! } ! else { ! part1=""; ! } StringBuffer buf = new StringBuffer(120); StringBuffer whereTokenBuf = new StringBuffer(40); appendTokens( whereTokenBuf, whereTokens.iterator() ); ! String part2 = mergedJoins.toWhereFragmentString(); String part3 = whereTokenBuf.toString().trim(); *************** *** 705,709 **** if ( hasPart1 ) buf.append(part1); if ( hasPart1 && hasPart2 ) buf.append(" AND "); ! if ( hasPart2 ) buf.append(part2); if ( hasPart3 ) { if ( hasPart1 || hasPart2 ) buf.append(" AND ("); --- 755,759 ---- if ( hasPart1 ) buf.append(part1); if ( hasPart1 && hasPart2 ) buf.append(" AND "); ! if ( hasPart2 ) buf.append( part2.substring(5) ); //remove leading "and " if ( hasPart3 ) { if ( hasPart1 || hasPart2 ) buf.append(" AND ("); *************** *** 780,784 **** ); EntityType elemType = (EntityType) collectionElementType; - addFromType( elementName, elemType.getPersistentClass().getName() ); CollectionPersister persister = getCollectionPersister(collectionRole); --- 830,833 ---- *************** *** 786,820 **** if (keyColumnNames.length!=1) throw new QueryException("composite-key collection in filter: " + collectionRole); ! StringBuffer join = new StringBuffer(25); ! join.append(" and "); // all conditions must begin with " and " ! if ( persister.isOneToMany() ) { ! join.append(elementName) ! .append(StringHelper.DOT) ! .append( keyColumnNames[0] ) ! .append(" = ?"); } else { //many-to-many String collectionName = createNameForCollection(collectionRole); addCollection(collectionName, collectionRole); ! join.append(collectionName) ! .append(StringHelper.DOT) ! .append( keyColumnNames[0] ) ! .append(" = ?"); ! String[] idColumnNames = getPersisterForName(elementName).getIdentifierColumnNames(); String[] eltColumnNames = persister.getElementColumnNames(); ! for ( int i=0; i<idColumnNames.length; i++ ) { ! join.append(" and ") ! .append(collectionName) ! .append(StringHelper.DOT) ! .append( eltColumnNames[i] ) ! .append('=') ! .append(elementName) ! .append(StringHelper.DOT) ! .append( idColumnNames[i] ); ! } } ! addJoin( join.toString() ); } --- 835,863 ---- if (keyColumnNames.length!=1) throw new QueryException("composite-key collection in filter: " + collectionRole); ! OuterJoinFragment join = new QueryOuterJoinFragment(); if ( persister.isOneToMany() ) { ! join.addCrossJoin( persister.getQualifiedTableName(), elementName ); ! join.addCondition(elementName, keyColumnNames, " = ?"); } else { //many-to-many String collectionName = createNameForCollection(collectionRole); addCollection(collectionName, collectionRole); ! join.addCrossJoin( persister.getQualifiedTableName(), collectionName ); ! join.addCondition(collectionName, keyColumnNames, " = ?"); ! Queryable p = getPersister( elemType.getPersistentClass() ); ! String[] idColumnNames = p.getIdentifierColumnNames(); String[] eltColumnNames = persister.getElementColumnNames(); ! join.addJoin( ! p.getTableName(), ! elementName, ! StringHelper.prefix(eltColumnNames, collectionName + StringHelper.DOT), ! idColumnNames, ! OuterJoinFragment.INNER_JOIN ! ); } ! addFromType( elementName, elemType.getPersistentClass(), join ); ! // addJoin(join); ! } *************** *** 826,836 **** } ! String getPathJoin(String path) { ! return (String) pathJoins.get(path); } ! void addPathAliasAndJoin(String path, String alias, String join) { pathAliases.put(path, alias); ! pathJoins.put(path, join); } --- 869,879 ---- } ! OuterJoinFragment getPathJoin(String path) { ! return (OuterJoinFragment) pathJoins.get(path); } ! void addPathAliasAndJoin(String path, String alias, OuterJoinFragment join) { pathAliases.put(path, alias); ! pathJoins.put( path, join.copy() ); } Index: SelectParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/SelectParser.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SelectParser.java 20 Jan 2003 12:48:11 -0000 1.4 --- SelectParser.java 23 Feb 2003 01:32:20 -0000 1.5 *************** *** 107,111 **** q.appendScalarSelectToken( aggregatePathExpressionParser.getWhereColumn() ); if (!count) q.addScalarType( aggregatePathExpressionParser.getWhereColumnType() ); ! q.addJoin( aggregatePathExpressionParser.getWhereJoin() ); } else { --- 107,111 ---- q.appendScalarSelectToken( aggregatePathExpressionParser.getWhereColumn() ); if (!count) q.addScalarType( aggregatePathExpressionParser.getWhereColumnType() ); ! q.addJoin( aggregatePathExpressionParser.getName(), aggregatePathExpressionParser.getWhereJoin() ); } else { *************** *** 124,128 **** q.appendScalarSelectTokens( pathExpressionParser.getWhereColumns() ); q.addScalarType( pathExpressionParser.getWhereColumnType() ); ! q.addJoin( pathExpressionParser.getWhereJoin() ); ready = false; --- 124,128 ---- q.appendScalarSelectTokens( pathExpressionParser.getWhereColumns() ); q.addScalarType( pathExpressionParser.getWhereColumnType() ); ! q.addJoin( pathExpressionParser.getName(), pathExpressionParser.getWhereJoin() ); ready = false; Index: WhereParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/WhereParser.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** WhereParser.java 20 Jan 2003 12:48:11 -0000 1.4 --- WhereParser.java 23 Feb 2003 01:32:20 -0000 1.5 *************** *** 14,20 **** import net.sf.hibernate.util.StringHelper; import net.sf.hibernate.persister.Queryable; import net.sf.hibernate.type.EntityType; import net.sf.hibernate.type.LiteralType; - import net.sf.hibernate.type.PersistentCollectionType; import net.sf.hibernate.type.Type; import net.sf.hibernate.type.TypeFactory; --- 14,21 ---- import net.sf.hibernate.util.StringHelper; import net.sf.hibernate.persister.Queryable; + import net.sf.hibernate.sql.OuterJoinFragment; + import net.sf.hibernate.sql.QueryOuterJoinFragment; import net.sf.hibernate.type.EntityType; import net.sf.hibernate.type.LiteralType; import net.sf.hibernate.type.Type; import net.sf.hibernate.type.TypeFactory; *************** *** 150,154 **** private LinkedList joins = new LinkedList(); //the join string built up by compound paths inside this expression private LinkedList booleanTests = new LinkedList(); //a flag indicating if the subexpression is known to be boolean - private String collectionJoin; private String getElementName(PathExpressionParser.CollectionElement element, QueryTranslator q) throws QueryException { --- 151,154 ---- *************** *** 164,171 **** name = pathExpressionParser.continueFromManyToMany(clazz, element.elementColumns, q); } ! else if ( type.isPersistentCollectionType() ) { //ie. a subcollection String role = ( (PersistentCollectionType) type ).getRole(); name = pathExpressionParser.continueFromSubcollection(role, element.elementColumns, q); ! } else { throw new QueryException("illegally dereferenced collection element"); --- 164,171 ---- name = pathExpressionParser.continueFromManyToMany(clazz, element.elementColumns, q); } ! /*else if ( type.isPersistentCollectionType() ) { //ie. a subcollection String role = ( (PersistentCollectionType) type ).getRole(); name = pathExpressionParser.continueFromSubcollection(role, element.elementColumns, q); ! }*/ else { throw new QueryException("illegally dereferenced collection element"); *************** *** 203,208 **** doPathExpression( getElementName(element, q) + token, q ); // careful with this! ! addToCurrentJoin(element.join); ! addToCurrentJoin( element.indexValue.toString() ); return; //NOTE: EARLY EXIT! --- 203,207 ---- doPathExpression( getElementName(element, q) + token, q ); // careful with this! ! addToCurrentJoin(element); return; //NOTE: EARLY EXIT! *************** *** 210,215 **** else if ( token.equals("[") ) { doPathExpression( getElementName(element, q), q ); ! addToCurrentJoin(element.join); ! addToCurrentJoin( element.indexValue.toString() ); return; //NOTE: EARLY EXIT! } --- 209,213 ---- else if ( token.equals("[") ) { doPathExpression( getElementName(element, q), q ); ! addToCurrentJoin(element); return; //NOTE: EARLY EXIT! } *************** *** 217,222 **** if ( element.elementColumns.length!=1 ) throw new QueryException("path expression ended in composite collection element"); appendToken( q, element.elementColumns[0] ); ! addToCurrentJoin(element.join); ! addToCurrentJoin( element.indexValue.toString() ); } --- 215,219 ---- if ( element.elementColumns.length!=1 ) throw new QueryException("path expression ended in composite collection element"); appendToken( q, element.elementColumns[0] ); ! addToCurrentJoin(element); } *************** *** 306,311 **** if ( element.elementColumns.length!=1 ) throw new QueryException("path expression ended in composite collection element"); appendToken( q, element.elementColumns[0] ); ! addToCurrentJoin(element.join); ! addToCurrentJoin( element.indexValue.toString() ); } token(StringHelper.CLOSE_PAREN, q); --- 303,307 ---- if ( element.elementColumns.length!=1 ) throw new QueryException("path expression ended in composite collection element"); appendToken( q, element.elementColumns[0] ); ! addToCurrentJoin(element); } token(StringHelper.CLOSE_PAREN, q); *************** *** 366,373 **** if ( pathExpressionParser.isCollectionValued() ) { openExpression(q, StringHelper.EMPTY_STRING); ! appendToken( q, pathExpressionParser.getCollectionSubquery(collectionJoin) ); q.addIdentifierSpace( pathExpressionParser.getCollectionTable() ); closeExpression(q, StringHelper.EMPTY_STRING); - collectionJoin = null; } else { --- 362,368 ---- if ( pathExpressionParser.isCollectionValued() ) { openExpression(q, StringHelper.EMPTY_STRING); ! appendToken( q, pathExpressionParser.getCollectionSubquery() ); q.addIdentifierSpace( pathExpressionParser.getCollectionTable() ); closeExpression(q, StringHelper.EMPTY_STRING); } else { *************** *** 376,380 **** } else { ! addToCurrentJoin( pathExpressionParser.getWhereJoin() ); appendToken( q, pathExpressionParser.getWhereColumn() ); } --- 371,379 ---- } else { ! OuterJoinFragment ojf = pathExpressionParser.getWhereJoin(); ! OuterJoinFragment fromClause = new QueryOuterJoinFragment(); ! fromClause.addJoins( ojf.toFromFragmentString(), StringHelper.EMPTY_STRING ); ! q.addJoin( pathExpressionParser.getName(), fromClause ); ! addToCurrentJoin( ojf.toWhereFragmentString() ); appendToken( q, pathExpressionParser.getWhereColumn() ); } *************** *** 391,395 **** } else { ! Queryable p = q.getPersister(token); if ( p!=null ) { // the name of a class appendToken( q, p.getDiscriminatorSQLString() ); --- 390,394 ---- } else { ! Queryable p = q.getPersisterUsingImports(token); if ( p!=null ) { // the name of a class appendToken( q, p.getDiscriminatorSQLString() ); *************** *** 432,435 **** --- 431,438 ---- private void addToCurrentJoin(String sql) { ( (StringBuffer) joins.getLast() ).append(sql); + } + + private void addToCurrentJoin(PathExpressionParser.CollectionElement ce) { + addToCurrentJoin( ce.join.toWhereFragmentString() + ce.indexValue.toString() ); } |
From: <one...@us...> - 2003-02-23 01:32:28
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader In directory sc8-pr-cvs1:/tmp/cvs-serv11798/sf/hibernate/loader Modified Files: Loader.java OuterJoinLoader.java Log Message: refactored hql package (incomplete) Index: Loader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/Loader.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Loader.java 15 Feb 2003 01:00:54 -0000 1.11 --- Loader.java 23 Feb 2003 01:32:20 -0000 1.12 *************** *** 404,408 **** * Limit the number of rows returned by the SQL query if necessary */ ! protected final void setMaxRows(PreparedStatement st,RowSelection selection) throws SQLException { if ( selection!=null && selection.getMaxRows()!=null ) st.setMaxRows( selection.getMaxRows().intValue() + ( (selection.getFirstRow()==null) ? 0 : selection.getFirstRow().intValue() ) --- 404,408 ---- * Limit the number of rows returned by the SQL query if necessary */ ! protected final void setMaxRows(PreparedStatement st, RowSelection selection) throws SQLException { if ( selection!=null && selection.getMaxRows()!=null ) st.setMaxRows( selection.getMaxRows().intValue() + ( (selection.getFirstRow()==null) ? 0 : selection.getFirstRow().intValue() ) Index: OuterJoinLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/OuterJoinLoader.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** OuterJoinLoader.java 24 Jan 2003 13:07:17 -0000 1.11 --- OuterJoinLoader.java 23 Feb 2003 01:32:20 -0000 1.12 *************** *** 259,263 **** oj.foreignKeyColumns, oj.subpersister.getIdentifierColumnNames(), ! false ); outerjoin.addJoins( --- 259,263 ---- oj.foreignKeyColumns, oj.subpersister.getIdentifierColumnNames(), ! OuterJoinFragment.LEFT_OUTER_JOIN ); outerjoin.addJoins( |