Skip to content
Snippets Groups Projects
Commit ed97b3c7 authored by Cornelia Michlits's avatar Cornelia Michlits
Browse files

#84 bug fix table index creation

Former-commit-id: 440185e2
parent 06652739
No related branches found
No related tags found
1 merge request!42Fixed the query service tests
package at.tuwien.repository.elastic;
import at.tuwien.entities.database.Database;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;
@Repository(value = "ElasticDatabaseRepository")
public interface DatabaseidxRepository extends ElasticsearchRepository<Database, Long> {
}
package at.tuwien.repository.elastic;
import at.tuwien.entities.database.Database;
import at.tuwien.entities.database.table.Table;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;
@Repository(value = "ElasticDatabaseService")
public interface DatabaseRepository extends ElasticsearchRepository<Database, Long> {
public interface TableidxRepository extends ElasticsearchRepository<Table, Long> {
}
\ No newline at end of file
......@@ -10,7 +10,8 @@ import at.tuwien.exception.*;
import at.tuwien.mapper.ImageMapper;
import at.tuwien.mapper.QueryMapper;
import at.tuwien.mapper.TableMapper;
import at.tuwien.repository.elastic.DatabaseRepository;
import at.tuwien.repository.elastic.TableidxRepository;
import at.tuwien.repository.jpa.DatabaseRepository;
import at.tuwien.repository.jpa.TableRepository;
import com.opencsv.CSVParser;
import com.opencsv.CSVParserBuilder;
......@@ -34,14 +35,17 @@ public class TableService extends JdbcConnector {
private final TableRepository tableRepository;
private final DatabaseRepository databaseRepository;
private final TableidxRepository tableidxRepository;
private final TableMapper tableMapper;
@Autowired
public TableService(TableRepository tableRepository, DatabaseRepository databaseRepository,
ImageMapper imageMapper, TableMapper tableMapper, QueryMapper queryMapper) {
TableidxRepository tableidxRepository, ImageMapper imageMapper, TableMapper tableMapper,
QueryMapper queryMapper) {
super(imageMapper, tableMapper, queryMapper);
this.tableRepository = tableRepository;
this.databaseRepository = databaseRepository;
this.tableidxRepository = tableidxRepository;
this.tableMapper = tableMapper;
}
......@@ -131,6 +135,8 @@ public class TableService extends JdbcConnector {
}
log.info("Created table {}", table.getId());
log.debug("created table: {}", table);
/* save in table_index - elastic search */
tableidxRepository.save(table);
return table;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment