T11: Organization, Company, link entities + round-trip [checkpoint]

This commit is contained in:
Artur Kruszewski
2026-07-08 23:23:56 +02:00
parent a8bdaf4cae
commit 6e87fd1b8d
44 changed files with 385 additions and 57 deletions
@@ -4,6 +4,7 @@ import com.developx.szpitale.model.CanonicalDataset;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -50,4 +51,10 @@ public class CanonicalReader {
public CanonicalDataset readSingle(Path inputDir, String voivodeship) throws IOException {
return readAll(inputDir, voivodeship).stream().findFirst().orElse(null);
}
public static CanonicalDataset readDataset(File file) throws IOException {
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JavaTimeModule());
return mapper.readValue(file, CanonicalDataset.class);
}
}