⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.html

📁 Hibernate中文参考手册
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<html><head>      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">   <title>HIBERNATE - &#31526;&#21512;Java&#20064;&#24815;&#30340;&#20851;&#31995;&#25968;&#25454;&#24211;&#25345;&#20037;&#21270;</title><link rel="stylesheet" href="../styles/html.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="d0e1"></a>HIBERNATE - &#31526;&#21512;Java&#20064;&#24815;&#30340;&#20851;&#31995;&#25968;&#25454;&#24211;&#25345;&#20037;&#21270;</h1></div><div><h2 class="subtitle">Hibernate2 &#21442;&#32771;&#25991;&#26723;</h2></div><div><p class="releaseinfo">2.1.2</p></div></div><div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#d0e10">&#21069;&#35328;</a></dt><dt>1. <a href="#quickstart">&#22312;Tomcat&#20013;&#24555;&#36895;&#19978;&#25163;</a></dt><dd><dl><dt>1.1. <a href="#d0e91">&#24320;&#22987;Hibernate&#20043;&#26053;</a></dt><dt>1.2. <a href="#d0e246">&#31532;&#19968;&#20010;&#21487;&#25345;&#20037;&#21270;&#31867;</a></dt><dt>1.3. <a href="#d0e272">&#26144;&#23556;cat</a></dt><dt>1.4. <a href="#d0e318">&#19982;&#29483;&#21516;&#20048;</a></dt><dt>1.5. <a href="#d0e410">&#32467;&#35821;</a></dt></dl></dd><dt>2. <a href="#architecture">&#20307;&#31995;&#32467;&#26500;</a></dt><dd><dl><dt>2.1. <a href="#architecture-s1">&#24635;&#35272;</a></dt><dt>2.2. <a href="#architecture-s2">&#25345;&#20037;&#21270;&#23545;&#35937;&#26631;&#35782;&#65288;Persistent Object Identity &#65289;</a></dt><dt>2.3. <a href="#architecture-s3">JMX&#38598;&#25104;</a></dt><dt>2.4. <a href="#architecture-s4">JCA&#25903;&#25345;</a></dt></dl></dd><dt>3. <a href="#session-configuration">SessionFactory&#37197;&#32622;</a></dt><dd><dl><dt>3.1. <a href="#session-configuration-s1">&#21487;&#32534;&#31243;&#37197;&#32622;&#26041;&#24335;</a></dt><dt>3.2. <a href="#session-configuration-s2">&#33719;&#21462;SessionFactory</a></dt><dt>3.3. <a href="#session-configuration-s3">&#29992;&#25143;&#33258;&#34892;&#25552;&#20379;JDBC&#36830;&#25509;</a></dt><dt>3.4. <a href="#session-configuration-s4">Hibernate&#25552;&#20379;&#30340;JDBC&#36830;&#25509;</a></dt><dt>3.5. <a href="#session-configuration-s5">&#20854;&#23427;&#37197;&#32622;&#23646;&#24615;</a></dt><dd><dl><dt>3.5.1. <a href="#session-configuration-s5-1">SQL Dialects SQL &#26041;&#35328;</a></dt><dt>3.5.2. <a href="#session-configuration-s5-2">&#22806;&#36830;&#25509;&#25235;&#21462;&#65288;Outer Join Fetching &#65289;</a></dt><dt>3.5.3. <a href="#session-configuration-s5-3">&#20108;&#36827;&#21046;&#27969;</a></dt><dt>3.5.4. <a href="#session-configuration-s5-4">&#22312;&#25511;&#21046;&#21488;&#35760;&#24405;SQL</a></dt><dt>3.5.5. <a href="#session-configuration-s5-5">&#33258;&#23450;&#20041; ConnectionProvider</a></dt><dt>3.5.6. <a href="#session-configuration-s5-5b">&#24120;&#29992;&#25968;&#25454;&#24211;&#23646;&#24615;</a></dt><dt>3.5.7. <a href="#session-configuration-s5-6">&#33258;&#23450;&#20041;CacheProvider</a></dt><dt>3.5.8. <a href="#session-configuration-s5-7">&#20107;&#21153;&#31574;&#30053;</a></dt><dt>3.5.9. <a href="#session-configuration-s5-8">&#32465;&#23450;SessionFactory&#21040;JNDI</a></dt><dt>3.5.10. <a href="#session-configuration-s5-9">&#26597;&#35810;&#35821;&#35328;&#26367;&#25442; </a></dt></dl></dd><dt>3.6. <a href="#session-configuration-s6">XML&#37197;&#32622;&#25991;&#20214;</a></dt><dt>3.7. <a href="#session-configuration-s7">Logging</a></dt><dt>3.8. <a href="#session-configuration-s8">NamingStrategy&#65288;&#21629;&#21517;&#31574;&#30053;)</a></dt></dl></dd><dt>4. <a href="#persistent-classes">&#25345;&#20037;&#21270;&#31867;(Persistent Classes)</a></dt><dd><dl><dt>4.1. <a href="#persistent-classes-s1">&#31616;&#21333;&#31034;&#20363;</a></dt><dd><dl><dt>4.1.1. <a href="#persistent-classes-s1-1">&#20026;&#25345;&#20037;&#21270;&#23383;&#27573;&#22768;&#26126;&#35775;&#38382;&#22120;(accessors)&#21644;&#26159;&#21542;&#21487;&#21464;&#30340;&#26631;&#24535;(mutators)</a></dt><dt>4.1.2. <a href="#persistent-classes-s1-2">&#23454;&#29616;&#19968;&#20010;&#40664;&#35748;&#30340;&#26500;&#36896;&#26041;&#27861;&#65288;constructor&#65289;</a></dt><dt>4.1.3. <a href="#persistent-classes-s1-3">&#25552;&#20379;&#19968;&#20010;&#26631;&#35782;&#23646;&#24615;&#65288;identifier property&#65289;&#65288;&#21487;&#36873;&#65289; </a></dt><dt>4.1.4. <a href="#persistent-classes-s1-4">&#24314;&#35758;&#20351;&#29992;&#19981;&#26159;final&#30340;&#31867; (&#21487;&#36873;)</a></dt></dl></dd><dt>4.2. <a href="#persistent-classes-s2">&#32487;&#25215;&#65288;Inheritance &#65289;</a></dt><dt>4.3. <a href="#persistent-classes-s3">&#25345;&#20037;&#21270;&#29983;&#21629;&#21608;&#26399;&#65288;Lifecycle&#65289;&#20013;&#30340;&#22238;&#35843;&#65288;Callbacks&#65289;</a></dt><dt>4.4. <a href="#persistent-classes-s4">&#21512;&#27861;&#24615;&#26816;&#26597;&#65288;Validatable&#65289;</a></dt><dt>4.5. <a href="#persistent-classes-s5">XDoclet&#31034;&#20363;</a></dt></dl></dd><dt>5. <a href="#or-mapping">O/R Mapping&#22522;&#30784;</a></dt><dd><dl><dt>5.1. <a href="#or-mapping-s1">&#26144;&#23556;&#22768;&#26126;(Mapping declaration)</a></dt><dd><dl><dt>5.1.1. <a href="#or-mapping-s1-1">Doctype</a></dt><dt>5.1.2. <a href="#or-mapping-s1-2">hibernate-mapping</a></dt><dt>5.1.3. <a href="#or-mapping-s1-3">class</a></dt><dt>5.1.4. <a href="#or-mapping-s1-4">id</a></dt><dd><dl><dt>5.1.4.1. <a href="#or-mapping-s1-4--generator">generator</a></dt><dt>5.1.4.2. <a href="#or-mapping-s1-4-hilo">&#39640;/&#20302;&#20301;&#31639;&#27861;&#65288;Hi/Lo Algorithm&#65289;</a></dt><dt>5.1.4.3. <a href="#or-mapping-s1-4-uuid">UUID&#31639;&#27861;&#65288;UUID Algorithm &#65289;</a></dt><dt>5.1.4.4. <a href="#or-mapping-s1-4-sequences">&#26631;&#35782;&#23383;&#27573;&#21644;&#24207;&#21015;&#65288;Identity Columns and Sequences&#65289;</a></dt><dt>5.1.4.5. <a href="#or-mapping-s1-4-assigned">&#31243;&#24207;&#20998;&#37197;&#30340;&#26631;&#35782;&#31526;&#65288;Assigned Identifiers&#65289;</a></dt></dl></dd><dt>5.1.5. <a href="#or-mapping-s1-4b">composite-id &#32852;&#21512;ID</a></dt><dt>5.1.6. <a href="#or-mapping-s1-5">&#35782;&#21035;&#22120;&#65288;discriminator&#65289;</a></dt><dt>5.1.7. <a href="#or-mapping-s1-6">&#29256;&#26412;&#65288;version&#65289;(&#21487;&#36873;)</a></dt><dt>5.1.8. <a href="#or-mapping-s1-6b">&#26102;&#38388;&#25139;&#65288;timestamp &#65289;(&#21487;&#36873;)</a></dt><dt>5.1.9. <a href="#or-mapping-s1-7">property</a></dt><dt>5.1.10. <a href="#or-mapping-s1-8">&#22810;&#23545;&#19968;&#65288;many-to-one&#65289;</a></dt><dt>5.1.11. <a href="#or-mapping-s1-9">&#19968;&#23545;&#19968;</a></dt><dt>5.1.12. <a href="#or-mapping-s1-10">&#32452;&#20214;&#65288;component&#65289;, &#21160;&#24577;&#32452;&#20214;&#65288;dynamic-component&#65289;</a></dt><dt>5.1.13. <a href="#or-mapping-s1-11">&#23376;&#31867;(subclass)</a></dt><dt>5.1.14. <a href="#or-mapping-s1-11b">&#36830;&#25509;&#30340;&#23376;&#31867;&#65288;joined-subclass&#65289;</a></dt><dt>5.1.15. <a href="#or-mapping-s1-12">map, set, list, bag</a></dt><dt>5.1.16. <a href="#or-mapping-s1-13">&#24341;&#29992;&#65288;import&#65289;</a></dt></dl></dd><dt>5.2. <a href="#or-mapping-s2">Hibernate &#30340;&#31867;&#22411;</a></dt><dd><dl><dt>5.2.1. <a href="#or-mapping-s2-1">&#23454;&#20307;&#65288;Entities&#65289;&#21644;&#20540;&#65288;values&#65289;</a></dt><dt>5.2.2. <a href="#or-mapping-s2-2">&#22522;&#26412;&#20540;&#31867;&#22411;</a></dt><dt>5.2.3. <a href="#or-mapping-s2-3">&#25345;&#20037;&#21270;&#26522;&#20030;&#65288;Persistent enum&#65289;&#31867;&#22411;</a></dt><dt>5.2.4. <a href="#or-mapping-s2-4">&#33258;&#23450;&#20041;&#20540;&#31867;&#22411;</a></dt><dt>5.2.5. <a href="#or-mapping-s2-5">&#26144;&#23556;&#21040;"&#20219;&#24847;"(any)&#31867;&#22411;</a></dt></dl></dd><dt>5.3. <a href="#or-mapping-s3">SQL&#20013;&#24341;&#21495;&#21253;&#22260;&#30340;&#26631;&#35782;&#31526;</a></dt><dt>5.4. <a href="#or-mapping-s4">&#33258;&#23450;&#20041;DDL</a></dt><dt>5.5. <a href="#or-mapping-s5">&#26144;&#23556;&#25991;&#20214;&#30340;&#27169;&#22359;&#21270;&#65288;Modular mapping files&#65289;</a></dt></dl></dd><dt>6. <a href="#collections">&#38598;&#21512;&#31867;(Collections)</a></dt><dd><dl><dt>6.1. <a href="#collections-s1-1">&#25345;&#20037;&#21270;&#38598;&#21512;&#31867;(Persistent Collections)</a></dt><dt>6.2. <a href="#collections-s1-3">&#26144;&#23556;&#38598;&#21512;&#65288;Mapping a Collection&#65289;</a></dt><dt>6.3. <a href="#collections-s1-5">&#20540;&#38598;&#21512;&#21644;&#22810;&#23545;&#22810;&#20851;&#32852;(Collections of Values and Many To Many Associations)</a></dt><dt>6.4. <a href="#collections-s1-6">&#19968;&#23545;&#22810;&#20851;&#32852;&#65288;One To Many Associations&#65289;</a></dt><dt>6.5. <a href="#collections-s1-7">&#24310;&#36831;&#21021;&#22987;&#21270;(&#24310;&#36831;&#21152;&#36733;)&#65288;Lazy Initialization&#65289;</a></dt><dt>6.6. <a href="#collections-s1-8a">&#38598;&#21512;&#25490;&#24207;&#65288;Sorted Collections&#65289;</a></dt><dt>6.7. <a href="#collections-s1-8b">&#23545;collection&#25490;&#24207;&#30340;&#20854;&#20182;&#26041;&#27861;&#65288;Other Ways To Sort a Collection&#65289;</a></dt><dt>6.8. <a href="#collections-s1-9">&#22403;&#22334;&#25910;&#38598;&#65288;Garbage Collection&#65289;</a></dt><dt>6.9. <a href="#collections-s1-10">&#21452;&#21521;&#20851;&#32852;&#65288;Bidirectional Associations&#65289;</a></dt><dt>6.10. <a href="#collections-s1-11a">&#19977;&#37325;&#20851;&#32852;&#65288;Ternary Associations&#65289;</a></dt><dt>6.11. <a href="#collections-s1-11b">&#24322;&#31867;&#20851;&#32852;(Heterogeneous Associations)</a></dt><dt>6.12. <a href="#collections-s1-12">&#38598;&#21512;&#20363;&#23376;&#65288;Collection Example&#65289;</a></dt><dt>6.13. <a href="#collections-s1-13">&lt;idbag&gt;</a></dt></dl></dd><dt>7. <a href="#components">&#32452;&#20214;&#65288;Components&#65289;</a></dt><dd><dl><dt>7.1. <a href="#components-s2-1">&#20316;&#20026;&#20381;&#36182;&#30340;&#23545;&#35937;&#65288;As Dependent Objects&#65289;</a></dt><dt>7.2. <a href="#components-s2-2">In Collections</a></dt><dt>7.3. <a href="#components-s2-2b">&#20316;&#20026;&#19968;&#20010;Map&#30340;&#32034;&#24341;&#65288;As a Map Index &#65289;</a></dt><dt>7.4. <a href="#components-s2-3">&#20316;&#20026;&#32852;&#21512;&#26631;&#35782;&#31526;(As Composite Identifiers)</a></dt><dt>7.5. <a href="#components-s2-4">&#21160;&#24577;&#32452;&#20214; &#65288;Dynamic components&#65289;</a></dt></dl></dd><dt>8. <a href="#manipulating-data">&#25805;&#20316;&#25345;&#20037;&#21270;&#25968;&#25454;(Manipulating Persistent Data)</a></dt><dd><dl><dt>8.1. <a href="#manipulating-data-s1">&#21019;&#24314;&#19968;&#20010;&#25345;&#20037;&#21270;&#23545;&#35937;</a></dt><dt>8.2. <a href="#manipulating-data-s2">&#35013;&#36733;&#23545;&#35937;</a></dt><dt>8.3. <a href="#manipulating-data-s3">Querying</a></dt><dd><dl><dt>8.3.1. <a href="#manipulating-data-s4">&#26631;&#37327;&#26597;&#35810;&#65288;Scalar query&#65289;</a></dt><dt>8.3.2. <a href="#manipulating-data-s5">&#26597;&#35810;&#25509;&#21475;&#65288;Query interface&#65289;</a></dt><dt>8.3.3. <a href="#manipulating-data-s5b">&#21487;&#28378;&#21160;&#36845;&#20195;(Scrollable iteration)</a></dt><dt>8.3.4. <a href="#manipulating-data-s6">&#36807;&#28388;&#38598;&#21512;&#31867;(Filtering collections)</a></dt><dt>8.3.5. <a href="#manipulating-data-s6b">&#26465;&#20214;&#26597;&#35810;</a></dt><dt>8.3.6. <a href="#manipulating-data-s6bc">&#20351;&#29992;&#26412;&#22320;SQL&#30340;&#26597;&#35810;</a></dt></dl></dd><dt>8.4. <a href="#manipulating-data-s7">&#26356;&#25913;&#22312;&#24403;&#21069;session&#20013;&#20445;&#23384;&#25110;&#32773;&#35013;&#36733;&#30340;&#23545;&#35937;</a></dt><dt>8.5. <a href="#manipulating-data-s8">&#26356;&#25913;&#22312;&#20197;&#21069;session&#20013;&#20445;&#23384;&#25110;&#32773;&#35013;&#36733;&#30340;&#23545;&#35937;</a></dt><dt>8.6. <a href="#manipulating-data-s8b">&#25226;&#22312;&#20808;&#21069;&#30340;session&#20013;&#20445;&#23384;&#25110;&#35013;&#36733;&#30340;&#23545;&#35937;&#37325;&#26032;&#19982;&#26032;session&#24314;&#31435;&#20851;&#32852;(reassociate)</a></dt><dt>8.7. <a href="#manipulating-data-s9">&#21024;&#38500;&#25345;&#20037;&#21270;&#23545;&#35937;</a></dt><dt>8.8. <a href="#manipulating-data-s10">&#23545;&#35937;&#22270;&#65288;Graphs of objects&#65289;</a></dt><dd><dl><dt>8.8.1. <a href="#manipulating-data-s11a">&#33258;&#21160;&#31649;&#29702;&#29983;&#21629;&#21608;&#26399;&#30340;&#23545;&#35937;&#65288;lifecycle object&#65289;</a></dt><dt>8.8.2. <a href="#manipulating-data-s11b">&#36890;&#36807;&#21487;&#35302;&#21450;&#24615;&#20915;&#23450;&#25345;&#20037;&#21270;&#65288;Persistence by Reachability&#65289;</a></dt></dl></dd><dt>8.9. <a href="#manipulating-data-s12">&#28165;&#27927;(Flushing) -- &#36825;&#20010;&#35789;&#24456;&#38590;&#32763;&#35793;&#65292;&#19981;&#33021;&#20351;&#29992;&#8220;&#21047;&#26032;&#8221;&#65292;&#22240;&#20026;&#21047;&#26032;&#19968;&#35789;&#24050;&#32463;&#34987;"refresh"&#20351;&#29992;&#20102;&#12290;&#26377;&#20160;&#20040;&#22909;&#30340;&#24314;&#35758;&#65311;</a></dt><dt>8.10. <a href="#manipulating-data-s13">&#32467;&#26463;&#19968;&#20010;Session</a></dt><dd><dl><dt>8.10.1. <a href="#manipulating-data-s13-1">&#28165;&#27927;(Flush)session</a></dt><dt>8.10.2. <a href="#manipulating-data-s13-2">&#25552;&#20132;&#20107;&#21153;</a></dt><dt>8.10.3. <a href="#manipulating-data-s13-3">&#20851;&#38381;session</a></dt><dt>8.10.4. <a href="#manipulating-data-s13-4">&#22788;&#29702;&#24322;&#24120;</a></dt></dl></dd><dt>8.11. <a href="#manipulating-data-s15">&#25318;&#25130;&#22120;(Interceptors)</a></dt><dt>8.12. <a href="#manipulating-data-s16">&#20803;&#25968;&#25454;(Metadata) API</a></dt></dl></dd><dt>9. <a href="#parent-child">&#29238;&#23376;&#20851;&#31995;(Parent Child Relationships)</a></dt><dd><dl><dt>9.1. <a href="#parent-child-collections">&#20851;&#20110;collections</a></dt><dt>9.2. <a href="#parent-child-bidir">&#21452;&#21521;&#30340;&#19968;&#23545;&#22810;&#20851;&#31995;(Bidirectional one to many)</a></dt><dt>9.3. <a href="#parent-child-cascades">&#32423;&#32852;&#65288;Cascades&#65289;</a></dt><dt>9.4. <a href="#parent-child-update">&#32423;&#32852;&#26356;&#26032;&#65288;Using cascading update()&#65289;</a></dt><dt>9.5. <a href="#parent-child-conclusion">&#32467;&#35770;</a></dt></dl></dd><dt>10. <a href="#query-language">Hibernate&#26597;&#35810;&#35821;&#35328;(Query Language), &#21363;HQL</a></dt><dd><dl><dt>10.1. <a href="#query-language-s1">&#22823;&#23567;&#20889;&#25935;&#24863;&#24615;(Case Sensitivity)</a></dt><dt>10.2. <a href="#query-language-s2">from &#23376;&#21477;</a></dt><dt>10.3. <a href="#query-language-s3">&#32852;&#21512;&#65288;Associations&#65289;&#21644;&#36830;&#25509;&#65288;joins&#65289;</a></dt><dt>10.4. <a href="#query-language-s4">select&#23376;&#21477;</a></dt><dt>10.5. <a href="#query-language-s4a">&#32479;&#35745;&#20989;&#25968;(Aggregate functions)</a></dt><dt>10.6. <a href="#query-language-s4b">&#22810;&#24577;(polymorphism)</a></dt><dt>10.7. <a href="#query-language-s5">where&#23376;&#21477;</a></dt><dt>10.8. <a href="#query-language-s6">&#34920;&#36798;&#24335;(Expressions)</a></dt><dt>10.9. <a href="#query-language-s7">order by &#23376;&#21477;</a></dt><dt>10.10. <a href="#query-language-s8">group by &#23376;&#21477;</a></dt><dt>10.11. <a href="#query-language-s9">&#23376;&#26597;&#35810;</a></dt><dt>10.12. <a href="#query-language-s10">&#31034;&#20363;</a></dt><dt>10.13. <a href="#query-language-s11">&#25552;&#31034;&#21644;&#25216;&#24039;&#65288;Tips &amp; Tricks&#65289;</a></dt></dl></dd><dt>11. <a href="#worked-example">&#23454;&#20363;(A Worked Example)</a></dt><dd><dl><dt>11.1. <a href="#worked-example-classes">&#25345;&#20037;&#21270;&#31867;</a></dt><dt>11.2. <a href="#worked-example-mappings">Hibernate &#26144;&#23556;</a></dt><dt>11.3. <a href="#worked-example-code">Hibernate &#20195;&#30721;</a></dt></dl></dd><dt>12. <a href="#performance">&#24615;&#33021;&#25552;&#21319;&#65288;Improving Performance&#65289;</a></dt><dd><dl><dt>12.1. <a href="#performance-s4">&#29992;&#20110;&#24310;&#36831;&#35013;&#36733;&#30340;&#20195;&#29702;</a></dt><dt>12.2. <a href="#performance-s3">&#31532;&#20108;&#23618;&#32531;&#23384;(The Second Level Cache)s</a></dt><dd><dl><dt>12.2.1. <a href="#performance-s3-1">&#26144;&#23556;(Mapping)</a></dt><dt>12.2.2. <a href="#performance-s3-2">&#21482;&#35835;&#32531;&#23384;</a></dt><dt>12.2.3. <a href="#performance-s3-3">&#35835;/&#20889;&#32531;&#23384;</a></dt><dt>12.2.4. <a href="#performance-s3-4">&#19981;&#20005;&#26684;&#30340;&#35835;/&#20889;&#32531;&#23384;</a></dt><dt>12.2.5. <a href="#performance-s3-5">&#20107;&#21153;&#32531;&#23384;&#65288;transactional&#65289;</a></dt></dl></dd><dt>12.3. <a href="#performance-s5">&#31649;&#29702;Session&#32531;&#23384;</a></dt><dt>12.4. <a href="#performance-s6">&#26597;&#35810;&#32531;&#23384;(Query Cache)</a></dt></dl></dd><dt>13. <a href="#collection-performance">&#29702;&#35299;&#38598;&#21512;&#31867;&#30340;&#24615;&#33021;&#65288;Understanding Collection Performance&#65289;</a></dt><dd><dl><dt>13.1. <a href="#collection-performance-taxonomy">&#20998;&#31867;&#65288;Taxonomy&#65289;</a></dt><dt>13.2. <a href="#collection-performance-mostefficient-1">Lists, maps &#21644;sets&#29992;&#20110;&#26356;&#26032;&#25928;&#29575;&#26368;&#39640;</a></dt><dt>13.3. <a href="#collection-performance-mostefficient-2">Bag&#21644;list&#26159;&#21453;&#21521;&#38598;&#21512;&#31867;&#20013;&#25928;&#29575;&#26368;&#39640;&#30340;</a></dt><dt>13.4. <a href="#collection-performance-oneshotdelete">&#19968;&#27425;&#24615;&#21024;&#38500;(One shot delete)</a></dt></dl></dd><dt>14. <a href="#query-criteria">&#26465;&#20214;&#26597;&#35810;(Criteria Query)</a></dt><dd><dl><dt>14.1. <a href="#query-criteria-s1">&#21019;&#24314;&#19968;&#20010;Criteria&#23454;&#20363;</a></dt><dt>14.2. <a href="#query-criteria-s2">&#32553;&#23567;&#32467;&#26524;&#38598;&#33539;&#22260;</a></dt><dt>14.3. <a href="#query-criteria-s3">&#23545;&#32467;&#26524;&#25490;&#24207;</a></dt><dt>14.4. <a href="#query-criteria-s4">&#20851;&#32852;&#65288;Associations&#65289;</a></dt><dt>14.5. <a href="#query-criteria-s5">&#21160;&#24577;&#20851;&#32852;&#23545;&#35937;&#33719;&#21462;&#65288;Dynamic association fetching&#65289;</a></dt><dt>14.6. <a href="#query-criteria-s6">&#26681;&#25454;&#31034;&#20363;&#26597;&#35810;&#65288;Example queries&#65289;</a></dt></dl></dd><dt>15. <a href="#query-sql">SQL&#26597;&#35810;</a></dt><dd><dl><dt>15.1. <a href="#query-sql-s1">&#21019;&#24314;&#19968;&#20010;&#22522;&#20110;SQL&#30340;Query</a></dt><dt>15.2. <a href="#query-sql-s2">&#21035;&#21517;&#21644;&#23646;&#24615;&#24341;&#29992;</a></dt><dt>15.3. <a href="#query-sql-s3">&#20026;SQL&#26597;&#35810;&#21629;&#21517;</a></dt></dl></dd><dt>16. <a href="#inheritance">&#32487;&#25215;&#26144;&#23556;(Inheritance Mappings)</a></dt><dd><dl><dt>16.1. <a href="#inheritance-s1">&#19977;&#31181;&#31574;&#30053;</a></dt><dt>16.2. <a href="#inheritance-s2">&#38480;&#21046;</a></dt></dl></dd><dt>17. <a href="#transactions">&#20107;&#21153;&#21644;&#24182;&#34892;&#65288;Transactions And Concurrency&#65289;</a></dt><dd><dl><dt>17.1. <a href="#transactions-s1">&#37197;&#32622;&#65292;&#20250;&#35805;&#21644;&#24037;&#21378;&#65288;Configurations, Sessions and Factories&#65289;</a></dt><dt>17.2. <a href="#transactions-s2">&#32447;&#31243;&#21644;&#36830;&#25509;&#65288;Threads and connections&#65289;</a></dt><dt>17.3. <a href="#transactions-s3">&#20048;&#35266;&#38145;&#23450;&#65295;&#29256;&#26412;&#21270;&#65288;Optimistic Locking / Versioning&#65289;</a></dt><dd><dl><dt>17.3.1. <a href="#transactions-s3-1">&#20351;&#29992;&#38271;&#29983;&#21629;&#21608;&#26399;&#24102;&#26377;&#33258;&#21160;&#29256;&#26412;&#21270;&#30340;&#20250;&#35805;</a></dt><dt>17.3.2. <a href="#transactions-s3-2">&#20351;&#29992;&#24102;&#26377;&#33258;&#21160;&#29256;&#26412;&#21270;&#30340;&#22810;&#20010;&#20250;&#35805;</a></dt><dt>17.3.3. <a href="#transactions-s3-3">&#24212;&#29992;&#31243;&#24207;&#33258;&#24049;&#36827;&#34892;&#29256;&#26412;&#26816;&#26597;</a></dt></dl></dd><dt>17.4. <a href="#transactions-s4">&#20250;&#35805;&#26029;&#24320;&#36830;&#25509;&#65288;Session disconnection&#65289;</a></dt><dt>17.5. <a href="#transactions-s5">&#24754;&#35266;&#38145;&#23450;&#65288;Pessimistic Locking&#65289;</a></dt></dl></dd><dt>18. <a href="#examples">&#26144;&#23556;&#23454;&#20363;(Mapping Examples)</a></dt><dd><dl><dt>18.1. <a href="#examples-s0">&#38599;&#21592;&#65295;&#38599;&#20027;&#65288;Employer/Employee&#65289;</a></dt><dt>18.2. <a href="#examples-s1">&#20316;&#32773;&#65295;&#33879;&#20316;(Author/Work)</a></dt><dt>18.3. <a href="#examples-s2">&#23458;&#25143;&#65295;&#35746;&#21333;&#65295;&#20135;&#21697;(Customer/Order/Product)</a></dt></dl></dd><dt>19. <a href="#toolsetguide">&#24037;&#20855;&#31665;&#25351;&#21335;</a></dt><dd><dl><dt>19.1. <a href="#toolsetguide-s1">Schema &#29983;&#25104;&#22120;&#65288;Schema Generation&#65289;</a></dt><dd><dl><dt>19.1.1. <a href="#toolsetguide-s1-2">&#23545;schema&#23450;&#21046;&#21270;(Customizing the schema)</a></dt><dt>19.1.2. <a href="#toolsetguide-s1-3">&#36816;&#34892;&#35813;&#24037;&#20855;</a></dt><dt>19.1.3. <a href="#toolsetguide-s1-4">&#23646;&#24615;(Properties)</a></dt><dt>19.1.4. <a href="#toolsetguide-s1-5">&#20351;&#29992;Ant(Using Ant)</a></dt><dt>19.1.5. <a href="#toolsetguide-s1-6">&#23545;schema&#30340;&#22686;&#37327;&#26356;&#26032;(Incremental schema updates)</a></dt><dt>19.1.6. <a href="#toolsetguide-s1-7">&#29992;Ant&#26469;&#22686;&#37327;&#26356;&#26032;schema(Using Ant for incremental schema updates)</a></dt></dl></dd><dt>19.2. <a href="#toolsetguide-s2">&#20195;&#30721;&#29983;&#25104;&#65288;Code Generation&#65289;</a></dt><dd><dl><dt>19.2.1. <a href="#toolsetguide-s2-1">&#37197;&#32622;&#25991;&#20214;(&#21487;&#36873;)</a></dt><dt>19.2.2. <a href="#toolsetguide-s2-2">meta&#23646;&#24615;</a></dt><dt>19.2.3. <a href="#toolsetguide-s2-3">&#22522;&#26412;&#30340;finder&#29983;&#25104;&#22120;&#65288;Basic finder generator&#65289;</a></dt><dt>19.2.4. <a href="#toolsetguide-s2-4">&#22522;&#20110;Velocity&#30340;&#28210;&#26579;&#22120;/&#29983;&#25104;&#22120;(Velocity based renderer/generator)</a></dt></dl></dd><dt>19.3. <a href="#toolsetguide-s3">&#26144;&#23556;&#25991;&#20214;&#29983;&#25104;&#22120;&#65288;Mapping File Generation&#65289;</a></dt><dd><dl><dt>19.3.1. <a href="#toolsetguide-s3-1">&#36816;&#34892;&#27492;&#24037;&#20855;</a></dt></dl></dd></dl></dd><dt>20. <a href="#best-practices">&#26368;&#20339;&#23454;&#36341;(Best Practices)</a></dt></dl></div><div class="preface" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="d0e10"></a>&#21069;&#35328;</h2></div></div><div></div></div><p>            &#22312;&#20170;&#26085;&#30340;&#20225;&#19994;&#29615;&#22659;&#20013;&#65292;&#25226;&#38754;&#21521;&#23545;&#35937;&#30340;&#36719;&#20214;&#21644;&#20851;&#31995;&#25968;&#25454;&#24211;&#19968;&#36215;&#20351;&#29992;&#21487;&#33021;&#26159;&#30456;&#24403;&#40635;&#28902;&#12289;&#28010;&#36153;&#26102;&#38388;&#30340;&#12290;Hibernate&#26159;&#19968;&#20010;&#38754;&#21521;Java&#29615;&#22659;&#30340;&#23545;&#35937;/&#20851;&#31995;&#25968;&#25454;&#24211;&#26144;&#23556;&#24037;&#20855;&#12290;&#23545;&#35937;/&#20851;&#31995;&#25968;&#25454;&#24211;&#26144;&#23556;(object/relational mapping (ORM))&#36825;&#20010;&#26415;&#35821;&#34920;&#31034;&#19968;&#31181;&#25216;&#26415;&#65292;&#29992;&#26469;&#25226;&#23545;&#35937;&#27169;&#22411;&#34920;&#31034;&#30340;&#23545;&#35937;&#26144;&#23556;&#21040;&#22522;&#20110;SQL&#30340;&#20851;&#31995;&#27169;&#22411;&#32467;&#26500;&#20013;&#21435;&#12290;		</p><p>            Hibernate&#19981;&#20165;&#20165;&#31649;&#29702;Java&#31867;&#21040;&#25968;&#25454;&#24211;&#34920;&#30340;&#26144;&#23556;&#65292;&#36824;&#25552;&#20379;&#25968;&#25454;&#26597;&#35810;&#21644;&#33719;&#21462;&#25968;&#25454;&#30340;&#26041;&#27861;&#65292;&#21487;&#20197;&#22823;&#24133;&#24230;&#20943;&#23569;&#24320;&#21457;&#26102;&#20154;&#24037;&#20351;&#29992;SQL&#21644;JDBC&#22788;&#29702;&#25968;&#25454;&#30340;&#26102;&#38388;&#12290;Hibernate&#30340;&#30446;&#26631;&#26159;&#23545;&#20110;&#24320;&#21457;&#32773;&#36890;&#24120;&#30340;&#25968;&#25454;&#25345;&#20037;&#21270;&#30456;&#20851;&#30340;&#32534;&#31243;&#20219;&#21153;&#65292;&#35299;&#25918;&#20854;&#20013;&#30340;95%&#12290;        </p><p>            &#22914;&#26524;&#20320;&#23545;Hibernate&#21644;&#23545;&#35937;/&#20851;&#31995;&#25968;&#25454;&#24211;&#26144;&#23556;&#36824;&#26159;&#20010;&#26032;&#25163;&#65292;&#25110;&#32773;&#29978;&#33267;&#23545;Java&#20063;&#19981;&#29087;&#24713;&#65292;&#35831;&#25353;&#29031;&#19979;&#38754;&#30340;&#27493;&#39588;&#26469;&#23398;&#20064;&#12290;        </p><div class="orderedlist"><ol type="1"><li><p>                    &#38405;&#35835;&#36825;&#20010;30&#20998;&#38047;&#23601;&#21487;&#20197;&#32467;&#26463;&#30340;<a href="#quickstart" title="Chapter&nbsp;1.&nbsp;&#22312;Tomcat&#20013;&#24555;&#36895;&#19978;&#25163;">Chapter&nbsp;1, <i>&#22312;Tomcat&#20013;&#24555;&#36895;&#19978;&#25163;</i></a>&#65292;&#23427;&#20351;&#29992;Tomcat&#12290;                </p></li><li><p>                    &#38405;&#35835;<a href="#architecture" title="Chapter&nbsp;2.&nbsp;&#20307;&#31995;&#32467;&#26500;">Chapter&nbsp;2, <i>&#20307;&#31995;&#32467;&#26500;</i></a>&#26469;&#29702;&#35299;Hibernate&#21487;&#20197;&#20351;&#29992;&#30340;&#29615;&#22659;&#12290;                </p></li><li><p>                    &#26597;&#30475;Hibernate&#21457;&#34892;&#21253;&#20013;&#30340;<tt class="literal">eg/</tt>&#30446;&#24405;&#65292;&#37324;&#38754;&#26377;&#19968;&#20010;&#31616;&#21333;&#30340;&#29420;&#31435;&#36816;&#34892;&#30340;&#31243;&#24207;&#12290;&#25226;&#20320;&#30340;JDBC&#39537;&#21160;&#25335;&#36125;&#21040;<tt class="literal">lib/</tt>&#30446;&#24405;&#19979;&#65292;&#20462;&#25913;&#19968;&#19979;<tt class="literal">src/hibernate.properties</tt>,&#25351;&#23450;&#20854;&#20013;&#20320;&#30340;&#25968;&#25454;&#24211;&#30340;&#20449;&#24687;&#12290;&#36827;&#20837;&#21629;&#20196;&#34892;&#65292;&#20999;&#25442;&#21040;&#20320;&#30340;&#21457;&#34892;&#21253;&#30340;&#30446;&#24405;&#65292;&#36755;&#20837;<tt class="literal">ant eg</tt>(&#20351;&#29992;&#20102;Ant&#65289;&#65292;&#25110;&#32773;&#22312;Windows&#25805;&#20316;&#31995;&#32479;&#20013;&#20351;&#29992;<tt class="literal">build eg</tt>&#12290;                </p></li><li><p>                    &#25226;&#36825;&#20221;&#21442;&#32771;&#25991;&#26723;&#20316;&#20026;&#20320;&#23398;&#20064;&#30340;&#20027;&#35201;&#20449;&#24687;&#26469;&#28304;&#12290;                </p></li><li><p>					&#22312;Hibernate &#30340;&#32593;&#31449;&#19978;&#21487;&#20197;&#25214;&#21040;&#32463;&#24120;&#25552;&#38382;&#30340;&#38382;&#39064;&#19982;&#35299;&#31572;(FAQ)&#12290;				</p></li><li><p>					&#22312;Hibernate&#32593;&#31449;&#19978;&#36824;&#26377;&#31532;&#19977;&#26041;&#30340;&#28436;&#31034;&#12289;&#31034;&#20363;&#21644;&#25945;&#31243;&#30340;&#38142;&#25509;&#12290;				</p></li><li><p>                    Hibernate&#32593;&#31449;&#30340;&#8220;&#31038;&#21306;(Community Area)&#8221;&#26159;&#35752;&#35770;&#20851;&#20110;&#35774;&#35745;&#27169;&#24335;&#20197;&#21450;&#24456;&#22810;&#25972;&#21512;&#26041;&#26696;(Tomcat, JBoss, Spring,Struts, EJB,&#31561;&#31561;)&#30340;&#22909;&#22320;&#26041;&#12290;                </p></li><li><p>                    &#31163;&#32447;&#29256;&#26412;&#30340;Hibernate&#32593;&#31449;&#38543;&#30528;Hibernate&#21457;&#34892;&#21253;&#19968;&#36215;&#21457;&#24067;&#65292;&#20301;&#20110;<tt class="literal">doc/</tt>&#30446;&#24405;&#19979;&#12290;                </p></li></ol></div><p>             &#22914;&#26524;&#20320;&#26377;&#38382;&#39064;&#65292;&#35831;&#20351;&#29992;Hibernate&#32593;&#31449;&#19978;&#38142;&#25509;&#30340;&#29992;&#25143;&#35770;&#22363;&#12290;&#25105;&#20204;&#20063;&#25552;&#20379;&#19968;&#20010;JIRA&#38382;&#39064;&#36861;&#36394;&#31995;&#32479;&#65292;&#26469;&#25628;&#38598;bug&#25253;&#21578;&#21644;&#26032;&#21151;&#33021;&#35831;&#27714;&#12290;&#22914;&#26524;&#20320;&#23545;&#24320;&#21457;Hibernate&#26377;&#20852;&#36259;&#65292;&#35831;&#21152;&#20837;&#24320;&#21457;&#32773;&#30340;&#37038;&#20214;&#21015;&#34920;&#12290;             &#65288;&#35793;&#32773;&#27880;:&#30446;&#21069;Hibernate&#24050;&#32463;&#26377;&#19968;&#20010;&#20013;&#25991;&#30340;&#29992;&#25143;&#35770;&#22363;&#65292;URL&#26159;http://forum.hibernate.org.cn &#25105;&#20204;&#38543;&#26102;&#27426;&#36814;&#24744;&#30340;&#35775;&#38382;&#12290;&#65289;         </p><p>         &#32763;&#35793;&#35828;&#26126;         </p><p>         =========================================================         </p><p>         	&#26412;&#25991;&#26723;&#30340;&#32763;&#35793;&#26159;&#22312;&#32593;&#32476;&#19978;&#21327;&#20316;&#36827;&#34892;&#30340;&#65292;&#20063;&#20250;&#19981;&#26029;&#26681;&#25454;Hibernate&#30340;&#21319;&#32423;&#36827;&#34892;&#26356;&#26032;&#12290;&#25552;&#20379;&#27492;&#25991;&#26723;&#30340;&#30446;&#30340;&#26159;&#20026;&#20102;&#20943;&#32531;&#23398;&#20064;Hibernate&#30340;&#22369;&#24230;&#65292;&#32780;&#38750;&#20195;&#26367;&#21407;&#25991;&#26723;&#12290;&#25105;&#20204;&#24314;&#35758;&#25152;&#26377;&#26377;&#33021;&#21147;&#30340;&#35835;&#32773;&#37117;&#30452;&#25509;&#38405;&#35835;&#33521;&#25991;&#21407;&#25991;&#12290;         </p><p>         	&#33509;&#24744;&#23545;&#32763;&#35793;&#26377;&#24322;&#35758;&#65292;&#25110;&#21457;&#29616;&#32763;&#35793;&#38169;&#35823;&#65292;&#25964;&#35831;&#19981;&#21533;&#36176;&#25945;&#65292;&#35831;&#21040;Hibernate&#20013;&#25991;&#35770;&#22363;(http://forum.hibernate.org.cn)&#25552;&#20986;,&#25110;&#25253;&#21578;&#21040;&#22914;&#19979;email&#22320;&#22336;&#65306;caoxg at redsaga.com         </p><p>         &#31532;6&#31456;(&#38598;&#21512;&#31867;)&#12289;&#31532;7&#31456;(&#32452;&#20214;)&#26159;&#30001;jlinux&#32763;&#35793;&#65292;&#31532;10&#31456;&#65288;&#29238;&#23376;&#20851;&#31995;&#65289;&#26159;&#30001;muziq&#32763;&#35793;&#65292;&#31532;16&#31456;(&#20107;&#21153;&#21644;&#24182;&#34892;)&#12289;&#31532;17&#31456;&#65288;&#26144;&#23556;&#23454;&#20363;&#65289;&#26159;&#30001;liangchen&#32763;&#35793;&#65292;&#20854;&#20182;&#21508;&#31456;&#33410;&#26159;&#30001;&#26361;&#26195;&#38050;&#32763;&#35793;&#30340;&#65292;&#31532;18&#12289;19&#12289;20&#31456;&#65292;bruce&#12289;robbin&#20063;&#26377;&#36129;&#29486;&#12290;&#26361;&#26195;&#38050;&#20063;&#36827;&#34892;&#20102;&#20840;&#20070;&#20174;2.0.4&#26356;&#26032;&#21040;2.1.1&#29256;&#26412;&#12289;2.1.2&#29256;&#26412;&#30340;&#24037;&#20316;&#12290;         </p><p>         	&#26356;&#35814;&#32454;&#30340;&#32763;&#35793;&#32773;&#19982;&#32763;&#35793;&#26356;&#26032;&#24773;&#20917;&#65292;&#35831;&#26597;&#38405;CVS&#30446;&#24405;&#19979;&#30340;TRANSLATE-LOG.TXT&#25991;&#20214;&#12290; 		 </p><p>         &#29256;&#26435;&#22768;&#26126;         </p><p>         =========================================================         </p><p>         	Hibernate&#33521;&#25991;&#25991;&#26723;&#23646;&#20110;Hibernate&#21457;&#34892;&#21253;&#30340;&#19968;&#37096;&#20998;&#65292;&#36981;&#24490;LGPL&#21327;&#35758;&#12290;&#26412;&#32763;&#35793;&#29256;&#26412;&#21516;&#26679;&#36981;&#24490;LGPL&#21327;&#35758;&#12290;&#21442;&#19982;&#32763;&#35793;&#30340;&#35793;&#32773;&#19968;&#33268;&#21516;&#24847;&#25918;&#24323;&#38500;&#32626;&#21517;&#26435;&#22806;&#23545;&#26412;&#32763;&#35793;&#29256;&#26412;&#30340;&#20854;&#23427;&#26435;&#21033;&#35201;&#27714;&#12290; 		 </p><p>         	&#24744;&#21487;&#20197;&#33258;&#30001;&#38142;&#25509;&#12289;&#19979;&#36733;&#12289;&#20256;&#25773;&#27492;&#25991;&#26723;&#65292;&#25110;&#32773;&#25918;&#32622;&#22312;&#24744;&#30340;&#32593;&#31449;&#19978;&#65292;&#29978;&#33267;&#20316;&#20026;&#20135;&#21697;&#30340;&#19968;&#37096;&#20998;&#21457;&#34892;&#12290;&#20294;&#21069;&#25552;&#26159;&#24517;&#39035;&#20445;&#35777;&#20840;&#25991;&#23436;&#25972;&#36716;&#36733;&#65292;&#21253;&#25324;&#23436;&#25972;&#30340;&#29256;&#26435;&#20449;&#24687;&#21644;&#20316;&#35793;&#32773;&#22768;&#26126;&#12290;&#36825;&#37324;&#8220;&#23436;&#25972;&#8221;&#30340;&#21547;&#20041;&#26159;&#65292;&#19981;&#33021;&#36827;&#34892;&#20219;&#20309;&#21024;&#38500;/&#22686;&#28155;/&#27880;&#35299;&#12290;&#33509;&#26377;&#21024;&#38500;/&#22686;&#28155;/&#27880;&#35299;&#65292;&#24517;&#39035;&#26126;&#30830;&#22768;&#26126;&#37027;&#20123;&#37096;&#20998;&#24182;&#38750;&#26412;&#25991;&#26723;&#30340;&#19968;&#37096;&#20998;&#12290;         </p></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="quickstart"></a>Chapter&nbsp;1.&nbsp;&#22312;Tomcat&#20013;&#24555;&#36895;&#19978;&#25163;</h2></div></div><div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e91"></a>1.1.&nbsp;&#24320;&#22987;Hibernate&#20043;&#26053;</h2></div></div><div></div></div><p>            &#36825;&#20221;&#25945;&#31243;&#35752;&#35770;&#22914;&#20309;&#22312;Apache Tomcat servlet&#23481;&#22120;&#20013;&#20026;web&#31243;&#24207;&#23433;&#35013;Hibernate 2.1&#12290;Hibernate&#22312;&#22823;&#22810;&#25968;&#20027;&#27969;J2EE&#24212;&#29992;&#26381;&#21153;&#22120;            &#30340;&#21463;&#31649;&#29702;&#29615;&#22659;&#20013;&#37117;&#21487;&#20197;&#33391;&#22909;&#36816;&#20316;&#65292;&#20063;&#21487;&#20197;&#20316;&#20026;&#29420;&#31435;&#24212;&#29992;&#31243;&#24207;&#36816;&#34892;&#12290;&#22312;&#26412;&#20363;&#20013;&#30340;&#31034;&#20363;&#25968;&#25454;&#24211;&#31995;&#32479;&#26159;PostgreSQL 7.3,&#24403;&#28982;&#20063;&#21487;&#20197;            &#24456;&#23481;&#26131;&#30340;&#25442;&#25104;Hibernate &#25903;&#25345;&#30340;&#20854;&#23427;16&#31181;&#25968;&#25454;&#24211;&#20043;&#19968;&#12290;        </p><p>            &#31532;&#19968;&#27493;&#26159;&#25335;&#36125;&#25152;&#26377;&#38656;&#35201;&#30340;&#36816;&#34892;&#24211;&#21040;Tomcat&#21435;&#12290;&#22312;&#36825;&#31687;&#25945;&#31243;&#20013;&#65292;&#25105;&#20204;&#20351;&#29992;&#19968;&#20010;&#21333;&#29420;&#30340;web&#31243;&#24207;&#65288;<tt class="literal">webapps/quickstart</tt>&#65289;&#12290;&#25105;&#20204;&#35201;&#32771;&#34385;&#20840;&#23616;&#24211;&#25991;&#20214;&#25628;&#32034;&#36335;&#24452;&#65288;<tt class="literal">TOMCAT/common/lib</tt>&#65289;&#21644;&#26412;web&#24212;&#29992;&#31243;&#24207;&#19978;&#19979;&#25991;&#30340;&#31867;&#35013;&#36733;&#22120;&#25628;&#32034;&#36335;&#24452;&#65288;&#23545;&#20110;jar&#26469;&#35828;&#26159;<tt class="literal">webapps/quickstart/WEB-INF/lib</tt>&#65292;&#23545;&#20110;class&#25991;&#20214;&#26469;&#35828;&#26159;<tt class="literal">webapps/quickstart/WEB-INF/classes</tt>&#65289;&#12290;&#25105;&#20204;&#25226;&#36825;&#20004;&#20010;&#31867;&#35013;&#36733;&#22120;&#32423;&#21035;&#20998;&#21035;&#31216;&#20026;&#20840;&#23616;&#31867;&#36335;&#24452;(global classpath)&#21644;&#19978;&#19979;&#25991;&#31867;&#36335;&#24452;(context classpath)&#12290;        </p><div class="orderedlist"><ol type="1"><li><p>                    &#39318;&#20808;&#65292;&#25226;&#25968;&#25454;&#24211;&#38656;&#35201;&#30340;JDBC&#39537;&#21160;&#25335;&#36125;&#21040;&#20840;&#23616;&#31867;&#36335;&#24452;&#12290;&#36825;&#26159;tomcat&#38468;&#24102;&#30340;DBCP&#36830;&#25509;&#27744;&#36719;&#20214;&#25152;&#35201;&#27714;&#30340;&#12290;&#23545;&#20110;&#26412;&#25945;&#31243;&#26469;&#35828;&#65292;&#25226;<tt class="literal">pg73jdbc3.jar</tt>&#24211;&#25991;&#20214;&#65288;&#23545;&#24212;PostgreSQL 7.3&#21644;JDK 1.4)&#21040;&#20840;&#23616;&#31867;&#35013;&#36733;&#22120;&#36335;&#24452;&#21435;&#12290;&#22914;&#26524;&#20320;&#20351;&#29992;&#19968;&#20010;&#19981;&#21516;&#30340;&#25968;&#25454;&#24211;&#65292;&#25335;&#36125;&#30456;&#24212;&#30340;JDBC &#39537;&#21160;&#65289;&#12290;                </p></li><li><p>                    &#19981;&#35201;&#25335;&#36125;&#20219;&#20309;&#20854;&#20182;&#19996;&#35199;&#21040;&#20840;&#23616;&#31867;&#35013;&#36733;&#22120;&#21435;&#12290;&#21542;&#21017;&#20320;&#21487;&#33021;&#22312;&#19968;&#20123;&#24037;&#20855;&#19978;&#36935;&#21040;&#40635;&#28902;&#65292;&#27604;&#22914;log4j, commons-logging&#31561;&#12290;                    &#35760;&#24471;&#35201;&#20351;&#29992;&#27599;&#20010;web&#24212;&#29992;&#31243;&#24207;&#33258;&#24049;&#30340;&#19978;&#19979;&#25991;&#31867;&#36335;&#24452;&#65292;&#23601;&#26159;&#35828;&#25226;&#20320;&#33258;&#24049;&#30340;&#31867;&#24211;&#25335;&#36125;&#21040;<tt class="literal">WEB-INF/lib</tt>&#19979;&#21435;&#65292;&#25226;&#37197;&#32622;&#25991;&#20214;configuration/property&#25335;&#36125;&#21040;<tt class="literal">WEB-INF/classes</tt>&#19979;&#38754;&#21435;&#12290;&#36825;&#20004;&#20010;&#30446;&#24405;&#40664;&#35748;&#37117;&#26159;&#19978;&#19979;&#25991;&#31867;&#36335;&#24452;&#32423;&#21035;&#30340;&#12290;				</p></li><li><p>                    Hibernate&#26412;&#36523;&#25171;&#21253;&#25104;&#19968;&#20010;JAR&#24211;&#12290;<tt class="literal">hibernate2.jar</tt>&#25991;&#20214;&#35201;&#21644;&#20320;&#24212;&#29992;&#31243;&#24207;&#30340;&#20854;&#20182;&#24211;&#25991;&#20214;&#19968;&#36215;&#25918;&#22312;&#19978;&#19979;&#25991;&#31867;&#36335;&#24452;&#20013;&#12290;&#22312;&#36816;&#34892;&#26102;&#65292;Hibernate&#36824;&#38656;&#35201;&#19968;&#20123;&#31532;&#19977;&#26041;&#24211;&#65292;&#23427;&#20204;&#22312;Hibernate&#21457;&#34892;&#21253;&#30340;<tt class="literal">lib/</tt>&#30446;&#24405;&#19979;&#12290;&#21442;&#35265;<a href="#3rdpartylibs" title="Table&nbsp;1.1.&nbsp;&#xA;                Hibernate &#31532;&#19977;&#26041;&#24211;&#xA;            ">Table&nbsp;1.1</a>&#12290;&#25226;&#20320;&#38656;&#35201;&#30340;&#31532;&#19977;&#26041;&#24211;&#25991;&#20214;&#20063;&#25335;&#36125;&#21040;&#19978;&#19979;&#25991;&#31867;&#36335;&#24452;&#21435;&#12290;                </p></li><li><p>                    &#35201;&#20026;Tomcat&#21644;Hibernate&#37117;&#37197;&#32622;&#25968;&#25454;&#24211;&#36830;&#25509;&#12290;&#20063;&#23601;&#26159;&#35828;Tomcat&#35201;&#36127;&#36131;&#25552;&#20379;JDBC&#36830;&#25509;&#27744;&#65292;Hibernate&#36890;&#36807;JNDI&#26469;&#35831;&#27714;&#36825;&#20123;&#36830;&#25509;&#12290;Tomcat&#25226;&#36830;&#25509;&#27744;&#32465;&#23450;&#21040;JNDI&#12290;                </p></li></ol></div><div class="table"><a name="3rdpartylibs"></a><p class="title"><b>Table&nbsp;1.1.&nbsp;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -