Skip to content

Commit

Permalink
[26136] never update pk column param on setting value via config service
Browse files Browse the repository at this point in the history
  • Loading branch information
huthomas committed Feb 7, 2024
1 parent d9437a1 commit 96ee330
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ public boolean set(String key, String value) {
public boolean set(String key, String value, boolean addTraceEntry) {
Optional<IConfig> entry = modelService.load(key, IConfig.class);
if (value != null) {
// never update an existing key, may differ due to mysql ignoring case on load,
// JPA would create update and throw exception on update of primary key
if (entry.isPresent()) {
key = entry.get().getKey();
}
IConfig _entry = entry.orElse(modelService.create(IConfig.class));
_entry.setKey(key);
_entry.setValue(value);
Expand Down

0 comments on commit 96ee330

Please sign in to comment.