de.esprit.appsuite.database.dbase

## Class DBUtil

- java.lang.Object
- - de.esprit.appsuite.database.dbase.DBUtil

-     public class DBUtil
      extends java.lang.Object

  Collection of convenience methods that provide support for the DBObjects.
  Author:
    Rainer Buesch

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `DBUtil.EmptyBlob` Represents an empty Blob object.
    `static class` | `DBUtil.EmptyClob` Represents an empty Clob object.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DBUtil()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `columnNameOf(java.lang.String fullName)` Extracts the columnname from the fullName given in the format table.column
    `static java.lang.Object` | `convertFieldValue(java.lang.Class fieldType, java.lang.String strValue)`
    `static void` | `copyDBRecordValues(DBRecord toDbo, DBRecord fromDbo, boolean isIncludePK)` Copies the value of fromDbo to the toDbo record.
    `static DBRecord[]` | `createAvailableTypes(DBRecord rec)`
    `static DBRecord[]` | `createAvailableTypes(DBRecord[] recs)`
    `static void` | `deleteInTransaction(DBRecord[] records)`
    `static java.sql.Blob` | `emptyBlob()` Returns a cached instance of an empty Blob.
    `static java.sql.Clob` | `emptyClob()` Returns a cached instance of an empty Clob.
    `static java.lang.Object` | `getDBOFieldValue(DBRecord dbo, java.lang.String fieldName)`
    `static void` | `insertInTransaction(DBRecord[] records)`
    `static boolean` | `isBooleanClass(java.lang.Class c)`
    `static boolean` | `isNumberClass(java.lang.Class c)`
    `static boolean` | `isNumericZero(java.lang.Object obj)`
    `static void` | `setDBOFieldValue(DBRecord dbo, java.lang.String fieldName, java.lang.Object value)`
    `static java.lang.String` | `tableNameOf(java.lang.String fullName)` Extracts the tablename from the fullName given in the format table.column
    `static int` | `toId(java.lang.String idString)` Converts a number string into an int value.
    `static java.lang.String` | `toIsolationLevelString(int isoLevel)`
    `static void` | `updateInTransaction(DBRecord[] records)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DBUtil

          public DBUtil()

  - ### Method Detail

    - #### toId

          public static int toId(java.lang.String idString)

      Converts a number string into an int value. Returns -1 when the string is invalid.

    - #### emptyBlob

          public static java.sql.Blob emptyBlob()

      Returns a cached instance of an empty Blob.

    - #### emptyClob

          public static java.sql.Clob emptyClob()

      Returns a cached instance of an empty Clob.

    - #### createAvailableTypes

          public static DBRecord[] createAvailableTypes(DBRecord rec)

    - #### createAvailableTypes

          public static DBRecord[] createAvailableTypes(DBRecord[] recs)

    - #### isNumericZero

          public static boolean isNumericZero(java.lang.Object obj)

    - #### isNumberClass

          public static boolean isNumberClass(java.lang.Class c)

    - #### isBooleanClass

          public static boolean isBooleanClass(java.lang.Class c)

    - #### convertFieldValue

          public static java.lang.Object convertFieldValue(java.lang.Class fieldType,
                                           java.lang.String strValue)
                                                    throws DataConversionException

      Throws:
        `DataConversionException`

    - #### toIsolationLevelString

          public static java.lang.String toIsolationLevelString(int isoLevel)

    - #### insertInTransaction

          public static void insertInTransaction(DBRecord[] records)
                                          throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### updateInTransaction

          public static void updateInTransaction(DBRecord[] records)
                                          throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### deleteInTransaction

          public static void deleteInTransaction(DBRecord[] records)
                                          throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### columnNameOf

          public static java.lang.String columnNameOf(java.lang.String fullName)

      Extracts the columnname from the fullName given in the format table.column

    - #### tableNameOf

          public static java.lang.String tableNameOf(java.lang.String fullName)

      Extracts the tablename from the fullName given in the format table.column

    - #### copyDBRecordValues

          public static void copyDBRecordValues(DBRecord toDbo,
                                DBRecord fromDbo,
                                boolean isIncludePK)
                                         throws java.lang.Exception

      Copies the value of fromDbo to the toDbo record. Note: copying is done by introspection and works only on methods named get$FieldName and set$FieldName
      Parameters:
        `isIncludePK` - defines whether the primary key values should also be copied.
      Throws:
        `java.lang.Exception`

    - #### getDBOFieldValue

          public static java.lang.Object getDBOFieldValue(DBRecord dbo,
                                          java.lang.String fieldName)
                                                   throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### setDBOFieldValue

          public static void setDBOFieldValue(DBRecord dbo,
                              java.lang.String fieldName,
                              java.lang.Object value)
                                       throws java.lang.Exception

      Throws:
        `java.lang.Exception`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.