public final class WhereClauseHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
escapeSqlString(String s)
Translates SQL statement's escape character, namely "'".
|
static String |
formatDate(Session session,
Date date)
Formats the date to be compatible with all databases supported by the API.
|
static String |
formatGUID(String sGUID)
Formats a GUID to make it usable in a where clause when loading a business object.
|
public static String formatDate(Session session, Date date)
Session.getDatabaseType()
Example: sWhereClause = "StartDate < " + WhereClauseHelper.formatDate(date, session);
date - the date to formatsession - the session instance to obtain the database typeIllegalArgumentException - if the date parameter is nullpublic static String formatGUID(String sGUID) throws InvalidValueException
sGUID - GUID in standard format {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}, where each x is
an alphanumeric characterInvalidValueException - if the GUID was not in the correct formatpublic static String escapeSqlString(String s)
s - the string to be translatedIllegalArgumentException - if the string parameter is nullCopyright © 2003, 2021, Oracle and/or its affiliates.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.