Package org.apache.torque.om

# Class DateKey

java.lang.Object
org.apache.torque.om.ObjectKey<Date>
org.apache.torque.om.SimpleKey<Date>
org.apache.torque.om.DateKey

All Implemented Interfaces:
  `Serializable`, `Comparable<Object>`

public class DateKey extends SimpleKey<Date>
This class can be used as an ObjectKey to uniquely identify an object within an application where the id is a Date.

Version:
  $Id: DateKey.java 1849379 2018-12-20 12:33:43Z tv $
Author:
  John McNally
See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DateKey()`
  Initializes the internal key value to `null`.
  `DateKey(String key)`
  Creates an DateKey and set its internal representation
  `DateKey(Date key)`
  Creates an DateKey and set its internal representation
  `DateKey(DateKey key)`
  Creates a DateKey that is equivalent to key.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getJdbcType()`
  Returns the JDBC type of the key as defined in `java.sql.Types`.
  `void`
  `setValue(String key)`
  Sets the internal representation to a String
  `String`
  `toString()`
  Get a String representation for this key.

  ### Methods inherited from class org.apache.torque.om.SimpleKey

  `keyFor, keyFor, keyFor, keyFor, keyFor, keyFor, keyFor, keyFor, keyFor, keyFor, keyFor`

  ### Methods inherited from class org.apache.torque.om.ObjectKey

  `appendTo, compareTo, equals, getValue, hashCode, setValue, setValue`

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

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### DateKey

    public DateKey()
    Initializes the internal key value to `null`.

  - ### DateKey

    public DateKey(String key)
    Creates an DateKey and set its internal representation
    Parameters:
      `key` - the key value as String

  - ### DateKey

    public DateKey(Date key)
    Creates an DateKey and set its internal representation
    Parameters:
      `key` - the key value

  - ### DateKey

    public DateKey(DateKey key)
    Creates a DateKey that is equivalent to key.
    Parameters:
      `key` - the key value

- ## Method Details

  - ### setValue

    public void setValue(String key)
    Sets the internal representation to a String
    Parameters:
      `key` - the key value

  - ### getJdbcType

    public int getJdbcType()
    Returns the JDBC type of the key as defined in `java.sql.Types`.
    Specified by:
      `getJdbcType` in class `ObjectKey<Date>`
    Returns:
      `Types.TIMESTAMP`.

  - ### toString

    public String toString()
    Get a String representation for this key.
    Overrides:
      `toString` in class `ObjectKey<Date>`
    Returns:
      a String representation of the Date or an empty String if the Date is null