-
Notifications
You must be signed in to change notification settings - Fork 20
small int + workaround for credentials #23
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
5a43428
17a7546
36f9664
04a75f9
77868f3
c703019
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -395,18 +395,26 @@ public Uid update(ObjectClass oclass, Uid uid, Set<Attribute> attrs, OperationOp | |
| for (Attribute attribute : attrs) { | ||
| // All attributes needs to be updated except the UID | ||
| if (!attribute.is(Uid.NAME)) { | ||
| final String attributeName = attribute.getName(); | ||
| final String columnName = getColumnName(attributeName); | ||
| Object value = AttributeUtil.getSingleValue(attribute); | ||
| // Handle the empty string values | ||
| if (isToBeEmpty(columnName, value)) { | ||
| log.info("Append empty attribute {0} for required columnName {1}", attributeName, columnName); | ||
| value = DatabaseTableConstants.EMPTY_STR; | ||
| if (config.getIgnorePasswordWorkaround() && attribute.is(OperationalAttributeInfos.PASSWORD.getName())) { | ||
| if(attrs.size() == 1) { | ||
| return ret; | ||
| } else { | ||
| break; | ||
| } | ||
| } else { | ||
| final String attributeName = attribute.getName(); | ||
| final String columnName = getColumnName(attributeName); | ||
| Object value = AttributeUtil.getSingleValue(attribute); | ||
| // Handle the empty string values | ||
| if (isToBeEmpty(columnName, value)) { | ||
| log.info("Append empty attribute {0} for required columnName {1}", attributeName, columnName); | ||
| value = DatabaseTableConstants.EMPTY_STR; | ||
| } | ||
| final SQLColumnTypeInfo sqlColumnTypeInfo = getColumnTypeInfo(columnName); | ||
| final SQLParam param = new SQLParam(quoteName(columnName), value, sqlColumnTypeInfo.getTypeCode(), sqlColumnTypeInfo.getTypeName()); | ||
| updateSet.addBind(param); | ||
| log.ok("Appended to update statement the attribute {0} for columnName {1} and sql type code {2}", attributeName, columnName, sqlColumnTypeInfo.getTypeCode()); | ||
| } | ||
| final SQLColumnTypeInfo sqlColumnTypeInfo = getColumnTypeInfo(columnName); | ||
| final SQLParam param = new SQLParam(quoteName(columnName), value, sqlColumnTypeInfo.getTypeCode(), sqlColumnTypeInfo.getTypeName()); | ||
| updateSet.addBind(param); | ||
| log.ok("Appended to update statement the attribute {0} for columnName {1} and sql type code {2}", attributeName, columnName, sqlColumnTypeInfo.getTypeCode()); | ||
| } | ||
| } | ||
| log.info("Update account {0}", accountName); | ||
|
|
@@ -1031,8 +1039,13 @@ private Set<AttributeInfo> buildAttributeInfoSet(ResultSet rset) throws SQLExcep | |
| log.ok("Name of the parameter being evaluated : {0}", name); | ||
|
|
||
| final AttributeInfoBuilder attrBld = new AttributeInfoBuilder(); | ||
| final int columnType = meta.getColumnType(i); | ||
| final String columnTypeName = meta.getColumnTypeName(i); | ||
| Integer columnType = meta.getColumnType(i); | ||
| String columnTypeName = meta.getColumnTypeName(i); | ||
|
|
||
| if(meta.getColumnType(i) == 5) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Type interpretation is handled in a separate project, the DB table connector has a dependency on. Please do not use this code snipped in this place and rather port this part of the contribution to the "https://github.com/Evolveum/connector-legacy-libs/tree/master/dbcommon" repository. You can use parts of the commit "Evolveum/connector-legacy-libs@6a80de7" as a reference fo the modifications needed for this. |
||
| columnType = 4; | ||
| columnTypeName = "int"; | ||
| } | ||
|
|
||
| columnSQLTypes.put(name, new SQLColumnTypeInfo(columnTypeName, columnType)); | ||
| if (name.equalsIgnoreCase(config.getKeyColumn())) { | ||
|
|
||
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.
Please if possible do not use the word "Workaround" in a parameter name or method.