For oracle date, the sql type should be timestamp instead of date.

i.e.
<field name="orderDate" type="date" required="true">
      <sql name="order_date" type="timestamp" />
      <xml node="element" />
</field>

-----Original Message-----
From: Hudson Wong [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 12, 2001 6:47
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Select Date very from Oracle


The point is:
I can get the time part when I retrieve the whole purchase order but not
"select po.orderDate"

Following is my mapping
  <class name="com.au.tpg.research.PurchaseOrder"
    identity="id" key-generator="HIGH/LOW">
    <description>Product definition</description>
    <map-to table="purchase_order" xml="order" />
    <field name="id" type="integer" required="true">
      <sql name="order_id" type="integer" />
      <xml node="attribute"/>
    </field>
    <field name="orderNo" type="string" required="true">
      <sql name="order_no" type="varchar"/>
    </field>
    <field name="orderDate" type="date" required="true">
      <sql name="order_date" type="date" />
      <xml node="element" />
    </field>
    <field name="customer" type="com.au.tpg.research.Customer"
required="true">
      <sql name="customer_id" />
      <xml name="customer" node="element" />
    </field>
    <field name="lineItemSet" type="com.au.tpg.research.LineItem"
required="true"
           collection="set" get-method="friendGetLineItemSet"
           set-method="friendSetLineItemSet">
      <sql many-key="order_id"/>
      <xml name="lineItem" node="element" />
    </field>
  </class>

-----Original Message-----
From: Low Heng Sin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 11 October 2001 3:22 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Select Date very from Oracle


You should get back the time portion too ( We are also using Oracle 8.1.7 ).
What do u use in your mapping file ?

-----Original Message-----
From: Hudson Wong [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 11, 2001 1:07
To: [EMAIL PROTECTED]
Subject: [castor-dev] Select Date very from Oracle


I have used following query to extract the order date from Oracle 8.1.7

select po.orderDate
   from PurchaseOrder po

The result is

2001-10-11 00:00:00.0
2001-10-11 00:00:00.0
2001-10-11 00:00:00.0
2001-10-11 00:00:00.0
2001-10-11 00:00:00.0
2001-10-11 00:00:00.0
2001-10-11 00:00:00.0
2001-10-11 00:00:00.0

The date retrieved only contains only the date part without the time value.

Is it possible to retrieve the time value also?

-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to