55 lines
1.1 KiB
Java
55 lines
1.1 KiB
Java
package eu.eudat.logic.services.operations;
|
|
|
|
import eu.eudat.data.dao.entities.*;
|
|
import jakarta.persistence.EntityManager;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@Service("databaseRepository")
|
|
public class DatabaseRepositoryImpl implements DatabaseRepository {
|
|
|
|
private DatasetDao datasetDao;
|
|
|
|
|
|
|
|
|
|
private FileUploadDao fileUploadDao;
|
|
|
|
private EntityManager entityManager;
|
|
|
|
|
|
@Autowired
|
|
private void setDatasetDao(DatasetDao datasetDao) {
|
|
this.datasetDao = datasetDao;
|
|
}
|
|
|
|
|
|
@Autowired
|
|
|
|
@Override
|
|
public DatasetDao getDatasetDao() {
|
|
return datasetDao;
|
|
}
|
|
|
|
|
|
@Autowired
|
|
public void setEntityManager(EntityManager entityManager) {
|
|
this.entityManager = entityManager;
|
|
}
|
|
|
|
|
|
@Override
|
|
public FileUploadDao getFileUploadDao() {
|
|
return fileUploadDao;
|
|
}
|
|
|
|
@Autowired
|
|
public void setFileUploadDao(FileUploadDao fileUploadDao) {
|
|
this.fileUploadDao = fileUploadDao;
|
|
}
|
|
|
|
public <T> void detachEntity(T entity) {
|
|
this.entityManager.detach(entity);
|
|
}
|
|
}
|