Package org.fao.geonet.repository

Examples of org.fao.geonet.repository.SettingRepository


        return gnContext;
    }

    private void importDatabaseData(final ServiceContext context) {
        // check if database has any data
        final SettingRepository settingRepository = context.getBean(SettingRepository.class);
        final long count = settingRepository.count();
        if (count == 0) {
            try {
                // import data from init files
                List<Pair<String, String>> importData = (List) context.getApplicationContext().getBean("initial-data");
                    final DbLib dbLib = new DbLib();
View Full Code Here


                    x.printStackTrace();
                }
            }

            private boolean checkDBWrite() {
                SettingRepository settingsRepo = gc.getBean(SettingRepository.class);
                try {
                    Setting newSetting = settingsRepo.save(new Setting().setName("DBHeartBeat").setValue("value"));
                    settingsRepo.flush();
                    settingsRepo.delete(newSetting);
                    return true;
                } catch (Exception x) {
                    logger.info("DBHeartBeat Exception: " + x.getMessage());
                    return false;
                }
View Full Code Here

TOP

Related Classes of org.fao.geonet.repository.SettingRepository

Copyright © 2018 www.massapicom. 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.