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

📄 toolsetguide.html

📁 是一个中文的Hibernate库文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<html><head>      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">   <title>&#31532;&nbsp;21&nbsp;&#31456;&nbsp;&#24037;&#20855;&#31665;&#25351;&#21335;</title><link rel="stylesheet" href="../shared/css/html.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="HIBERNATE - &#31526;&#21512;Java&#20064;&#24815;&#30340;&#20851;&#31995;&#25968;&#25454;&#24211;&#25345;&#20037;&#21270;"><link rel="up" href="index.html" title="HIBERNATE - &#31526;&#21512;Java&#20064;&#24815;&#30340;&#20851;&#31995;&#25968;&#25454;&#24211;&#25345;&#20037;&#21270;"><link rel="previous" href="performance.html" title="&#31532;&nbsp;20&nbsp;&#31456;&nbsp;&#25552;&#21319;&#24615;&#33021;&#xA;	"><link rel="next" href="example-parentchild.html" title="&#31532;&nbsp;22&nbsp;&#31456;&nbsp;&#31034;&#20363;&#65306;&#29238;&#23376;&#20851;&#31995;(Parent Child Relationships)"></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">&#31532;&nbsp;21&nbsp;&#31456;&nbsp;&#24037;&#20855;&#31665;&#25351;&#21335;</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="performance.html">&#19978;&#19968;&#39029;</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="example-parentchild.html">&#19979;&#19968;&#39029;</a></td></tr></table><hr></div><div class="chapter" lang="zh-cn"><div class="titlepage"><div><div><h2 class="title"><a name="toolsetguide"></a>&#31532;&nbsp;21&nbsp;&#31456;&nbsp;&#24037;&#20855;&#31665;&#25351;&#21335;</h2></div></div><div></div></div><p>		&#21487;&#20197;&#36890;&#36807;&#19968;&#31995;&#21015;Eclipse&#25554;&#20214;&#12289;&#21629;&#20196;&#34892;&#24037;&#20855;&#21644;Ant&#20219;&#21153;&#26469;&#36827;&#34892;&#19982;Hibernate&#20851;&#32852;&#30340;&#36716;&#25442;&#12290;    </p><p>        &#38500;&#20102;Ant&#20219;&#21153;&#22806;&#65292;&#24403;&#21069;&#30340;<span class="emphasis"><em>Hibernate Tools</em></span>&#20063;&#21253;&#21547;&#20102;Eclipse IDE&#30340;&#25554;&#20214;&#65292;&#29992;&#20110;&#19982;&#29616;&#23384;&#25968;&#25454;&#24211;&#30340;&#36870;&#21521;&#24037;&#31243;&#12290;    </p><div class="itemizedlist"><ul type="disc"><li><p>            <span class="emphasis"><em>Mapping Editor:</em></span> Hibernate XML&#26144;&#23556;&#25991;&#20214;&#30340;&#32534;&#36753;&#22120;&#65292;&#25903;&#25345;&#33258;&#21160;&#23436;&#25104;&#21644;&#35821;&#27861;&#39640;&#20142;&#12290;&#23427;&#20063;&#25903;&#25345;&#23545;&#31867;&#21517;&#21644;&#23646;&#24615;/&#23383;&#27573;&#21517;&#30340;&#35821;&#20041;&#33258;&#21160;&#23436;&#25104;&#65292;&#27604;&#36890;&#24120;&#30340;XML&#32534;&#36753;&#22120;&#26041;&#20415;&#24471;&#22810;&#12290;        </p></li><li><p>            <span class="emphasis"><em>Console:</em></span> Console&#26159;Eclipse&#30340;&#19968;&#20010;&#26032;&#35270;&#22270;&#12290;&#38500;&#20102;&#23545;&#20320;&#30340;console&#37197;&#32622;&#30340;&#26641;&#29366;&#27010;&#35272;&#65292;&#20320;&#36824;&#21487;&#20197;&#33719;&#24471;&#23545;&#20320;&#25345;&#20037;&#21270;&#31867;&#21450;&#20854;&#20851;&#32852;&#30340;&#20132;&#20114;&#24335;&#35270;&#22270;&#12290;Console&#20801;&#35768;&#20320;&#23545;&#25968;&#25454;&#24211;&#25191;&#34892;HQL&#26597;&#35810;&#65292;&#24182;&#30452;&#25509;&#22312;Eclipse&#20013;&#27983;&#35272;&#32467;&#26524;&#12290;        </p></li><li><p>            <span class="emphasis"><em>Development Wizards:</em></span> &#22312;Hibernate Eclipse tools&#20013;&#36824;&#25552;&#20379;&#20102;&#20960;&#20010;&#21521;&#23548;&#65307;&#20320;&#21487;&#20197;&#29992;&#21521;&#23548;&#24555;&#36895;&#29983;&#25104;Hibernate &#37197;&#32622;&#25991;&#20214;&#65288;cfg.xml&#65289;&#65292;&#20320;&#29978;&#33267;&#36824;&#21487;&#20197;&#21516;&#29616;&#23384;&#30340;&#25968;&#25454;&#24211;schema&#20013;&#21453;&#21521;&#24037;&#31243;&#20986;POJO&#28304;&#20195;&#30721;&#19982;Hibernate &#26144;&#23556;&#25991;&#20214;&#12290;&#21453;&#21521;&#24037;&#31243;&#25903;&#25345;&#21487;&#23450;&#21046;&#30340;&#27169;&#29256;&#12290;        </p></li><li><p>            <span class="emphasis"><em>Ant Tasks:</em></span>        </p></li></ul></div><p>        &#35201;&#24471;&#21040;&#26356;&#22810;&#20449;&#24687;&#65292;&#35831;&#26597;&#38405; <span class="emphasis"><em>Hibernate Tools</em></span> &#21253;&#21450;&#20854;&#25991;&#26723;&#12290;    </p><p>        &#21516;&#26102;&#65292;Hibernate&#20027;&#21457;&#34892;&#21253;&#36824;&#38468;&#24102;&#20102;&#19968;&#20010;&#38598;&#25104;&#30340;&#24037;&#20855;&#65288;&#23427;&#29978;&#33267;&#21487;&#20197;&#22312;Hibernate&#8220;&#20869;&#37096;&#8221;&#24555;&#36895;&#36816;&#34892;&#65289;<span class="emphasis"><em>SchemaExport</em></span> &#65292;&#20063;&#23601;&#26159;        <tt class="literal">hbm2ddl</tt>&#12290;    </p><div class="sect1" lang="zh-cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="toolsetguide-s1"></a>21.1.&nbsp;Schema&#33258;&#21160;&#29983;&#25104;&#65288;Automatic schema generation&#65289;</h2></div></div><div></div></div><p>            &#21487;&#20197;&#20174;&#20320;&#30340;&#26144;&#23556;&#25991;&#20214;&#20351;&#29992;&#19968;&#20010;Hibernate&#24037;&#20855;&#29983;&#25104;DDL&#12290; &#29983;&#25104;&#30340;schema&#21253;&#21547;&#26377;&#23545;&#23454;&#20307;&#21644;&#38598;&#21512;&#31867;&#34920;&#30340;&#23436;&#25972;&#24615;&#24341;&#29992;&#32422;&#26463;&#65288;&#20027;&#38190;&#21644;&#22806;&#38190;&#65289;&#12290;&#28041;&#21450;&#21040;&#30340;&#26631;&#31034;&#31526;&#29983;&#25104;&#22120;&#25152;&#38656;&#30340;&#34920;&#21644;sequence&#20063;&#20250;&#21516;&#26102;&#29983;&#25104;&#12290;        </p><p>            &#22312;&#20351;&#29992;&#36825;&#20010;&#24037;&#20855;&#30340;&#26102;&#20505;&#65292;&#20320;<span class="emphasis"><em>&#24517;&#39035;</em></span> &#36890;&#36807;<tt class="literal">hibernate.dialet</tt>&#23646;&#24615;&#25351;&#23450;&#19968;&#20010;SQL<tt class="literal">&#26041;&#35328;(Dialet)</tt>&#65292;&#22240;&#20026;DDL&#26159;&#19982;&#20379;&#24212;&#21830;&#39640;&#24230;&#30456;&#20851;&#30340;&#12290;        </p><p>            &#39318;&#20808;&#65292;&#35201;&#23450;&#21046;&#20320;&#30340;&#26144;&#23556;&#25991;&#20214;&#65292;&#26469;&#25913;&#21892;&#29983;&#25104;&#30340;schema&#12290;        </p><div class="sect2" lang="zh-cn"><div class="titlepage"><div><div><h3 class="title"><a name="toolsetguide-s1-2"></a>21.1.1.&nbsp;&#23545;schema&#23450;&#21046;&#21270;(Customizing the schema)</h3></div></div><div></div></div><p>                &#24456;&#22810;Hibernate&#26144;&#23556;&#20803;&#32032;&#23450;&#20041;&#20102;&#19968;&#20010;&#21487;&#36873;&#30340;<tt class="literal">length</tt>&#23646;&#24615;&#12290;&#20320;&#21487;&#20197;&#36890;&#36807;&#36825;&#20010;&#23646;&#24615;&#35774;&#32622;&#23383;&#27573;&#30340;&#38271;&#24230;&#12290; (&#22914;&#26524;&#26159;Or, for numeric/decimal data types, the precision.)            </p><p>                &#26377;&#20123;tag&#25509;&#21463;<tt class="literal">not-null</tt>&#23646;&#24615;&#65288;&#29992;&#26469;&#22312;&#34920;&#23383;&#27573;&#19978;&#29983;&#25104;<tt class="literal">NOT NULL</tt>&#32422;&#26463;&#65289;&#21644;<tt class="literal">unique</tt>&#23646;&#24615;&#65288;&#29992;&#26469;&#22312;&#34920;&#23383;&#27573;&#19978;&#29983;&#25104;<tt class="literal">UNIQUE</tt>&#32422;&#26463;&#65289;&#12290;            </p><p>                &#26377;&#20123;tag&#25509;&#21463;<tt class="literal">index</tt>&#23646;&#24615;&#65292;&#29992;&#26469;&#25351;&#23450;&#23383;&#27573;&#30340;index&#21517;&#23383;&#12290;<tt class="literal">unique-key</tt>&#23646;&#24615;&#21487;&#20197;&#23545;&#25104;&#32452;&#30340;&#23383;&#27573;&#25351;&#23450;&#19968;&#20010;&#32452;&#21512;&#38190;&#32422;&#26463;(unit key constraint)&#12290;&#30446;&#21069;&#65292;<tt class="literal">unique-key</tt>&#23646;&#24615;&#25351;&#23450;&#30340;&#20540;<span class="emphasis"><em>&#24182;&#19981;&#20250;</em></span>&#34987;&#24403;&#20316;&#36825;&#20010;&#32422;&#26463;&#30340;&#21517;&#23383;&#65292;&#23427;&#20204;&#21482;&#26159;&#22312;&#29992;&#26469;&#22312;&#26144;&#23556;&#25991;&#20214;&#20869;&#37096;&#29992;&#20316;&#21306;&#20998;&#30340;&#12290;            </p><p>                &#31034;&#20363;&#65306;            </p><pre class="programlisting">&lt;property name="foo" type="string" length="64" not-null="true"/&gt;&lt;many-to-one name="bar" foreign-key="fk_foo_bar" not-null="true"/&gt;&lt;element column="serial_number" type="long" not-null="true" unique="true"/&gt;</pre><p>                &#21478;&#22806;&#65292;&#36825;&#20123;&#20803;&#32032;&#36824;&#25509;&#21463;<tt class="literal">&lt;column&gt;</tt>&#23376;&#20803;&#32032;&#12290;&#22312;&#23450;&#20041;&#36328;&#36234;&#22810;&#23383;&#27573;&#30340;&#31867;&#22411;&#26102;&#29305;&#21035;&#26377;&#29992;&#12290;            </p><pre class="programlisting">&lt;property name="foo" type="string"&gt;    &lt;column name="foo" length="64" not-null="true" sql-type="text"/&gt;&lt;/property&gt;&lt;property name="bar" type="my.customtypes.MultiColumnType"/&gt;    &lt;column name="fee" not-null="true" index="bar_idx"/&gt;    &lt;column name="fi" not-null="true" index="bar_idx"/&gt;    &lt;column name="fo" not-null="true" index="bar_idx"/&gt;&lt;/property&gt;</pre><p>                <tt class="literal">sql-type</tt>&#23646;&#24615;&#20801;&#35768;&#29992;&#25143;&#35206;&#30422;&#40664;&#35748;&#30340;Hibernate&#31867;&#22411;&#21040;SQL&#25968;&#25454;&#31867;&#22411;&#30340;&#26144;&#23556;&#12290;            </p><p>                <tt class="literal">check</tt>&#23646;&#24615;&#20801;&#35768;&#29992;&#25143;&#25351;&#23450;&#19968;&#20010;&#32422;&#26463;&#26816;&#26597;&#12290;            </p><pre class="programlisting">&lt;property name="foo" type="integer"&gt;    &lt;column name="foo" check="foo &gt; 10"/&gt;&lt;/property&gt;&lt;class name="Foo" table="foos" check="bar &lt; 100.0"&gt;    ...    &lt;property name="bar" type="float"/&gt;

⌨️ 快捷键说明

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