Examples of AnnotationConfiguration


Examples of org.hibernate.cfg.AnnotationConfiguration

/**
* @author Emmanuel Bernard
*/
public class SafeMappingTest extends junit.framework.TestCase {
  public void testDeclarativeMix() throws Exception {
    AnnotationConfiguration cfg = new AnnotationConfiguration();
    cfg.addAnnotatedClass( IncorrectEntity.class );
    cfg.setProperty( Environment.HBM2DDL_AUTO, "create-drop" );
    try {
      SessionFactory sf = cfg.buildSessionFactory();
      fail( "Entity wo id should fail" );
    }
    catch (AnnotationException e) {
      //success
    }
View Full Code Here

Examples of org.hibernate.cfg.AnnotationConfiguration

  protected void buildConfiguration() throws Exception {
    if ( sessions != null ) {
      sessions.close();
    }
    try {
      setCfg( new AnnotationConfiguration() );
      // by default use the new id generator scheme...
      cfg.setProperty( AnnotationConfiguration.USE_NEW_ID_GENERATOR_MAPPINGS, "true" );
      configure( cfg );
      if ( recreateSchema() ) {
        cfg.setProperty( Environment.HBM2DDL_AUTO, "create-drop" );
View Full Code Here
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.