bugfix/only-one-partner-per-person #143

Merged
hsh-michaelhoennig merged 5 commits from bugfix/only-one-partner-per-person into master 2025-01-07 09:30:40 +01:00
Showing only changes of commit ec56369019 - Show all commits

View File

@ -170,20 +170,19 @@ public class CsvDataImport extends ContextBasedTest {
}
public <T extends BaseEntity> T persistViaEM(final Integer id, final T entity) {
//System.out.println("persisting #" + entity.hashCode() + ": " + entity);
if (!em.contains(entity)) {
em.persist(entity);
}
// uncomment for debugging purposes
// try {
// em.flush(); // makes it slow, but produces better error messages
// System.out.println("persisted #" + entity.hashCode() + " as " + entity.getUuid());
// return entity;
// } catch (final Exception exc) {
// throw exc; // for breakpoints
// }
if (em.contains(entity)) {
return entity;
}
try {
em.persist(entity);
em.flush(); // makes it a bit slower, but produces better error messages
System.out.println("persisted #" + id + " as " + entity.getUuid());
return entity;
} catch (final Exception exc) {
System.err.println("persist failed for #" + id + " as " + entity);
throw exc; // for breakpoints
}
}
@SneakyThrows
public BaseEntity<HsHostingAsset> persistViaSql(final Integer id, final HsHostingAsset entity) {