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

📄 versiontest.java

📁 hibernate3.2.6源码和jar包
💻 JAVA
字号:
//$Id: $package org.hibernate.test.annotations.various;import org.hibernate.Session;import org.hibernate.test.annotations.TestCase;/** * @author Emmanuel Bernard */public class VersionTest extends TestCase {	public void testOptimisticLockDisabled() throws Exception {		Conductor c = new Conductor();		c.setName( "Bob" );		Session s = openSession( );		s.getTransaction().begin();		s.persist( c );		s.flush();		s.clear();		c = (Conductor) s.get( Conductor.class, c.getId() );		Long version = c.getVersion();		c.setName( "Don" );		s.flush();		s.clear();		c = (Conductor) s.get( Conductor.class, c.getId() );		assertEquals( version, c.getVersion() );		s.getTransaction().rollback();		s.close();	}	protected Class[] getMappings() {		return new Class[] {				Conductor.class		};	}}

⌨️ 快捷键说明

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