diff --git a/api/src/org/labkey/api/data/BeanObjectFactory.java b/api/src/org/labkey/api/data/BeanObjectFactory.java index 25e129e41e7..377fdbb770d 100644 --- a/api/src/org/labkey/api/data/BeanObjectFactory.java +++ b/api/src/org/labkey/api/data/BeanObjectFactory.java @@ -256,6 +256,14 @@ public ArrayList 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 list = new ArrayList<>(); diff --git a/experiment/src/org/labkey/experiment/api/property/StorageProvisionerImpl.java b/experiment/src/org/labkey/experiment/api/property/StorageProvisionerImpl.java index 930ea8c0d58..6ebc330eea3 100644 --- a/experiment/src/org/labkey/experiment/api/property/StorageProvisionerImpl.java +++ b/experiment/src/org/labkey/experiment/api/property/StorageProvisionerImpl.java @@ -384,6 +384,10 @@ public void addProperties(Domain domain, Collection 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) {