GVKun编程网logo

DataService类的findAll方法仅返回100个实体(data.describe()可以返回数据类型吗)

27

本篇文章给大家谈谈DataService类的findAll方法仅返回100个实体,以及data.describe()可以返回数据类型吗的知识点,同时本文还将给你拓展AndroidWear应用程序崩溃与

本篇文章给大家谈谈DataService类的findAll方法仅返回100个实体,以及data.describe()可以返回数据类型吗的知识点,同时本文还将给你拓展Android Wear应用程序崩溃与FATAL EXCEPTION:IntentService [CalendarQueryService]、android – WallpaperServices的draw方法的类似Invalidate的方法、android-peekService返回null,即使startService不、Asp.net core 5 Odata 错误(services.AddOData;不工作)等相关知识,希望对各位有所帮助,不要忘了收藏本站喔。

本文目录一览:

DataService类的findAll方法仅返回100个实体(data.describe()可以返回数据类型吗)

DataService类的findAll方法仅返回100个实体(data.describe()可以返回数据类型吗)

我们已经成功地将v2
QBO迁移到v3,在生产之后,我们从一位客户那里遇到了问题。他们在QBO帐户中拥有超过100个客户。他们想将它们复制到我们的应用程序中。我们实现了这样的导入:

    DataService service = getDataService(owner);  // obtain DataService via Access Keys    List<com.intuit.ipp.data.Customer> customers =          service.findAll(new com.intuit.ipp.data.Customer());     for (com.intuit.ipp.data.Customer customer : customers) {        createCustomer(customer, owner);  // this is our internal method to create    }

如《类库参考》中所述 -方法findAll是一个

    Method to retrieve all records for the given entity.

但是我们的客户从其QBO v3帐户中 获得 前100个实体 (客户)。如果他执行相同的导入操作-
他将再次获得相同的前100个实体。此方法不允许使用任何分页选项。

所以问题是,如何获得 所有 实体?

答案1

小编典典

您应该将查询端点与页面过滤器一起使用。

以下查询获取客户1-10:

String query = select($(customer)).skip(0).take(10).generate();

输出- SELECT * FROM Customer STARTPOSITION 1 MAXRESULTS 10

以下查询使客户21-25:

String query = select($(customer)).skip(20).take(10).generate();

参考-https:
//developer.intuit.com/docs/0025_quickbooksapi/0055_devkits/0201_ipp_java_devkit_3.0/0011_query_filters#Pagination

最后

QueryResult queryResult = service.executeQuery(query);

谢谢

Android Wear应用程序崩溃与FATAL EXCEPTION:IntentService [CalendarQueryService]

Android Wear应用程序崩溃与FATAL EXCEPTION:IntentService [CalendarQueryService]

我一直在寻找遇到同样问题的其他人,但似乎无法找到任何帖子.

无论如何,我一直在用我的Nexus 5使用LG G手表,但几天之后,Android Wear应用程序不断崩溃,即我一遍又一遍地得到’Android Wear已意外停止’对话框.它到了我必须卸载Wear应用程序的程度,因此佩戴G手表毫无意义!立即重新安装应用程序会产生相同的结果.几天后我重新安装了应用程序(看到更新已被推送)并且很好但几天之后:同样的事情发生了.

logcat输出显示:

E/DatabaseUtils( 8642): Writing exception to parcel E/DatabaseUtils(
8642): java.lang.IllegalArgumentException: the bind value at index 1
is null E/DatabaseUtils( 8642): at
android.database.sqlite.sqliteProgram.bindString(sqliteProgram.java:164)
E/DatabaseUtils( 8642): at
android.database.sqlite.sqliteProgram.bindAllArgsAsstrings(sqliteProgram.java:200)
E/DatabaseUtils( 8642): at
android.database.sqlite.sqliteDirectCursorDriver.query(sqliteDirectCursorDriver.java:47)
E/DatabaseUtils( 8642): at
android.database.sqlite.sqliteDatabase.rawQueryWithFactory(sqliteDatabase.java:1314)
E/DatabaseUtils( 8642): at
android.database.sqlite.sqliteQueryBuilder.query(sqliteQueryBuilder.java:400)
E/DatabaseUtils( 8642): at
com.android.providers.contacts.ContactsProvider2.query(ContactsProvider2.java:6440)
E/DatabaseUtils( 8642): at
com.android.providers.contacts.ContactsProvider2.queryLocal(ContactsProvider2.java:6388)
E/DatabaseUtils( 8642): at
com.android.providers.contacts.ContactsProvider2.query(ContactsProvider2.java:4996)
E/DatabaseUtils( 8642): at
android.content.ContentProvider$Transport.query(ContentProvider.java:200)
E/DatabaseUtils( 8642): at
android.content.ContentProviderNative.onTransact(ContentProviderNative.java:112)
E/DatabaseUtils( 8642): at
android.os.Binder.execTransact(Binder.java:404)
E/AndroidRuntime(11842): FATAL EXCEPTION:
IntentService[CalendarQueryService] E/AndroidRuntime(11842): Process:
com.google.android.wearable.app,PID: 11842 E/AndroidRuntime(11842):
java.lang.IllegalArgumentException: the bind value at index 1 is null
E/AndroidRuntime(11842): at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:167)
E/AndroidRuntime(11842): at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137)
E/AndroidRuntime(11842): at
android.content.ContentProviderProxy.query(ContentProviderNative.java:413)
E/AndroidRuntime(11842): at
android.content.ContentResolver.query(ContentResolver.java:461)
E/AndroidRuntime(11842): at
android.content.ContentResolver.query(ContentResolver.java:404)
E/AndroidRuntime(11842): at
com.google.android.clockwork.contact.ContactInfoUtil.queryContactInfoByEmail(ContactInfoUtil.java:49)
E/AndroidRuntime(11842): at
com.google.android.clockwork.calendar.CalendarUtils.queryContactsForAttendeesAndOwnerAccounts(CalendarUtils.java:281)
E/AndroidRuntime(11842): at
com.google.android.clockwork.calendar.CalendarUtils.queryCalendarEventInstances(CalendarUtils.java:202)
E/AndroidRuntime(11842): at
com.google.android.clockwork.calendar.CalendarQueryService.onHandleIntent(CalendarQueryService.java:99)
E/AndroidRuntime(11842): at
android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
E/AndroidRuntime(11842): at
android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(11842): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(11842): at
android.os.HandlerThread.run(HandlerThread.java:61)

作为真正的Android Wear应用程序,我不确定我能做些什么来解决这个问题.有什么建议吗?

谢谢.

解决方法

两三个星期前,我遇到过类似的情况,Android Wear应用程序会在一天内多次崩溃并出现IllegalArgumentException.

我尝试删除Android Wear应用程序,重置手表(Moto 360),重新配对,从手表中删除大量应用程序,所有这些东西,多次,但没有任何帮助.

最后我擦了手机的缓存分区(Nexus 4),这似乎解决了这个问题.

Android Wear在过去两三周内没有崩溃(#FingersCrossed)

android – WallpaperServices的draw方法的类似Invalidate的方法

android – WallpaperServices的draw方法的类似Invalidate的方法

我试图用加速度计使移动位图更平滑,并且在我调用invalidate()时意外注意到了;在onDraw()方法结束时,而不是在onSensorChanged()结束时调用它,即使我没有任何类型的低通滤波器,我也能获得更平滑的移动.然后我尝试用我的LiveWallpaper做同样的事情,但是你知道在WallpaperService的引擎中没有onDraw()方法,但是你必须自己创建一个并用Handler调用它.但即使代码的其余部分与其他程序相同,这样做也不会给出任何更平滑的结果.

这是我在非壁纸程序中使用的代码,它工作正常:

public void onDraw(Canvas c) {

xPosition += xacceleration;
yPosition += yacceleration;

drawable = BitmapFactory.decodeResource(getResources(),R.drawable.ball);
c.drawBitmap(drawable,xPosition,yPosition,paint);

invalidate();

}

所以我去尝试为WallpaperService创建自己的类似无效的解决方案,并想出了这个:

void drawFrame() {
final SurfaceHolder holder = getSurfaceHolder();

Canvas c = null;
try {
c = holder.lockCanvas();
if (c != null) {
xPosition += xacceleration;
yPosition += yacceleration;

background = BitmapFactory.decodeResource(getResources(),R.drawable.bg);
drawable = BitmapFactory.decodeResource(getResources(),R.drawable.ball);

c.drawBitmap(background,null);
c.drawBitmap(drawable,null);
}
} catch (Exception ex){
}
holder.unlockCanvasAndPost(c);
drawFrame();
}

所以我要做的是:

>获取画布.
>在画布上画画.
>解锁画布并重新开始.

据我所知,这应该给我invalidate(); – 像行为,但它试图显示壁纸,然后它给我StackOverflowError.

解决方法

好的,我已经解决了这个问题.我只需要将位图初始化移动到onCreate()方法中.

android-peekService返回null,即使startService不

android-peekService返回null,即使startService不

我正在尝试使用broadcastReceiver中的Android服务.该服务与broadcastReceiver驻留在不同的应用程序中.我的理解是,正确的方法是先调用Context#startService,然后调用broadcastReceiver#peekService.调用startService似乎可以正常工作,因为它返回了预期的ComponentName.但是,当我调用peekService时,将返回null.对我在做什么错有任何想法吗?

谢谢!这是带有相关部分的代码清单.

// The Service in question is com.tingley.myapp.MyService
// Note that this Receiver is in a different application
package com.tingley.myotherapp;

public class MyReceiver extends broadcastReceiver {

  @Override
  public void onReceive(Context context, Intent intent) {

    // Start the Service
    Intent serviceIntent = new Intent();
    serviceIntent.setClassName("com.tingley.myapp", "com.tingley.myapp.MyService");
    ComponentName componentNameOfStartedService = context.startService(serviceIntent);
    Log.d("", "Started service name: " + componentNameOfStartedService);

    // Get an IBinder to the Service
    IBinder serviceBinder = peekService(context, serviceIntent);
    Log.d("", "Got binder from peeking service: " + serviceBinder);
  }
}

Log语句显示以下内容:

Started service name: ComponentInfo{com.tingley.myapp/com.tingley.myapp.MyService}
Got binder from peeking service: null

解决方法:

peekService()的文档没有完全描述获取IBinder所需的条件.正如Dianne Hackborn(Google Android工程师)在this post中所述:“仅调用startService()-您需要为相同的意图调用bindService(),因此系统已为此检索了IBinder”.

Asp.net core 5 Odata 错误(services.AddOData;不工作)

Asp.net core 5 Odata 错误(services.AddOData;不工作)

如何解决Asp.net core 5 Odata 错误(services.AddOData;不工作)?

services.AddOData();
services.AddRouting();
services.AddCors(...);

CS1920:“IServiceContainer”不包含“AddOData”的定义,最佳扩展方法重载“ODataMvcBuilderExtensions.AddOData(IMvcBuilder)”需要“IMvcBuilder”类型的接收器

我安装了所有需要的包,这里是我项目中包的列表

packages

解决方法

从 v8 开始,设置 OData 服务的推荐方法已更改为 IMvcBuilder 返回的 AddControllers() 上的扩展方法

sservices.AddControllers()
    .AddOData(opt => opt.Count().Filter().Expand().Select().OrderBy().SetMaxTop(5)/* other config */);

有关详细信息,请参阅 the docs。

关于DataService类的findAll方法仅返回100个实体data.describe()可以返回数据类型吗的介绍已经告一段落,感谢您的耐心阅读,如果想了解更多关于Android Wear应用程序崩溃与FATAL EXCEPTION:IntentService [CalendarQueryService]、android – WallpaperServices的draw方法的类似Invalidate的方法、android-peekService返回null,即使startService不、Asp.net core 5 Odata 错误(services.AddOData;不工作)的相关信息,请在本站寻找。

本文标签: