public class ConfigurationTest extends junit.framework.TestCase {
public void testDeclarativeMix() throws Exception {
AnnotationConfiguration cfg = new AnnotationConfiguration();
cfg.configure( "org/hibernate/test/annotations/hibernate.cfg.xml" );
cfg.setProperty( Environment.HBM2DDL_AUTO, "create-drop" );
SessionFactory sf = cfg.buildSessionFactory();
assertNotNull( sf );
Session s = sf.openSession();
Transaction tx = s.beginTransaction();
Query q = s.createQuery( "from Boat" );
assertEquals( 0, q.list().size() );