[FIX] update of the @ManyToMany values
This commit is contained in:
parent
464f844eed
commit
7a7ca29081
@ -1172,7 +1172,7 @@ public class DBAccessSQL extends DBAccess {
|
|||||||
}
|
}
|
||||||
final DataAccessAddOn addOn = findAddOnforField(field);
|
final DataAccessAddOn addOn = findAddOnforField(field);
|
||||||
if (addOn != null && !addOn.canInsert(field)) {
|
if (addOn != null && !addOn.canInsert(field)) {
|
||||||
if (addOn.isInsertAsync(field)) {
|
if (addOn.isUpdateAsync(field)) {
|
||||||
final List<TransmitKey> transmitKey = options.get(TransmitKey.class);
|
final List<TransmitKey> transmitKey = options.get(TransmitKey.class);
|
||||||
if (transmitKey.size() != 1) {
|
if (transmitKey.size() != 1) {
|
||||||
throw new DataAccessException(
|
throw new DataAccessException(
|
||||||
@ -1242,6 +1242,9 @@ public class DBAccessSQL extends DBAccess {
|
|||||||
addOn.insertData(this, ps, field, data, iii);
|
addOn.insertData(this, ps, field, data, iii);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (final LazyGetter action : asyncActions) {
|
||||||
|
action.doRequest();
|
||||||
|
}
|
||||||
condition.injectQuery(this, ps, iii);
|
condition.injectQuery(this, ps, iii);
|
||||||
final int out = ps.executeUpdate();
|
final int out = ps.executeUpdate();
|
||||||
return out;
|
return out;
|
||||||
@ -1250,9 +1253,6 @@ public class DBAccessSQL extends DBAccess {
|
|||||||
} catch (final SQLException ex) {
|
} catch (final SQLException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
for (final LazyGetter action : asyncActions) {
|
|
||||||
action.doRequest();
|
|
||||||
}
|
|
||||||
return 0L;
|
return 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -475,7 +475,11 @@ public class AddOnManyToMany implements DataAccessAddOn {
|
|||||||
if (remoteKey == null) {
|
if (remoteKey == null) {
|
||||||
throw new DataAccessException("Try to insert remote key with null value");
|
throw new DataAccessException("Try to insert remote key with null value");
|
||||||
}
|
}
|
||||||
insertElements.add(new LinkTableGeneric(localKey, remoteKey));
|
if (linkTable.first) {
|
||||||
|
insertElements.add(new LinkTableGeneric(localKey, remoteKey));
|
||||||
|
} else {
|
||||||
|
insertElements.add(new LinkTableGeneric(remoteKey, localKey));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (insertElements.size() == 0) {
|
if (insertElements.size() == 0) {
|
||||||
LOGGER.warn("Insert multiple link without any value (may have null in the list): {}", dataCasted);
|
LOGGER.warn("Insert multiple link without any value (may have null in the list): {}", dataCasted);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user