Skip to content

Commit e2733cb

Browse files
committed
quoteIdentifier() and reference JavaClientApiTest
1 parent c61d1fe commit e2733cb

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/org/labkey/remoteapi/query/ExecuteSqlCommand.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
* The response of this command is exactly the same as the
3434
* {@link org.labkey.remoteapi.query.SelectRowsCommand}, so the response object
3535
* will be of type {@link org.labkey.remoteapi.query.SelectRowsResponse}.
36+
* <p>
37+
* JavaClientApiTest includes some testing of this command.
3638
*/
3739
public class ExecuteSqlCommand extends BaseQueryCommand<SelectRowsResponse>
3840
{
@@ -227,4 +229,10 @@ protected Map<String, Object> createParameterMap()
227229

228230
return params;
229231
}
232+
233+
// Convenience method for quoting an identifier that may have tricky characters, including quotes
234+
public static String quoteIdentifier(String identifier)
235+
{
236+
return "\"" + identifier.replace("\"", "\"\"") + "\"";
237+
}
230238
}

src/org/labkey/remoteapi/query/SelectRowsCommand.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
* }
4848
* </code>
4949
* </pre>
50+
* <p>
51+
* JavaClientApiTest includes some testing of this command.
5052
*/
5153
public class SelectRowsCommand extends BaseSelectRowsCommand<SelectRowsResponse>
5254
{

0 commit comments

Comments
 (0)