org.apache.jdo.impl.sco
Class SqlDate

java.lang.Object
  extended by java.util.Date
      extended by java.sql.Date
          extended by org.apache.jdo.impl.sco.SqlDate
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<java.util.Date>, SCO, SCODate

public class SqlDate
extends java.sql.Date
implements SCODate

A mutable 2nd class object that represents java.sql.Date.

Version:
1.0
Author:
Marina Vatkina
See Also:
Date, Serialized Form

Constructor Summary
SqlDate()
          Creates a SqlDate object that represents the time at which it was allocated.
SqlDate(long date)
          Creates a SqlDate object that represents the given time in milliseconds.
 
Method Summary
 java.lang.Object clone()
          Creates and returns a copy of this object.
 java.lang.String getFieldName()
          Returns the field name
 java.lang.Object getOwner()
          Returns the owner object of the SCO instance
 void setDate(int date)
          Deprecated. As of JDK version 1.1, replaced by Calendar.set(Calendar.DAY_OF_MONTH, int date).
 void setMonth(int month)
          Deprecated. As of JDK version 1.1, replaced by Calendar.set(Calendar.MONTH, int month).
 void setOwner(java.lang.Object owner, int fieldNumber)
          Sets the owner and field number.
 void setTime(long time)
          Sets the SqlDate object to represent a point in time that is time milliseconds after January 1, 1970 00:00:00 GMT.
 void setTimeInternal(long time)
          Sets the SqlDate object without notification of the Owner field.
 void setYear(int year)
          Deprecated. As of JDK version 1.1, replaced by Calendar.set(Calendar.YEAR, year + 1900).
 void unsetOwner(java.lang.Object owner, int fieldNumber)
          Nullifies references to the owner Object iff the passed in owner and fieldNumber match.
 
Methods inherited from class java.sql.Date
getHours, getMinutes, getSeconds, setHours, setMinutes, setSeconds, toString, valueOf
 
Methods inherited from class java.util.Date
after, before, compareTo, equals, getDate, getDay, getMonth, getTime, getTimezoneOffset, getYear, hashCode, parse, toGMTString, toLocaleString, UTC
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SqlDate

public SqlDate()
Creates a SqlDate object that represents the time at which it was allocated.


SqlDate

public SqlDate(long date)
Creates a SqlDate object that represents the given time in milliseconds.

Parameters:
date - the number of milliseconds
Method Detail

setTime

public void setTime(long time)
Sets the SqlDate object to represent a point in time that is time milliseconds after January 1, 1970 00:00:00 GMT.

Overrides:
setTime in class java.sql.Date
Parameters:
time - the number of milliseconds.
See Also:
Date

clone

public java.lang.Object clone()
Creates and returns a copy of this object.

Mutable Second Class Objects are required to provide a public clone method in order to allow for copying PersistenceCapable objects. In contrast to Object.clone(), this method must not throw a CloneNotSupportedException.

Specified by:
clone in interface SCO
Overrides:
clone in class java.util.Date

setYear

public void setYear(int year)
Deprecated. As of JDK version 1.1, replaced by Calendar.set(Calendar.YEAR, year + 1900).

Sets the year of this SqlDate object to be the specified value plus 1900.

Overrides:
setYear in class java.util.Date
Parameters:
year - the year value.
See Also:
Calendar, Date

setMonth

public void setMonth(int month)
Deprecated. As of JDK version 1.1, replaced by Calendar.set(Calendar.MONTH, int month).

Sets the month of this date to the specified value.

Overrides:
setMonth in class java.util.Date
Parameters:
month - the month value between 0-11.
See Also:
Calendar, Date

setDate

public void setDate(int date)
Deprecated. As of JDK version 1.1, replaced by Calendar.set(Calendar.DAY_OF_MONTH, int date).

Sets the day of the month of this SqlDate object to the specified value.

Overrides:
setDate in class java.util.Date
Parameters:
date - the day of the month value between 1-31.
See Also:
Calendar, Date

setTimeInternal

public void setTimeInternal(long time)
Sets the SqlDate object without notification of the Owner field. Used internaly to populate date from DB

Specified by:
setTimeInternal in interface SCODate
Parameters:
time - the number of milliseconds.
See Also:
Date

unsetOwner

public void unsetOwner(java.lang.Object owner,
                       int fieldNumber)
Description copied from interface: SCO
Nullifies references to the owner Object iff the passed in owner and fieldNumber match.

Specified by:
unsetOwner in interface SCO
Parameters:
owner - the existing owner object.
fieldNumber - the existing number of the field.
See Also:
SCO.unsetOwner(Object owner, int fieldNumber)

setOwner

public void setOwner(java.lang.Object owner,
                     int fieldNumber)
Description copied from interface: SCO
Sets the owner and field number. Called by StateManager upon assignment to a managed instance.

Specified by:
setOwner in interface SCO
Parameters:
owner - the owner object.
fieldNumber - the number of the field associated with this instance.
See Also:
(Object owner, int fieldNumber)

getOwner

public java.lang.Object getOwner()
Description copied from interface: SCO
Returns the owner object of the SCO instance

Specified by:
getOwner in interface SCO
Returns:
owner object
See Also:
SCO.getOwner()

getFieldName

public java.lang.String getFieldName()
Description copied from interface: SCO
Returns the field name

Specified by:
getFieldName in interface SCO
Returns:
field name as java.lang.String
See Also:
SCO.getFieldName()


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.