Primavera Integration API 7.0

com.primavera.integration.util
Class WhereClauseHelper

java.lang.Object
  extended by com.primavera.integration.util.WhereClauseHelper

public final class WhereClauseHelper
extends java.lang.Object

Helper class containing static helper methods to be used when building the where clause specified when loading business objects.


Method Summary
static java.lang.String escapeSqlString(java.lang.String s)
          Translates SQL statement's escape character, namely "'".
static java.lang.String formatDate(java.util.Date date)
          Deprecated. As of release 6.0, use formatDate(Session, Date)
static java.lang.String formatDate(Session session, java.util.Date date)
          Formats the date to be compatible with all databases supported by the API.
static java.lang.String formatGUID(java.lang.String sGUID)
          Formats a GUID to make it usable in a where clause when loading a business object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

formatDate

@Deprecated
public static java.lang.String formatDate(java.util.Date date)
Deprecated. As of release 6.0, use formatDate(Session, Date)

Formats the date to be compatible with Oracle only. Use formatDate(Session, Date) to obtain a formatted date compatible with all databases.

Example: sWhereClause = "StartDate < " + WhereClauseHelper.formatDate(date);

Parameters:
date - the date to format
Returns:
String the formatted date
Throws:
java.lang.IllegalArgumentException - if the date parameter is null

formatDate

public static java.lang.String formatDate(Session session,
                                          java.util.Date date)
Formats the date to be compatible with all databases supported by the API. The database type is determined by invoking Session.getDatabaseType()

Example: sWhereClause = "StartDate < " + WhereClauseHelper.formatDate(date, session);

Parameters:
date - the date to format
session - the session instance to obtain the database type
Returns:
String the formatted date
Throws:
java.lang.IllegalArgumentException - if the date parameter is null

formatGUID

public static java.lang.String formatGUID(java.lang.String sGUID)
                                   throws InvalidValueException
Formats a GUID to make it usable in a where clause when loading a business object. This changes the GUID to be in internal format.

Parameters:
sGUID - GUID in standard format {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}, where each x is an alphanumeric character
Returns:
internal representation of the GUID.
Throws:
InvalidValueException - if the GUID was not in the correct format

escapeSqlString

public static java.lang.String escapeSqlString(java.lang.String s)
Translates SQL statement's escape character, namely "'". Each "'" will changed to two "'"

Parameters:
s - the string to be translated
Returns:
the translated string.
Throws:
java.lang.IllegalArgumentException - if the string parameter is null

Primavera Integration API 7.0

Copyright © 2003, 2009, Oracle and/or its affiliates. All rights reserved.