Skip to content
Snippets Groups Projects
Commit ef1b131b authored by Moritz Staudinger's avatar Moritz Staudinger
Browse files

Removed notnull values and added default values for timestamp and paging

parent 41806b92
No related branches found
No related tags found
4 merge requests!81New stable release,!43Merge dev to master,!33Draft: merge dev to master,!29Resolve "Error querying an empty table"
......@@ -20,6 +20,7 @@ public interface QueryMapper {
for (Record record : data) {
final Map<String, Object> map = new HashMap<>();
for (Field<?> column : record.fields()) {
System.out.println("Columnname: "+column);
map.put(column.getName(), record.get(column.getName()));
}
result.add(map);
......
......@@ -172,9 +172,18 @@ public class MariaDataService extends JdbcConnector implements DataService {
@Override
@Transactional
public QueryResultDto selectAll(@NonNull Long databaseId, @NonNull Long tableId, @NonNull Instant timestamp,
@NonNull Long page, @NonNull Long size) throws TableNotFoundException,
public QueryResultDto selectAll(@NonNull Long databaseId, @NonNull Long tableId, Instant timestamp,
Long page, Long size) throws TableNotFoundException,
DatabaseNotFoundException, ImageNotSupportedException, DatabaseConnectionException, TableMalformedException {
if(timestamp == null) {
timestamp = Instant.now();
}
if(page == null ) {
page = 0L;
}
if(size == null) {
size = 100L;
}
if (page < 0) {
throw new TableMalformedException("Page number cannot be lower than 0");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment