org.apache.openjpa.util
Class ProxyTimestamp

java.lang.Object
  extended by java.util.Date
      extended by java.sql.Timestamp
          extended by org.apache.openjpa.util.ProxyTimestamp
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Date>, Proxy, ProxyDate

public class ProxyTimestamp
extends Timestamp
implements ProxyDate

Extension of the Timestamp type that calls the dirty method on its owning persistence capable instance on modification. This class does not support modification via any deprecated method of the date class.

Author:
Abe White
See Also:
Serialized Form

Constructor Summary
ProxyTimestamp()
           
ProxyTimestamp(long time)
           
 
Method Summary
 Object copy(Object orig)
          Return an unproxied copy of the given instance.
 ChangeTracker getChangeTracker()
          Return the change tracker for this proxy, or null if none.
 OpenJPAStateManager getOwner()
          Return the owning object.
 int getOwnerField()
          Return the owning field index.
 ProxyDate newInstance()
          Return a new instance of this date type.
 void setDate(int val)
           
 void setHours(int val)
           
 void setMinutes(int val)
           
 void setMonth(int val)
           
 void setNanos(int nanos)
           
 void setOwner(OpenJPAStateManager sm, int field)
          Reset the state of the proxy, and set the owning instance of the proxy and the name of the field it is assigned to.
 void setSeconds(int val)
           
 void setTime(long millis)
           
 void setYear(int val)
           
protected  Object writeReplace()
           
 
Methods inherited from class java.sql.Timestamp
after, before, compareTo, compareTo, equals, equals, getNanos, getTime, toString, valueOf
 
Methods inherited from class java.util.Date
after, before, clone, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTimezoneOffset, getYear, hashCode, parse, toGMTString, toLocaleString, UTC
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProxyTimestamp

public ProxyTimestamp()

ProxyTimestamp

public ProxyTimestamp(long time)
Method Detail

newInstance

public ProxyDate newInstance()
Description copied from interface: ProxyDate
Return a new instance of this date type.

Specified by:
newInstance in interface ProxyDate

setOwner

public void setOwner(OpenJPAStateManager sm,
                     int field)
Description copied from interface: Proxy
Reset the state of the proxy, and set the owning instance of the proxy and the name of the field it is assigned to. Set to null to indicate that the proxy is no longer managed.

Specified by:
setOwner in interface Proxy

getOwner

public OpenJPAStateManager getOwner()
Description copied from interface: Proxy
Return the owning object.

Specified by:
getOwner in interface Proxy

getOwnerField

public int getOwnerField()
Description copied from interface: Proxy
Return the owning field index.

Specified by:
getOwnerField in interface Proxy

getChangeTracker

public ChangeTracker getChangeTracker()
Description copied from interface: Proxy
Return the change tracker for this proxy, or null if none.

Specified by:
getChangeTracker in interface Proxy

copy

public Object copy(Object orig)
Description copied from interface: Proxy
Return an unproxied copy of the given instance. This method is used by proxy managers to create backup values for use in rollback.

Specified by:
copy in interface Proxy

setYear

public void setYear(int val)
Overrides:
setYear in class Date

setMonth

public void setMonth(int val)
Overrides:
setMonth in class Date

setDate

public void setDate(int val)
Overrides:
setDate in class Date

setHours

public void setHours(int val)
Overrides:
setHours in class Date

setMinutes

public void setMinutes(int val)
Overrides:
setMinutes in class Date

setSeconds

public void setSeconds(int val)
Overrides:
setSeconds in class Date

setTime

public void setTime(long millis)
Overrides:
setTime in class Timestamp

setNanos

public void setNanos(int nanos)
Overrides:
setNanos in class Timestamp

writeReplace

protected Object writeReplace()
                       throws ObjectStreamException
Throws:
ObjectStreamException


Copyright © 2006 Apache Software Foundation. All Rights Reserved.