onetooneerrortest.java

来自「hibernate3.2.6源码和jar包」· Java 代码 · 共 27 行

JAVA
27
字号
//$Id$package org.hibernate.test.annotations.onetoone;import org.hibernate.cfg.AnnotationConfiguration;import org.hibernate.cfg.Environment;import org.hibernate.test.annotations.IncorrectEntity;import org.hibernate.SessionFactory;import org.hibernate.AnnotationException;/** * @author Emmanuel Bernard */public class OneToOneErrorTest extends junit.framework.TestCase {	public void testWrongOneToOne() throws Exception {		AnnotationConfiguration cfg = new AnnotationConfiguration();		cfg.addAnnotatedClass( Show.class )				.addAnnotatedClass( ShowDescription.class );		cfg.setProperty( Environment.HBM2DDL_AUTO, "create-drop" );		try {			SessionFactory sf = cfg.buildSessionFactory();			fail( "Wrong mappedBy does not fail property" );		}		catch (AnnotationException e) {			//success		}	}}

⌨️ 快捷键说明

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