Skip to content

Commit

Permalink
#212 removed AbstractDao
Browse files Browse the repository at this point in the history
  • Loading branch information
kagemomiji committed Jan 2, 2024
1 parent 7ee1110 commit c521d89
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 372 deletions.
308 changes: 0 additions & 308 deletions airsonic-main/src/main/java/org/airsonic/player/dao/AbstractDao.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@
import org.airsonic.player.util.LambdaUtils.ThrowingBiFunction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.nio.file.Path;
import java.sql.Connection;
import java.util.function.Consumer;

@Repository
public class DatabaseDao extends AbstractDao {
public class DatabaseDao {
private static final Logger LOG = LoggerFactory.getLogger(DatabaseDao.class);

@Autowired
private JdbcTemplate jdbcTemplate;

public boolean exportDB(Path tempWorkingDir, ThrowingBiFunction<Path, Connection, Boolean, Exception> exportFunction) throws Exception {
try (Connection con = jdbcTemplate.getDataSource().getConnection()) {
return exportFunction.apply(tempWorkingDir, con);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
import com.google.common.io.MoreFiles;
import com.google.common.io.RecursiveDeleteOption;
import org.airsonic.player.controller.JAXBWriter;
import org.airsonic.player.dao.AbstractDao;
import org.airsonic.player.service.MediaScannerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.test.context.TestConfiguration;

import java.io.IOException;
import java.nio.file.Files;
Expand Down Expand Up @@ -76,9 +74,4 @@ public static void execScan(MediaScannerService mediaScannerService) {
waitForScanFinish(mediaScannerService);
}

@TestConfiguration
public static class TestDao extends AbstractDao {

}

}
Loading

0 comments on commit c521d89

Please sign in to comment.