|
Oracle Application Development Framework Business Components Domains Java API Reference 10.1.3.1.0 B28971-01 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.sql.Datum
oracle.sql.TIMESTAMP
oracle.jbo.domain.Timestamp
This class extends oracle.sql.TIMESTAMP, Oracle's Java representation of the TIMESTAMP database type. This class allows an instance of the oracle.sql.TIMESTAMP to be used as an immutable domain object.
The intent of many of the methods in this class is to wrap the corresponding method in the oracle.sql class such that it returns an instance of an oracle.jbo.domain.* object.
The oracle.jbo.domain.Timestamp class is the Java representation of the underlying database type that you must use if you want to exploit the domain feature of Business Components for Java.
Timestamp
objects consist of data (a byte array) and a Domain type code. Domain dates extend SQL dates by being convertable to and from JDBC values.
The oracle.jbo.domain.Timestamp class accepts dates and times in the same format accepted by java.sql.TimeStamp (either a long milliseconds time value or the year, month, day, hour, minute, second, nano format) and java.sql.Timestamp (either a milliseconds time value or the year, month, day format).
Constructor Summary | |
Timestamp() Creates a default Timestamp Domain object. |
|
Timestamp(byte[] value) Internal: Applications should not invoke this method. |
|
Timestamp(Date value) |
|
Timestamp(java.sql.Date value) Creates a Timestamp Domain object from a JDBC java.sql.Date object. |
|
Timestamp(java.util.Date value) Creates a Timestamp Domain object from a JDBC java.util.Date object. |
|
Timestamp(long value) Creates a Timestamp Domain object from a long Timestamp value. |
|
Timestamp(java.lang.String value) Creates a Timestamp Domain object from a Java String . |
|
Timestamp(Timestamp value) Creates a Timestamp identical to an existing Timestamp . |
|
Timestamp(java.sql.Timestamp value) Creates a Timestamp Domain object from a JDBC Timestamp . |
|
Timestamp(oracle.sql.TIMESTAMP value) Creates a Timestamp Domain object from an Oracle SQL TIMESTAMP . |
Method Summary | |
java.sql.Date |
dateValue() Convert to a Date representation of the Timestamp object |
boolean |
equals(java.lang.Object other) Tests this for equality with another object. |
static oracle.sql.CustomDatumFactory |
getCustomDatumFactory() Internal: Applications should not invoke this method. |
java.lang.Object |
getData() Internal: Applications should not invoke this method. |
org.w3c.dom.Node |
getSerializedDomainXML(org.w3c.dom.Document xmlDoc) Creates the xml node in the given xml document for this domain's data in hex format of the byte[] representation of the data. |
long |
getTime() Returns the time as a long value using timestampValue().getTime(). |
java.sql.Timestamp |
getValue() Return a java.sql.Timestamp object with this domain's value. |
org.w3c.dom.Node |
getXMLContentNode(org.w3c.dom.Document xmlDoc) Creates the xml node in the given xml document for this domain's data. |
static oracle.jbo.domain.XMLDomainReaderFactory |
getXMLDomainFactory(java.lang.Class attrClass) Internal: Applications should not use this method. |
int |
hashCode() Computes a hash code for this . |
java.lang.String |
printXMLDefinition(java.util.Hashtable allDefs, java.io.PrintWriter pw, boolean bContainees) Prints the DTD info for this domain in the given print writer. |
void |
setContext(oracle.jbo.domain.DomainOwnerInterface owner, oracle.jbo.Transaction trans, java.lang.Object ctx) Internal: Applications should not invoke this method. |
oracle.sql.Datum |
toDatum(oracle.jdbc.driver.OracleConnection conn) Internal: Applications should not invoke this method. |
java.lang.String |
toString() For testing purposes only: converts this to a textual representation. |
static Timestamp |
toTimestamp(java.lang.String value) Converts an Oracle Timestamp expressed as a string to a Java Timestamp. |
Methods inherited from class oracle.sql.TIMESTAMP |
isConvertibleTo, makeJdbcArray, stringValue, timestampValue, timeValue, TimeZoneConvert, toBytes, toBytes, toBytes, toBytes, toBytes, toBytes, toDate, toDATE, toJdbc, toString, toTime, toTimestamp |
Methods inherited from class oracle.sql.Datum |
asciiStreamValue, bigDecimalValue, binaryStreamValue, booleanValue, byteValue, characterStreamValue, compareBytes, doubleValue, floatValue, getBytes, getLength, getStream, intValue, longValue, setBytes, setShareBytes, shareBytes |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface oracle.jbo.domain.KeyAttributeInterface |
getBytes, setBytes |
Constructor Detail |
public Timestamp()
Timestamp
Domain object.
This constructor does not create a null date: use one of the NullValue()
constructors.
public Timestamp(byte[] value)
Creates a Timestamp
Domain object from the given byte array.
value
- a value returned by a previous call to getBytes()
on an SQL object compatable with Timestamp
.public Timestamp(Date value)
public Timestamp(oracle.sql.TIMESTAMP value)
Timestamp
Domain object from an Oracle SQL TIMESTAMP
.value
- a TIMESTAMP
SQL object.public Timestamp(Timestamp value)
Timestamp
identical to an existing Timestamp
.value
- a Timestamp
Domain object.public Timestamp(java.sql.Timestamp value)
Timestamp
Domain object from a JDBC Timestamp
.value
- a TIMESTAMP
SQL object.public Timestamp(long value)
Timestamp
Domain object from a long Timestamp
value. Uses java.sql.Timestamp(long) to create this domain instance. This value should usually be the value returned from System.currentTimeMillis() or from Timestamp.getTime() methodpublic Timestamp(java.sql.Date value)
Timestamp
Domain object from a JDBC java.sql.Date
object.value
- a Time
SQL object.public Timestamp(java.util.Date value)
Timestamp
Domain object from a JDBC java.util.Date
object.value
- a TimeStamp
SQL object.public Timestamp(java.lang.String value)
Timestamp
Domain object from a Java String
.value
- a textual representation of a Timestamp
.Method Detail |
public static oracle.sql.CustomDatumFactory getCustomDatumFactory()
Initializes the Timestamp
Domain.
This method is invoked when JBO is initialized. Applications should not call this method directly.
CustomDatumFactory
for the Timestamp
Domain.public oracle.sql.Datum toDatum(oracle.jdbc.driver.OracleConnection conn) throws java.sql.SQLException
Converts this Timestamp
Domain object back into an SQL TIMESTAMP
object.
toDatum
in interface oracle.sql.CustomDatum
conn
- OracleConnection
Not used.Datum
containing TIMESTAMP
object.SQLException
- Never.java.sql.SQLException
public long getTime()
public java.sql.Timestamp getValue()
public java.lang.Object getData()
getData
in interface oracle.jbo.domain.DomainInterface
public java.sql.Date dateValue() throws java.sql.SQLException
SQLException,
- if no Date representation existsjava.sql.SQLException
public void setContext(oracle.jbo.domain.DomainOwnerInterface owner, oracle.jbo.Transaction trans, java.lang.Object ctx)
setContext
in interface oracle.jbo.domain.DomainInterface
public static Timestamp toTimestamp(java.lang.String value)
public java.lang.String toString()
this
to a textual representation.public boolean equals(java.lang.Object other)
this
for equality with another object. The argument is converted to a Timestamp
object, if necessary.other
- an arbitrary Object
.true
if conversion was successful and the converted argument is identical to this
.public int hashCode()
this
.this
.public java.lang.String printXMLDefinition(java.util.Hashtable allDefs, java.io.PrintWriter pw, boolean bContainees)
The allDefs hashtable contains predefined XML definitions and is passed by whatever calls this method.
printXMLDefinition
in interface oracle.jbo.domain.XMLDomainInterface
allDefs
- a hashtable of predefined XML definitions passed from whatever calls this method.pw
- print writer into which the defnition is being printed.bContainees
- if true, prints definitions of contained objects.public org.w3c.dom.Node getXMLContentNode(org.w3c.dom.Document xmlDoc)
getXMLContentNode
in interface oracle.jbo.domain.XMLDomainInterface
xmlDoc
- name of the XML document in which the node should be created.public org.w3c.dom.Node getSerializedDomainXML(org.w3c.dom.Document xmlDoc)
getSerializedDomainXML
in interface oracle.jbo.domain.XMLDomainWriter
xmlDoc
- name of the XML document in which the node should be created.public static oracle.jbo.domain.XMLDomainReaderFactory getXMLDomainFactory(java.lang.Class attrClass)
|
Oracle Application Development Framework Business Components Domains Java API Reference 10.1.3.1.0 B28971-01 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |