Package org.hibernate.test.annotations.onetoone

Source Code of org.hibernate.test.annotations.onetoone.OneToOneErrorTest

//$Id$
package org.hibernate.test.annotations.onetoone;

import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Environment;
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
    }
  }
}
TOP

Related Classes of org.hibernate.test.annotations.onetoone.OneToOneErrorTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.