Examples of addAnnotatedClass()


Examples of org.hibernate.cfg.AnnotationConfiguration.addAnnotatedClass()

        logger.info("Begin scan for annotated classes.");
        ConfigUtil.visitAllTargets(roots, new ConfigVisitor() {
            public void visit(Class<?> clazz) {
                if (clazz.isAnnotationPresent(Entity.class)) {
                    cfg.addAnnotatedClass(clazz);
                }
            }
        });

        final SessionFactory sessionFactory = cfg.buildSessionFactory();
View Full Code Here

Examples of org.hibernate.cfg.AnnotationConfiguration.addAnnotatedClass()

    configuration.setProperty("hibernate.hbm2ddl.auto","create");
    PersistenceLoader persistenceLoader = PersistenceLoader.getInstance();
    Persistence persistence = persistenceLoader.getPersistence();
    for (String className : persistence.getPersistenceUnit().getClassNames()) {
      Class<?> c = Class.forName(className);
      configuration.addAnnotatedClass(c);
    }
   
    configuration.setProperty("hibernate.dialect", dialectName);
    SchemaExport exporter = new SchemaExport(configuration);
    exporter.setDelimiter(";");
View Full Code Here

Examples of org.hibernate.cfg.AnnotationConfiguration.addAnnotatedClass()

            {
                try
                {
                    Class entityClass = contextClassLoader.loadClass(className);

                    configuration.addAnnotatedClass(entityClass);
                }
                catch (ClassNotFoundException ex)
                {
                    throw new RuntimeException(ex);
                }
View Full Code Here

Examples of org.hibernate.cfg.AnnotationConfiguration.addAnnotatedClass()

 
  public void testTypeDefWithoutNameAndDefaultForTypeAttributes() {
   
    try {
      AnnotationConfiguration config = new AnnotationConfiguration();
      config.addAnnotatedClass(LocalContactDetails.class);
      config.buildSessionFactory();
      fail("Did not throw expected exception");
    }
    catch( AnnotationException ex ) {
      assertEquals(
View Full Code Here

Examples of org.hibernate.cfg.AnnotationConfiguration.addAnnotatedClass()

  public void testBlownPrecision() throws Exception {
   
    try {
      AnnotationConfiguration config = new AnnotationConfiguration();
      config.addAnnotatedClass(Bunny.class);
      config.addAnnotatedClass(PointyTooth.class);
      config.addAnnotatedClass(TwinkleToes.class);
      config.buildSessionFactory();
      String[] schema = config
          .generateSchemaCreationScript(new SQLServerDialect());
View Full Code Here

Examples of org.hibernate.cfg.AnnotationConfiguration.addAnnotatedClass()

  public void testBlownPrecision() throws Exception {
   
    try {
      AnnotationConfiguration config = new AnnotationConfiguration();
      config.addAnnotatedClass(Bunny.class);
      config.addAnnotatedClass(PointyTooth.class);
      config.addAnnotatedClass(TwinkleToes.class);
      config.buildSessionFactory();
      String[] schema = config
          .generateSchemaCreationScript(new SQLServerDialect());
      for (String s : schema) {
View Full Code Here

Examples of org.hibernate.cfg.AnnotationConfiguration.addAnnotatedClass()

   
    try {
      AnnotationConfiguration config = new AnnotationConfiguration();
      config.addAnnotatedClass(Bunny.class);
      config.addAnnotatedClass(PointyTooth.class);
      config.addAnnotatedClass(TwinkleToes.class);
      config.buildSessionFactory();
      String[] schema = config
          .generateSchemaCreationScript(new SQLServerDialect());
      for (String s : schema) {
        log.debug(s);
View Full Code Here

Examples of org.hibernate.cfg.AnnotationConfiguration.addAnnotatedClass()

  private SessionFactoryImplementor buildSessionFactory(List<Class<?>> classesUnderTest, List<String> configFiles) {
    assert classesUnderTest != null;
    assert configFiles != null;
    AnnotationConfiguration cfg = new AnnotationConfiguration();
    for ( Class<?> clazz : classesUnderTest ) {
      cfg.addAnnotatedClass( clazz );
    }
    for ( String configFile : configFiles ) {
      InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream( configFile );
      cfg.addInputStream( is );
    }
View Full Code Here

Examples of org.hibernate.cfg.AnnotationConfiguration.addAnnotatedClass()

  public void testBlownPrecision() throws Exception {
   
    try {
      AnnotationConfiguration config = new AnnotationConfiguration();
      config.addAnnotatedClass(Bunny.class);
      config.addAnnotatedClass(PointyTooth.class);
      config.addAnnotatedClass(TwinkleToes.class);
      config.buildSessionFactory();
      String[] schema = config
          .generateSchemaCreationScript(new SQLServerDialect());
View Full Code Here

Examples of org.hibernate.cfg.AnnotationConfiguration.addAnnotatedClass()

  public void testBlownPrecision() throws Exception {
   
    try {
      AnnotationConfiguration config = new AnnotationConfiguration();
      config.addAnnotatedClass(Bunny.class);
      config.addAnnotatedClass(PointyTooth.class);
      config.addAnnotatedClass(TwinkleToes.class);
      config.buildSessionFactory();
      String[] schema = config
          .generateSchemaCreationScript(new SQLServerDialect());
      for (String s : schema) {
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.