java.lang.Object
org.eclipse.persistence.tools.dbws.Util

public class Util extends Object
  • Field Details

  • Constructor Details

    • Util

      public Util()
  • Method Details

    • getJDBCTypeFromTypeName

      public static int getJDBCTypeFromTypeName(String typeName)
      Return the JDBC type (as int) for a given type name.
    • getJDBCTypeNameFromType

      public static String getJDBCTypeNameFromType(int jdbcType)
      Return the JDBC type name for a given JDBC type code.
    • getJDBCEnumNameFromTypeName

      public static String getJDBCEnumNameFromTypeName(String typeName)
      Return the JDBC enum name for a given JDBC type name.
    • getXMLTypeFromJDBCTypeName

      public static QName getXMLTypeFromJDBCTypeName(String jdbcTypeName)
      Return the XML type (as a QName) associated with the given JDBC type name.
    • getXMLTypeFromJDBCType

      public static QName getXMLTypeFromJDBCType(Short jdbcType)
      Return the XML type (as a QName) associated with the given JDBC type.
    • getXMLTypeFromJDBCType

      public static QName getXMLTypeFromJDBCType(int jdbcType)
      Return the XML type (as a QName) associated with the given JDBC type.
    • qNameFromString

      public static QName qNameFromString(String qNameAsString, Schema schema)
    • getClassNameForType

      public static String getClassNameForType(int jdbcType)
      Returns the class name associated with a given JDBC/SQL type code.
    • buildTypeForJDBCType

      public static DatabaseType buildTypeForJDBCType(int jdbcType, int precision, int scale)
      Return a DatabaseType instance for a given JDCBType. If applicable, precision and scale values will be applied. The default type instance will be VarChar2Type.
    • getAttributeClassForDatabaseType

      public static Class<?> getAttributeClassForDatabaseType(DatabaseType dbType)
      Get the attribute class for a given DatabaseType.
    • addSimpleXMLFormat

      public static void addSimpleXMLFormat(Schema schema)
    • noOutArguments

      public static boolean noOutArguments(ProcedureType storedProcedure)
    • escapePunctuation

      public static String escapePunctuation(String originalName)
    • isNullStream

      public static boolean isNullStream(OutputStream outputStream)
    • getGeneratedJavaClassName

      public static String getGeneratedJavaClassName(String name, String projectName)
      Returns a Java class name based on a given name and project. The returned string will be in the format 'projectname.Name'. For example, given the name 'EMPLOYEE' and projectName 'TEST', the method would return the string 'test.Employee'.
    • getGeneratedAlias

      public static String getGeneratedAlias(String tableName)
      Returns an alias (typically used as a descriptor alias) based on a given table or type name. The returned string will contain an upper case first char, with the remaining chars in lower case format.
    • getGeneratedWrapperClassName

      public static String getGeneratedWrapperClassName(String name, String projectName)
      Returns a Java class name based on a given name and project. The returned string will be in the format 'projectname.Name_CollectionWrapper'. For example, given the name 'EMPLOYEE' and projectName 'TEST', the method would return the string 'test.Employee_CollectionWrapper'.
    • buildORDescriptor

      public static RelationalDescriptor buildORDescriptor(String tableName, String projectName, List<String> requireCRUDOperations, NamingConventionTransformer nct)
      Build a RelationalDescriptor for a given table.
    • buildOXDescriptor

      public static XMLDescriptor buildOXDescriptor(String tableName, String projectName, String targetNamespace, NamingConventionTransformer nct)
      Build an XMLDescriptor for a given table.
    • buildOXDescriptor

      public static XMLDescriptor buildOXDescriptor(String tableAlias, String schemaAlias, String generatedJavaClassName, String targetNamespace)
      Build an XMLDescriptor for a given table.
    • buildCustomQName

      public static QName buildCustomQName(String typeString, DBWSBuilder builder)
    • requiresSimpleXMLFormat

      public static boolean requiresSimpleXMLFormat(XRServiceModel serviceModel)
    • sqlMatch

      public static boolean sqlMatch(String pattern, String input)
    • isTypeComplex

      public static boolean isTypeComplex(DatabaseType dbType)
      Indicates if a given DatabaseType is considered 'complex', i.e. is one of PLSQLRecordType, PLSQLCollectionType, VArrayType, ObjectType, or NestedTableType
    • isArgComplex

      public static boolean isArgComplex(ArgumentType argument)
      Indicates if a given ArgumentType is considered 'complex', i.e. it has a data type that is one of PLSQLRecordType, PLSQLCollectionType, VArrayType, ObjectType, or NestedTableType
    • isArgPLSQL

      public static boolean isArgPLSQL(ArgumentType argument)
      Indicates if a given ArgumentType is considered a PL/SQL argument, i.e. it has a data type that is one of PLSQLRecordType, PLSQLCollectionType, BOOLEAN_TYPE, BINARY_INTEGER_TYPE, PLS_INTEGER_TYPE, etc.
    • isArgPLSQLScalar

      public static boolean isArgPLSQLScalar(ArgumentType argument)
      Indicates if a given ArgumentType is considered a PL/SQL scalar argument, i.e. it has a data type that is one of BOOLEAN_TYPE, BINARY_INTEGER_TYPE, PLS_INTEGER_TYPE, etc.
    • isArgPLSQLScalar

      public static boolean isArgPLSQLScalar(String argTypeName)
      Indicates if a given argument type name is considered a PL/SQL scalar argument, i.e. is one of BOOLEAN, BINARY_INTEGER, PLS_INTEGER, etc.
    • getOraclePLSQLTypeForName

      public static String getOraclePLSQLTypeForName(String typeName)
      Return the Oracle PL/SQL name for a given PL/SQL scalar type.
    • hasComplexArgs

      public static boolean hasComplexArgs(ProcedureType storedProcedure)
      Indicates if a given ProcedureType contains one or more arguments that are considered 'complex', i.e. PLSQLRecordType, PLSQLCollectionType, VArrayType, ObjectType, or NestedTableType. Note that for FunctionType the return argument is tested as well.
    • hasPLSQLArgs

      public static boolean hasPLSQLArgs(ProcedureType storedProcedure)
      Indicates if a given ProcedureType contains one or more PL/SQL arguments, i.e. PLSQLRecordType, PLSQLCollectionType, or scalars BOOLEAN_TYPE, BINARY_INTEGER_TYPE, PLS_INTEGER_TYPE, etc. Note that for FunctionType the return argument is tested as well.
    • hasPLSQLArgs

      public static boolean hasPLSQLArgs(List<ArgumentType> arguments)
      Indicates if a given list of ArgumentTypes contains one or more PL/SQL arguments, i.e. PLSQLRecordType, PLSQLCollectionType, or scalars BOOLEAN_TYPE, BINARY_INTEGER_TYPE, PLS_INTEGER_TYPE, etc. In addition, an optional argument must be treated as PL/SQL as default/optional parameter handling is done via PLSQLStoredProcedureCall
    • hasComplexArgs

      public static boolean hasComplexArgs(List<ArgumentType> arguments)
      Indicates if a given List<ArgumentType> contains one or more arguments that are considered 'complex', i.e. PLSQLRecordType, PLSQLCollectionType, VArrayType, ObjectType, or NestedTableType
    • hasPLSQLScalarArgs

      public static boolean hasPLSQLScalarArgs(List<ArgumentType> arguments)
      Indicates if a given List<ArgumentType> contains one or more arguments that are considered PL/SQL scalars, i.e. PLSQLBoolean, PLSQLInteger, BinaryInteger, etc.
    • hasPLSQLCursorArg

      public static boolean hasPLSQLCursorArg(List<ArgumentType> arguments)
      Indicates if a given List<ArgumentType> contains a PL/SQL Cursor type.
    • shouldSetJavaType

      public static boolean shouldSetJavaType(String typeName)
      Convenience method used to determine if the java class and/or java type name should be set on a given procedure argument. This will typically be used when calling addNamedInOutputArgument on a stored procedure call.