Examples of DbUpdater


Examples of cn.edu.hfut.dmic.webcollector.generator.DbUpdater

     * @throws Exception
     */
    public void start(int depth) throws Exception {

        if (!resumable) {
            DbUpdater clearDbUpdater = createDbUpdater();
            if (clearDbUpdater != null) {
                clearDbUpdater.clearHistory();
            }

            if (seeds.isEmpty()) {
                LogUtils.getLogger().info("error:Please add at least one seed");
                return;
View Full Code Here

Examples of cn.edu.hfut.dmic.webcollector.generator.DbUpdater

    }

 
    protected Fetcher updateFetcher(Fetcher fetcher) {
        try {
            DbUpdater dbUpdater = createDbUpdater();
            if (dbUpdater != null) {
                fetcher.setDbUpdater(dbUpdater);
            }
            fetcher.setRequestFactory(this);
            fetcher.setParserFactory(this);
View Full Code Here

Examples of com.sonymobile.backlogtool.dbupdate.DbUpdater

            ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(true);
            scanner.addIncludeFilter(new AnnotationTypeFilter(DbUpdate.class));
            List<DbUpdater> updateList = new ArrayList<DbUpdater>();
            for (BeanDefinition bd : scanner.findCandidateComponents("com.sonymobile.backlogtool.dbupdate")) {
                try {
                    DbUpdater updater = (DbUpdater) Class.forName(bd.getBeanClassName()).newInstance();
                    updateList.add(updater);

                } catch (ClassNotFoundException e) {
                    e.printStackTrace();
                } catch (InstantiationException e) {
                    e.printStackTrace();
                } catch (IllegalAccessException e) {
                    e.printStackTrace();
                }
            }
            //Attempt to run all updates in order
            Collections.sort(updateList);
            for (DbUpdater updater : updateList) {
                if (updater.getFromVersion() == schemaVersion.getVersion()) {
                    boolean success = updater.update(sessionFactory);
                    String updateName = updater.getClass().getSimpleName();
                    if (success) {
                        System.out.println("Ran schema update " + updateName);
                        System.out.println("New schema version " + updater.getToVersion());
                        schemaVersion.setVersion(updater.getToVersion());
                    } else {
                        System.out.println("Failed to make schema update " + updateName);
                    }
                }
            }
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.