Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Fetching with timestamp as Criteria?

    hi,

    We are trying to get only new or updated records from an oracle 10.0g Database. The client side criteria that we send to the server looks like this:
    Code:
    Date date = /* last request date */;
    AdvancedCriteria criteria = new AdvancedCriteria("DEF_TIMESTAMP", OperatorId.GREATER_THAN, date);
    dataSource.fetch(criteria);
    The resulting sql query selects rows whose timestamp is greater than TO_DATE('2010-11-09', 'yyyy-mm-dd'). No time is added. But we need the time part since we want to receive all updates since last fetch.

    DatasourceField is specified as
    Code:
    <field sqlType="timestamp" sqlLength="30" name="DEF_TIMESTAMP" type="datetime"></field>
    The database we access is a Oracle 10g (10.2.0.4) DB and we use SmartGWT Power Edition 2.3.

    How can we persuade smartgwt to add the time part?

    Thanks in advance

    #2
    Where did you actually get the "last request date"? It may be marked as a logical date (rather than a timestamp), which would lead to the issue you're seeing.

    Comment


      #3
      hi,

      "last request date" is a normal java.util.Date. I tried to create a criteria Map on the server in the DMI class like this:
      Code:
      Map dateMap = new HashMap();
      dateMap.put("operator", "greaterThan");
      dateMap.put("fieldName", "DEF_TIMESTAMP");
      dateMap.put("value", new Date());
      No matter how i try it always comes to this sql query:
      Code:
      ... WHERE ((VTM.DEF_TIMESTAMP > To_Date('2010-11-10','yyyy-mm-dd') AND....
      The time part is being ignored. Which object should i use? java.sql.Date and java.sql.Timestamp give the same output.

      thanks
      Last edited by kissev; 10 Nov 2010, 03:31.

      Comment


        #4
        This problem is being caused by a bug that we have now fixed. Please try your use case with tomorrow's nightly build.

        Comment


          #5
          This problem is being caused by a bug that we have now fixed. Please try your use case with tomorrow's nightly build.
          Thank you for the fix.

          But one question about your nightly builds. These builds should not be used in production, right?

          For production, we have to wait for the next official release of SmartGWT Power Edition?

          Comment


            #6
            Take a look at smartclient.com/builds. Limited support is available for nightly builds, so it's up to you.

            Comment

            Working...
            X