on 06-21-2004 10:01 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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>
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.