JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Object Relational Mapping » Hibernate  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to postflat modego to previous topicgo to next topic
話題被移動
該話題已被移動 - browser , 2003-07-16 02:07
如果您尚不清楚該話題被移動的原因,請參考論壇規則以及本版公告或者聯系本版版主。
本主題所含的標籤
無標籤
作者 Re:hibernate 快速入門 [Re:ray_linn]
ray_linn

什么都不懂的小白

版主

發文: 540
積分: 10
於 2003-07-16 12:14 user profilesend a private message to usersend email to ray_linnreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
The required <generator> child element names a Java class used to generate unique identifiers for instances of the persistent class. If any parameters are required to configure or initialize the generator instance, they are passed using the <param> element.

<id name="id" type="long" column="uid" unsaved-value="0">
<generator class="net.sf.hibernate.id.TableHiLoGenerator">
<param name="table">uid_table</param>
<param name="column">next_hi_value_column</param>
</generator>
</id>

All generators implement the interface net.sf.hibernate.id.IdentifierGenerator. This is a very simple interface; some applications may choose to provide their own specialized implementations. However, Hibernate provides a range of built-in implementations. There are shortcut names for the built-in generators:

increment
generates identifiers of type long, short or int that are unique only when no other process is inserting data into the same table. Do not use in a cluster.

identity
supports identity columns in DB2, MySQL, MS SQL Server, Sybase and HypersonicSQL. The returned identifier is of type long, short or int.

sequence
uses a sequence in DB2, PostgreSQL, Oracle, SAP DB, McKoi or a generator in Interbase. The returned identifier is of type long, short or int

hilo
uses a hi/lo algorithm to efficiently generate identifiers of type long, short or int, given a table and column (by default hibernate_unique_key and next respectively) as a source of hi values. The hi/lo algorithm generates identifiers that are unique only for a particular database. Do not use this generator with connections enlisted with JTA or with a user-supplied connection.

seqhilo
uses a hi/lo algorithm to efficiently generate identifiers of type long, short or int, given a named database sequence.

uuid.hex
uses a 128-bit UUID algorithm to generate identifiers of type string, unique within a network (the IP address is used). The UUID is encoded as a string of hexadecimal digits of length 32.

uuid.string
uses the same UUID algorithm. The UUID is encoded a string of length 16 consisting of (any) ASCII characters. Do not use with PostgreSQL.

native
picks identity, sequence or hilo depending upon the capabilities of the underlying database.

assigned
lets the application to assign an identifier to the object before save() is called.

foreign
uses the identifier of another associated object. Used in conjunction with a <one-to-one> association.


reply to postreply to post
飞翔的候鸟
話題樹型展開
人氣 標題 作者 字數 發文時間
28580 [精華] hibernate 快速入門 ray_linn 3636 2003-07-15 16:21
24621 Re:hibernate 快速入門 ray_linn 3871 2003-07-15 16:30
18567 Re:hibernate 快速入門 tomyoung 384 2004-11-19 21:45
23979 Re:hibernate 快速入門 imdragon 181 2003-07-16 09:48
24781 Re:hibernate 快速入門 ray_linn 2599 2003-07-16 12:14
23196 Re:hibernate 快速入門 :O) victorpen 1769 2004-03-23 19:56
22429 Re:hibernate 快速入門 :O) victorpen 613 2004-03-24 17:12
21321 Re:hibernate 快速入門 belliwu 69 2004-06-03 11:11
18198 Re:hibernate 快速入門 tomyoung 2229 2004-11-18 02:21
15865 Re:hibernate 快速入門 todayhill 81 2004-11-18 21:28
16011 Re:hibernate 快速入門 tomyoung 1041 2004-11-18 22:54
16158 Re:hibernate 快速入門 struggle 2143 2004-11-19 16:21
» JWorld@TW »  Object Relational Mapping » Hibernate

reply to postflat modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8