Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions api/src/org/labkey/api/data/BeanObjectFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,14 @@ public ArrayList<K> handleArrayList(ResultSet rs) throws SQLException
String prop = propMap.get(label); //Map to correct casing...
if (null != prop)
properties[i] = prop;
else if (label.endsWith("_"))
{
// Try stripping trailing underscore (added by some databases for reserved words)
// For example "File" is a reserved word in SQL Server, but it's used by FileSystemAuditDomainKind/FileSystemAuditEvent
prop = propMap.get(label.substring(0, label.length() - 1));
if (null != prop)
properties[i] = prop;
}
}

ArrayList<K> list = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ public void addProperties(Domain domain, Collection<DomainProperty> properties,
log.warn("StorageProvisioner ignored property with name of built-in column: " + prop.getPropertyURI());
continue;
}

if (CoreSchema.getInstance().getSqlDialect().isReserved(prop.getName()))
log.warn("Property name '" + prop.getName() + "' is a reserved word in the current SQL dialect.");

PropertyStorageSpec spec = kind.getPropertySpec(prop.getPropertyDescriptor(), domain);
if (null != spec)
{
Expand Down