Atitit. orm mapping cfg ing configuration (3) ------- hbnt one2maney cfg, atititorm
Atitit. orm mapping cfg ing configuration (3) ------- hbnt one2maney cfg
1. Create list 1
2. Configure xml 1
3. Set and List configuration in Hibernate 1
4. Bag (combined with List and Set), 2
1. Create a list
/**
* Set attributes can only be declared using interfaces. For example, in the following code, the schools type can only be List, not ArrayList, but the set attribute must be initialized using the implementation class.
*/
Public List list = new ArrayList ();
2. Configure xml
<! -- O7o ati -->
<! -- Begin indicates that the table holds a foreign key. -->
<! -- Key is a foreign key --> <! -- List is an ordered set. Therefore, a column must be added to the persistence class to indicate the order of the Set elements.
. The list element requires that the sub-element of list-index map the sub-sequence of the ordered set... jieg order col must in table def ..
Yaosi B tigon column, zeu def sh "idx"
List_order int not null,
-->
<List name = "list">
<Key column = "programme_id"/> <list-index column = "play_order"> </list-index>
<One-to-learn class = "com. focustar. programme. entity. GvProgrammeDetail"/>
</List>
Author: old wow's paw Attilax iron, EMAIL: 1466519819@qq.com
Reprinted please indicate Source: http://blog.csdn.net/attilax
3. Set and List configuration in Hibernate
(14:11:57)
Reprinted token
It |
Category: Learning Summary |
· Set ing:
<Set name = "addrs" table = "EMAIL">
<Key column = "C_ID"/>
<Element type = "string" column = "ADDRESS"/>
</Set>
· List ing:
<List name = "addrs" table = "EMAIL">
<Key column = "C_ID"/>
<Index column = "LISTINDEX">)
<Element type = "string" column = "ADDRESS"/>
</List>
Com. microsoft. sqlserver. jdbc. SQLServerException: the column name 'idx' is invalid.
4. Bag (combining List and Set ),
A set that can be repeated and has no sequence. It is provided by Hibernate. HIbernate uses the jdk List to simulate the Bag. Its configuration is basically the same as that of Hibernate List ing List.
When I use hibernate to write the hibing file hibernatecfgxml, where should the hibernate-mapping-30dtd be imported?
<? Xml version = "1.0" encoding = "UTF-8"?>
<! DOCTYPE hibernate-mapping PUBLIC "-// Hibernate/Hibernate Mapping DTD 3.0 // EN" "hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
Spring + hibernate, configure mapping in hibernatecfgxml to report an error
Von_pneumonia is good. It must be a packet problem.