Skip to Content
avatar image
Former Member

SmartSync API

Hi all,

please have a look at the following code example from MDK documentation:

<b><i>//Query for 010 ChildRows with SYNC_KEY</i> <i>> '10000000001'</i>

Condition singleCondition = queryFactory.createCondition(syncKeyFieldDescriptor,RelationalOperatorType.GREATER_THAN,"10000000001");

Query rowQuery = queryFactory.createQuery(child101RowDescriptor,singleCondition);</b>

Fine. But how can I get an instance of SmartSyncQueryFactory? The reference variable 'queryFactory' is null....

Thanks for any help,


Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jun 21, 2004 at 10:07 AM


    the first problem got solved: of course we can not instatiate an interface...

    We can call getInstance() of QueryRuntime class.

    But the next problem is: What is expected with the first parameter of

    <b>createQuery(java.lang.String classtype, Condition condition)</b> function of class QueryRuntime??

    There is (again) no sample code for this in MDK. I could imagine that we need a SyncBoDescriptor, but calling

    <b>getClass().toString()</b> on a SyncBoDescriptor-instance doesn't work at all 😔


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Finally, i've got it. The documentation of SmartSync API is bad. You need to have an instance of SmartSyncQueryFactory by calling <b>SmartSyncRuntime.getInstance().getQueryFactory();</b>

      This was nowhere documentated...



      <i>PS: If someone wants to communicate via e-Mail with me please post a little note or your mail-address here and I will contact you...Maybe this is a faster approach to share experiences about Mobile Engine and (mobile) Java Development.</i>

  • avatar image
    Former Member
    Jul 12, 2004 at 03:22 PM

    It is kind of documented by the methods javadoc itself

    public static SmartSyncRuntim getInstance()

    - Returns the static instance of this SmartSyncRuntime


    and the fact, that this method is the only static one.

    But this is quite a usual way to document singletons.



    Add comment
    10|10000 characters needed characters exceeded