java.lang.Object
org.eclipse.persistence.internal.xr.Util

public final class Util extends Object

INTERNAL: provides useful constants, SQL Column <-> to XML name mapping and a few other misc. features

Since:
EclipseLink 1.x
  • Field Details

  • Method Details

    • sqlToXmlName

      public static String sqlToXmlName(String name)
      Convert a SQL name to a valid XML name. Because not all characters that are valid in a SQL name is valid in an XML name, they need to be escaped using a special format. See the Oracle paper,"SQL/XML candidate base document", for more detail
      Parameters:
      name - the SQL name
      Returns:
      the escaped valid XML name
    • xmlToSqlName

      public static String xmlToSqlName(String name)
      Convert an escaped XML name back to the original SQL name
      Parameters:
      name - the escaped XML name
      Returns:
      the original SQL name
    • hexEscape

      public static String hexEscape(char c)
    • hexEscape

      public static String hexEscape(int c)
    • isNameChar

      public static boolean isNameChar(char c)
      return true if character can be part of a name
      Parameters:
      c - - char to be checked
      Returns:
      true/false
    • isFirstNameChar

      public static boolean isFirstNameChar(char c)
      return true if character can be part of a name
      Parameters:
      c - - char to be checked
      Returns:
      true/false
    • getClassFromJDBCType

      public static Class<?> getClassFromJDBCType(String typeName, DatabasePlatform databasePlatform)
    • getTypeNameForJDBCType

      public static String getTypeNameForJDBCType(int jdbcType)
      Return the type name to be used for a given JDBC type. This will typically be used when setting the SQL type and type name on a stored function/procedure argument. Currently, the only case we need to handle in this manner is oracle.xdb.XMLType - here we may set 2007 (OPAQUE) or 2009 (SQLXML). In the future this method may be required to return more types.
    • getJDBCTypeForTypeName

      public static int getJDBCTypeForTypeName(String typeName)