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

📄 indexedcollectionofelementstest.java

📁 hibernate3.2.6源码和jar包
💻 JAVA
字号:
//$package org.hibernate.test.annotations.collectionelement.indexedCollection;import org.hibernate.test.annotations.TestCase;import org.hibernate.Session;/** * @author Emmanuel Bernard */public class IndexedCollectionOfElementsTest extends TestCase {	public void testIndexedCollectionOfElements() throws Exception {		Sale sale = new Sale();		Contact contact = new Contact();		contact.setName( "Emmanuel" );		sale.getContacts().add(contact);		Session s = openSession(  );		s.getTransaction().begin();		s.save( sale );		s.flush();		s.get( Sale.class, sale.getId() );		assertEquals( 1, sale.getContacts().size() );		s.getTransaction().rollback();		s.close();	}	protected Class[] getMappings() {		return new Class[] {				Sale.class		};	}}

⌨️ 快捷键说明

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