mirror of
https://github.com/google/nomulus
synced 2026-06-09 08:22:59 +00:00
Use merge instead of persist for RegistryLockDao (#310)
* Use merge instead of persist for RegistryLockDao * CR responses
This commit is contained in:
@@ -45,8 +45,8 @@ public final class RegistryLockDao {
|
||||
});
|
||||
}
|
||||
|
||||
public static void save(RegistryLock registryLock) {
|
||||
public static RegistryLock save(RegistryLock registryLock) {
|
||||
checkNotNull(registryLock, "Null registry lock cannot be saved");
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().persist(registryLock));
|
||||
return jpaTm().transact(() -> jpaTm().getEntityManager().merge(registryLock));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,10 +177,7 @@ public final class RegistryLock extends ImmutableObject implements Buildable {
|
||||
|
||||
@Override
|
||||
public Builder asBuilder() {
|
||||
RegistryLock clone = clone(this);
|
||||
// Revision ID should be different for every object
|
||||
clone.revisionId = null;
|
||||
return new Builder(clone);
|
||||
return new Builder(clone(this));
|
||||
}
|
||||
|
||||
/** Builder for {@link google.registry.schema.domain.RegistryLock}. */
|
||||
|
||||
Reference in New Issue
Block a user