Fix username exchange

This commit is contained in:
2024-07-31 13:07:07 +02:00
parent d7d5c413a7
commit 791dad2aed
6 changed files with 14 additions and 10 deletions

View File

@@ -1428,6 +1428,8 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
fieldsWithoutIdentityAndNotNull.stream().map(Triple::getFirst).collect(Collectors.toList()), ","))
.append(") VALUES (");
StringBuilder insertSqlTrace = new StringBuilder(insertSQL.toString());
for (int i = 0; i < fieldsWithoutIdentityAndNotNull.size(); i++) {
insertSQL.append(" ?");
@@ -1437,7 +1439,6 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
insertSQL.append(")");
String traceSql = insertSQL.toString();
try (SQLServerPreparedStatement insertBulkPs =
(SQLServerPreparedStatement) sqlServerConnection.prepareStatement(
@@ -1448,10 +1449,14 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
final Object value = fieldsWithoutIdentityAndNotNull.get(i - 1).getSecond();
insertBulkPs.setObject(i, value);
traceSql = traceSql.replace("?", UtilityDB.valueToString(value));
}
insertSqlTrace.append(UtilityDB.valueToString(value));
if (i <= fieldsWithoutIdentityAndNotNull.size() - 1)
insertSqlTrace.append(",");
logger.trace("Query tracing: {}", traceSql);
}
insertSqlTrace.append(")");
logger.trace("Query tracing: {}", insertSqlTrace);
long insertedRowCount = insertBulkPs.executeLargeUpdate();
if (insertedRowCount > 0 && containsIdentity) {

View File

@@ -25,7 +25,7 @@ import java.util.stream.Collectors;
public class ExchangeArticoliImportService {
//TODO: To be remove, only for fast development
private final String ROSSOGARGANO_EXCHANGE_USER = "DBA";
private final String ROSSOGARGANO_EXCHANGE_USER = "EXCHANGE";
@Autowired
private EntityProcessor entityProcessor;

View File

@@ -32,7 +32,7 @@ import java.util.stream.Collectors;
public class ExchangeColliImportService {
//TODO: To be remove, only for fast development
private final String ROSSOGARGANO_EXCHANGE_USER = "DBA";
private final String ROSSOGARGANO_EXCHANGE_USER = "EXCHANGE";
private final Logger logger = LogManager.getLogger();

View File

@@ -30,7 +30,7 @@ import java.util.stream.Collectors;
public class ExchangeDocumentImportService {
//TODO: To be remove, only for fast development
private final String ROSSOGARGANO_EXCHANGE_USER = "DBA";
private final String ROSSOGARGANO_EXCHANGE_USER = "EXCHANGE";
@Autowired
private EntityProcessor entityProcessor;

View File

@@ -35,7 +35,7 @@ import java.util.stream.Collectors;
public class ExchangeOrdiniImportService {
//TODO: To be remove, only for fast development
private final String ROSSOGARGANO_EXCHANGE_USER = "DBA";
private final String ROSSOGARGANO_EXCHANGE_USER = "EXCHANGE";
private final Logger logger = LogManager.getLogger();

View File

@@ -27,8 +27,7 @@ import java.util.stream.Collectors;
public class ExchangePartiteMagazzinoImportService {
//TODO: To be remove, only for fast development
private final String ROSSOGARGANO_EXCHANGE_PROFILEDB = "ROSSO_GARGANO_EXCHANGE";
private final String ROSSOGARGANO_EXCHANGE_USER = "DBA";
private final String ROSSOGARGANO_EXCHANGE_USER = "EXCHANGE";
@Autowired