XDoclet uses in Hibernate
Hibernate class:
@ hibernate.class
Table = "teacher"
Hibernate subclass:
@ hibernate.joined-subclass
@ hibernate.joined-subclass-key
Column = "TEA_ID"
Programs:
@ hibernate.id
Column = "TEA_ID"
Generator-class = "native"
Ordinary property:
@ hibernate.property
COLUMN = "tea_name"
1: n (1 to more)
1 one one:
@ hibernate.set
Lazy = "true"
Cascade = "all"
Inverse = "True"
@ hibernate.collection-keycolumn = "tea_id"
@ hibernate.collection-one-to-manyclass = "tms.teacher.zbjiangcheng"
A more one:
@ hibernate.many-to-one
Column = "TEA_ID"
Class = "TMS.TEacher.zbteacher"
NOT-NULL = "True"
1: 1 (1 pair 1)
1 one one:
@ hibernate.one-to-one name = "gongzi"
Class = "tms.teacher.zbgonzi"
Cascade = "all"
1 another:
@ hibernate.one-to-one
Name = "teacher"
Class = "TMS.TEacher.zbteacher"
Constrained = "true"
And its primary key strategy should be:
@ hibernate.id
Column = "TEA_ID"
Generator-class = "foreIgn"
Unsaved-value = "0"
@ hibernate.generator-param
Name = "Property"
Value = "teacher"
Another maintenance 1: 1 relationship
(For example, a book corresponds to a book type, a book type corresponds to a multi-book, one end of the book type does not need to maintain the corresponding book, and one end of the book should maintain the corresponding to which type of book type)
@ hibernate.many-to-one
Name = "boxtype"
Column = "BookType_ID"
Cascade = "all"
NOT-NULL = "True"