Updated SeriesImExporter to implement new interface
parent
879083029d
commit
786922c336
|
|
@ -93,6 +93,8 @@ public class JournalImExporter
|
||||||
)) {
|
)) {
|
||||||
existingEntity.setSymbol(importedEntity.getSymbol());
|
existingEntity.setSymbol(importedEntity.getSymbol());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
journalRepo.save(existingEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,8 @@ public class PublisherImExporter extends AbstractEntityImExporter<Publisher> {
|
||||||
)) {
|
)) {
|
||||||
existingEntity.setPlace(importedEntity.getPlace());
|
existingEntity.setPlace(importedEntity.getPlace());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
publisherRepo.save(existingEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import org.libreccm.imexport.AbstractEntityImExporter;
|
||||||
import org.libreccm.imexport.Processes;
|
import org.libreccm.imexport.Processes;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
|
@ -20,21 +21,52 @@ public class SeriesImExporter extends AbstractEntityImExporter<Series> {
|
||||||
@Inject
|
@Inject
|
||||||
private SeriesRepository seriesRepo;
|
private SeriesRepository seriesRepo;
|
||||||
|
|
||||||
@Override
|
|
||||||
public Class<Series> getEntityClass() {
|
|
||||||
return Series.class;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected void init() {
|
protected void init() {
|
||||||
// Nothing
|
// Nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<Series> getEntityClass() {
|
||||||
|
return Series.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Optional<Series> findExistingEntity(final String uuid) {
|
||||||
|
return seriesRepo.findByUuid(uuid);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void saveImportedEntity(final Series series) {
|
protected void saveImportedEntity(final Series series) {
|
||||||
seriesRepo.save(series);
|
seriesRepo.save(series);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void updateExistingEntity(
|
||||||
|
final Series existingEntity,
|
||||||
|
final Series importedEntity
|
||||||
|
) {
|
||||||
|
if (!Objects.equals(
|
||||||
|
existingEntity.getTitle(),
|
||||||
|
importedEntity.getTitle()
|
||||||
|
)) {
|
||||||
|
syncLocalizedStrings(
|
||||||
|
importedEntity.getTitle(),
|
||||||
|
existingEntity.getTitle()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Objects.equals(
|
||||||
|
existingEntity.getDescription(),
|
||||||
|
importedEntity.getDescription()
|
||||||
|
)) {
|
||||||
|
syncLocalizedStrings(
|
||||||
|
importedEntity.getDescription(),
|
||||||
|
existingEntity.getDescription()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Series reloadEntity(final Series series) {
|
protected Series reloadEntity(final Series series) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue