Skip to Content

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,

Dominik

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Jun 21, 2004 at 10:07 AM

    ok,

    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 😔

    Dominik

    Add a comment
    10|10000 characters needed characters exceeded

    • 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...

      Greetings,

      Dominik

      <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>

  • author's profile photo Former Member
    Former Member
    Posted on 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

    class.

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

    But this is quite a usual way to document singletons.

    Regards

    Volker

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.