()
| 59 | } |
| 60 | |
| 61 | private void createDB() throws Exception { |
| 62 | if (!Files.exists(databaseDir)) { |
| 63 | |
| 64 | log("%s directory is not found...", databaseDir.toAbsolutePath()); |
| 65 | log("creating the directory..."); |
| 66 | Files.createDirectories(databaseDir); |
| 67 | log("success!"); |
| 68 | } else { |
| 69 | |
| 70 | if (!Files.isDirectory(databaseDir)) { |
| 71 | |
| 72 | err("%s file is not directory...", databaseDir.toAbsolutePath()); |
| 73 | err("Must be a directory"); |
| 74 | System.exit(1); |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | System.setProperty(LocalLog.LOCAL_LOG_LEVEL_PROPERTY, "error"); |
| 79 | source = new JdbcConnectionSource(getDatabaseURL()); |
| 80 | DatabaseConnection conn = source.getReadWriteConnection(); |
| 81 | conn.executeStatement("pragma auto_vacuum = full", DatabaseConnection.DEFAULT_RESULT_FLAGS); |
| 82 | } |
| 83 | |
| 84 | public <T, ID> Dao<T, ID> createTable(Class<T> c, PropertyChangeListener listener) throws Exception { |
| 85 | addPropertyChangeListener(listener); |
no test coverage detected