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

📄 useidentifierrollbacktest.java

📁 hibernate 开源框架的代码 jar包希望大家能喜欢
💻 JAVA
字号:
//$Id: $package org.hibernate.test.id;import junit.framework.Test;import org.hibernate.Session;import org.hibernate.Transaction;import org.hibernate.cfg.Configuration;import org.hibernate.cfg.Environment;import org.hibernate.junit.functional.FunctionalTestCase;import org.hibernate.junit.functional.FunctionalTestClassTestSuite;/** * @author Emmanuel Bernard */public class UseIdentifierRollbackTest extends FunctionalTestCase {	public UseIdentifierRollbackTest(String str) {		super(str);	}	public String[] getMappings() {		return new String[] { "id/Product.hbm.xml" };	}	public void configure(Configuration cfg) {		cfg.setProperty( Environment.USE_IDENTIFIER_ROLLBACK, "true");		super.configure( cfg );	}	public static Test suite() {		return new FunctionalTestClassTestSuite( UseIdentifierRollbackTest.class );	}	public void testSimpleRollback() {		Session session = openSession();		Transaction t = session.beginTransaction();		Product prod = new Product();		assertNull( prod.getName() );		session.persist(prod);		session.flush();		assertNotNull( prod.getName() );		t.rollback();		session.close();	}}

⌨️ 快捷键说明

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