-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 13309 webdav multiple files unique constraint #13347
Issue 13309 webdav multiple files unique constraint #13347
Conversation
@@ -2310,6 +2318,58 @@ private void deleteInsertPermission(Permissionable permissionable, String type, | |||
} | |||
} | |||
|
|||
// Method to Insert a new Permission Reference, or if it exists, it will udpate it | |||
private void upsertPermission(DotConnect dc1, String permissionId, Permissionable newReference, String type) throws DotDataException { | |||
if (DbConnectionFactory.isH2()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same principle of a command to generate the sql based on the current db type, see below comment
|
||
//Update Parameters: Generate column = value pairs, used for the Update part | ||
StringBuffer buffer = new StringBuffer(); | ||
for (int i = 0; i < columns.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not to change this for a command pattern, such as
interface UpsertCommand command = this.getUpsertCommand(dbType);
query = command.execute (table, StringUtil.merge(columns),
conditionalColumn,
StringUtil.merge(values));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great Job, kudos!!!
No description provided.