📄 onetooneerrortest.java
字号:
//$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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -