浏览代码

cloud db

/unity2020
siyao 3 年前
当前提交
fb6fa719
共有 10 个文件被更改,包括 236 次插入149 次删除
  1. 26
      Assets/HuaweiService/cloud_db/AGConnectCloudDB.cs
  2. 12
      Assets/HuaweiService/cloud_db/CloudDBZone.cs
  3. 6
      Assets/HuaweiService/cloud_db/CloudDBZoneConfig.cs
  4. 186
      Assets/HuaweiService/cloud_db/CloudDBZoneQuery.cs
  5. 23
      Assets/HuaweiService/cloud_db/OnSnapshotListener.cs
  6. 55
      Assets/HuaweiService/cloud_db/Transaction.cs
  7. 21
      Assets/HuaweiServiceDemo/HuaweiCloudDBDemo/Scripts/CloudDBTest.cs
  8. 1
      Assets/Plugins/Android/launcherTemplate.gradle
  9. 18
      Assets/HuaweiService/cloud_db/EntireEncrypted.cs
  10. 37
      Assets/HuaweiService/cloud_db/FieldType.cs

26
Assets/HuaweiService/cloud_db/AGConnectCloudDB.cs


Call("disableNetwork", arg0);
}
public class EventListener_Data : IHmsBaseClass{
public class EventListenerData : IHmsBaseListener
{
public string buildName => "";
public class EventListener :HmsClass<EventListener_Data>
public class EventListener : HmsListener<EventListenerData>
public EventListener (): base() { }
public virtual void onEvent(EventType arg0) {
Call("onEvent", arg0);
}
public void onEvent(AndroidJavaObject arg0){
onEvent(HmsUtil.GetHmsBase<EventType>(arg0));
}
public class OnDataEncryptionKeyChangeListener_Data : IHmsBaseClass{
public class OnDataEncryptionKeyChangeListenerData : IHmsBaseListener
{
public string buildName => "";
public class OnDataEncryptionKeyChangeListener :HmsClass<OnDataEncryptionKeyChangeListener_Data>
public class OnDataEncryptionKeyChangeListener : HmsListener<OnDataEncryptionKeyChangeListenerData>
public OnDataEncryptionKeyChangeListener (): base() { }
public virtual bool needFetchDataEncryptionKey() {
return Call<bool>("needFetchDataEncryptionKey");
}
}
public class EventType_Data : IHmsBaseClass{

12
Assets/HuaweiService/cloud_db/CloudDBZone.cs


}
public class CloudDBZone :HmsClass<CloudDBZone_Data>
{
public const int MAX_OBJECT_LIST_SIZE = 1000;
public const int MAX_OBJECT_LIST_CAPACITY = 2097152;
public Task executeUpsert(List arg0) {
public Task executeUpsert(CloudDBZoneObject arg0) {
public Task executeUpsert(IDatabaseModel arg0) {
public Task executeUpsert(List arg0) {
}
public Task executeDelete(IDatabaseModel arg0) {
}
public Task executeDelete(CloudDBZoneObject arg0) {
return Call<Task>("executeDelete", arg0);
}
public Task executeQuery(CloudDBZoneQuery arg0, CloudDBZoneQuery.CloudDBZoneQueryPolicy arg1) {

return Call<Task>("runTransaction", arg0);
}
public ListenerHandler subscribeSnapshot(CloudDBZoneQuery arg0, CloudDBZoneQuery.CloudDBZoneQueryPolicy arg1, OnSnapshotListener arg2) {
return Call<ListenerHandler>("subscribeSnapshot", arg0, arg1, new DBListener(arg2));
return Call<ListenerHandler>("subscribeSnapshot", arg0, arg1, arg2);
}
}
}

6
Assets/HuaweiService/cloud_db/CloudDBZoneConfig.cs


}
public class CloudDBZoneAccessProperty :HmsClass<CloudDBZoneAccessProperty_Data>
{
public static CloudDBZoneAccessProperty CLOUDDBZONE_PUBLIC => HmsUtil.GetStaticValue<CloudDBZoneAccessProperty>("CLOUDDBZONE_PUBLIC", name);
public static CloudDBZoneAccessProperty CLOUDDBZONE_PUBLIC => HmsUtil.GetStaticValue<CloudDBZoneAccessProperty>("CLOUDDBZONE_PUBLIC");
public CloudDBZoneAccessProperty (): base() { }
}

}
public class CloudDBZoneSyncProperty :HmsClass<CloudDBZoneSyncProperty_Data>
{
public static CloudDBZoneSyncProperty CLOUDDBZONE_LOCAL_ONLY => HmsUtil.GetStaticValue<CloudDBZoneSyncProperty>("CLOUDDBZONE_LOCAL_ONLY", name);
public static CloudDBZoneSyncProperty CLOUDDBZONE_LOCAL_ONLY => HmsUtil.GetStaticValue<CloudDBZoneSyncProperty>("CLOUDDBZONE_LOCAL_ONLY");
public static CloudDBZoneSyncProperty CLOUDDBZONE_CLOUD_CACHE => HmsUtil.GetStaticValue<CloudDBZoneSyncProperty>("CLOUDDBZONE_CLOUD_CACHE", name);
public static CloudDBZoneSyncProperty CLOUDDBZONE_CLOUD_CACHE => HmsUtil.GetStaticValue<CloudDBZoneSyncProperty>("CLOUDDBZONE_CLOUD_CACHE");
public CloudDBZoneSyncProperty (): base() { }
}

186
Assets/HuaweiService/cloud_db/CloudDBZoneQuery.cs


using UnityEngine;
using System.Collections.Generic;
using HuaweiService;
namespace HuaweiService.CloudDB
{

public static CloudDBZoneQuery where(AndroidJavaClass arg0) {
return CallStatic<CloudDBZoneQuery>("where", arg0);
}
public CloudDBZoneQuery equalTo(string arg0, long arg1) {
public CloudDBZoneQuery equalTo(string arg0, Text arg1) {
public CloudDBZoneQuery equalTo(string arg0, string arg1) {
public CloudDBZoneQuery equalTo(string arg0, int arg1) {
public CloudDBZoneQuery equalTo(string arg0, int arg1) {
public CloudDBZoneQuery equalTo(string arg0, long arg1) {
return Call<CloudDBZoneQuery>("equalTo", arg0, arg1);
}
public CloudDBZoneQuery equalTo(string arg0, double arg1) {

return Call<CloudDBZoneQuery>("equalTo", arg0, arg1);
}
public CloudDBZoneQuery equalTo(string arg0, Text arg1) {
public CloudDBZoneQuery equalTo(string arg0, string arg1) {
return Call<CloudDBZoneQuery>("equalTo", arg0, arg1);
}
public CloudDBZoneQuery equalTo(string arg0, Date arg1) {

return Call<CloudDBZoneQuery>("equalTo", arg0, arg1);
}
public CloudDBZoneQuery equalTo(string arg0, short arg1) {
public CloudDBZoneQuery equalTo(string arg0, byte arg1) {
public CloudDBZoneQuery equalTo(string arg0, byte arg1) {
public CloudDBZoneQuery equalTo(string arg0, short arg1) {
public CloudDBZoneQuery notEqualTo(string arg0, long arg1) {
return Call<CloudDBZoneQuery>("notEqualTo", arg0, arg1);
}
public CloudDBZoneQuery notEqualTo(string arg0, double arg1) {
return Call<CloudDBZoneQuery>("notEqualTo", arg0, arg1);
}
public CloudDBZoneQuery notEqualTo(string arg0, float arg1) {
return Call<CloudDBZoneQuery>("notEqualTo", arg0, arg1);
}
public CloudDBZoneQuery notEqualTo(string arg0, int arg1) {
return Call<CloudDBZoneQuery>("notEqualTo", arg0, arg1);
}

public CloudDBZoneQuery notEqualTo(string arg0, byte arg1) {
public CloudDBZoneQuery notEqualTo(string arg0, long arg1) {
public CloudDBZoneQuery notEqualTo(string arg0, Text arg1) {
public CloudDBZoneQuery notEqualTo(string arg0, byte arg1) {
return Call<CloudDBZoneQuery>("notEqualTo", arg0, arg1);
}
public CloudDBZoneQuery notEqualTo(string arg0, Text arg1) {
return Call<CloudDBZoneQuery>("notEqualTo", arg0, arg1);
}
public CloudDBZoneQuery notEqualTo(string arg0, Date arg1) {

return Call<CloudDBZoneQuery>("notEqualTo", arg0, arg1);
}
public CloudDBZoneQuery greaterThan(string arg0, int arg1) {
return Call<CloudDBZoneQuery>("greaterThan", arg0, arg1);
}
public CloudDBZoneQuery greaterThan(string arg0, short arg1) {
return Call<CloudDBZoneQuery>("greaterThan", arg0, arg1);
public CloudDBZoneQuery notEqualTo(string arg0, float arg1) {
return Call<CloudDBZoneQuery>("notEqualTo", arg0, arg1);
}
public CloudDBZoneQuery notEqualTo(string arg0, double arg1) {
return Call<CloudDBZoneQuery>("notEqualTo", arg0, arg1);
public CloudDBZoneQuery greaterThan(string arg0, byte arg1) {
public CloudDBZoneQuery greaterThan(string arg0, double arg1) {
return Call<CloudDBZoneQuery>("greaterThan", arg0, arg1);
}
public CloudDBZoneQuery greaterThan(string arg0, string arg1) {
return Call<CloudDBZoneQuery>("greaterThan", arg0, arg1);
}
public CloudDBZoneQuery greaterThan(string arg0, Text arg1) {

return Call<CloudDBZoneQuery>("greaterThan", arg0, arg1);
}
public CloudDBZoneQuery greaterThan(string arg0, string arg1) {
public CloudDBZoneQuery greaterThan(string arg0, float arg1) {
public CloudDBZoneQuery greaterThan(string arg0, float arg1) {
public CloudDBZoneQuery greaterThan(string arg0, byte arg1) {
public CloudDBZoneQuery greaterThan(string arg0, double arg1) {
public CloudDBZoneQuery greaterThan(string arg0, short arg1) {
public CloudDBZoneQuery greaterThanOrEqualTo(string arg0, int arg1) {
public CloudDBZoneQuery greaterThan(string arg0, int arg1) {
return Call<CloudDBZoneQuery>("greaterThan", arg0, arg1);
}
public CloudDBZoneQuery greaterThanOrEqualTo(string arg0, double arg1) {
public CloudDBZoneQuery greaterThanOrEqualTo(string arg0, double arg1) {
public CloudDBZoneQuery greaterThanOrEqualTo(string arg0, int arg1) {
public CloudDBZoneQuery greaterThanOrEqualTo(string arg0, Text arg1) {
public CloudDBZoneQuery greaterThanOrEqualTo(string arg0, short arg1) {
public CloudDBZoneQuery greaterThanOrEqualTo(string arg0, float arg1) {
public CloudDBZoneQuery greaterThanOrEqualTo(string arg0, byte arg1) {
public CloudDBZoneQuery greaterThanOrEqualTo(string arg0, string arg1) {
public CloudDBZoneQuery greaterThanOrEqualTo(string arg0, Text arg1) {
public CloudDBZoneQuery greaterThanOrEqualTo(string arg0, byte arg1) {
public CloudDBZoneQuery greaterThanOrEqualTo(string arg0, string arg1) {
public CloudDBZoneQuery greaterThanOrEqualTo(string arg0, short arg1) {
public CloudDBZoneQuery greaterThanOrEqualTo(string arg0, float arg1) {
public CloudDBZoneQuery lessThanOrEqualTo(string arg0, int arg1) {
return Call<CloudDBZoneQuery>("lessThanOrEqualTo", arg0, arg1);
}
public CloudDBZoneQuery lessThanOrEqualTo(string arg0, long arg1) {
return Call<CloudDBZoneQuery>("lessThanOrEqualTo", arg0, arg1);
}
public CloudDBZoneQuery lessThanOrEqualTo(string arg0, double arg1) {
return Call<CloudDBZoneQuery>("lessThanOrEqualTo", arg0, arg1);
}
public CloudDBZoneQuery lessThanOrEqualTo(string arg0, Text arg1) {
return Call<CloudDBZoneQuery>("lessThanOrEqualTo", arg0, arg1);
}
public CloudDBZoneQuery lessThanOrEqualTo(string arg0, float arg1) {
return Call<CloudDBZoneQuery>("lessThanOrEqualTo", arg0, arg1);
}
public CloudDBZoneQuery lessThanOrEqualTo(string arg0, string arg1) {
return Call<CloudDBZoneQuery>("lessThanOrEqualTo", arg0, arg1);
}
public CloudDBZoneQuery lessThanOrEqualTo(string arg0, Date arg1) {
return Call<CloudDBZoneQuery>("lessThanOrEqualTo", arg0, arg1);
}
public CloudDBZoneQuery lessThanOrEqualTo(string arg0, byte arg1) {
return Call<CloudDBZoneQuery>("lessThanOrEqualTo", arg0, arg1);
}
public CloudDBZoneQuery lessThanOrEqualTo(string arg0, short arg1) {
return Call<CloudDBZoneQuery>("lessThanOrEqualTo", arg0, arg1);
}
public CloudDBZoneQuery lessThan(string arg0, short arg1) {
public CloudDBZoneQuery lessThan(string arg0, double arg1) {
public CloudDBZoneQuery lessThan(string arg0, double arg1) {
public CloudDBZoneQuery lessThan(string arg0, Date arg1) {
return Call<CloudDBZoneQuery>("lessThan", arg0, arg1);
}
public CloudDBZoneQuery lessThan(string arg0, float arg1) {

public CloudDBZoneQuery lessThan(string arg0, Text arg1) {
return Call<CloudDBZoneQuery>("lessThan", arg0, arg1);
}
public CloudDBZoneQuery lessThan(string arg0, Date arg1) {
public CloudDBZoneQuery lessThan(string arg0, int arg1) {
public CloudDBZoneQuery lessThan(string arg0, int arg1) {
public CloudDBZoneQuery lessThan(string arg0, short arg1) {
public CloudDBZoneQuery @in(string arg0, int[] arg1) {
return Call<CloudDBZoneQuery>("in", arg0, (object)arg1);
public CloudDBZoneQuery lessThanOrEqualTo(string arg0, float arg1) {
return Call<CloudDBZoneQuery>("lessThanOrEqualTo", arg0, arg1);
public CloudDBZoneQuery @in(string arg0, long[] arg1) {
return Call<CloudDBZoneQuery>("in", arg0, (object)arg1);
public CloudDBZoneQuery lessThanOrEqualTo(string arg0, string arg1) {
return Call<CloudDBZoneQuery>("lessThanOrEqualTo", arg0, arg1);
public CloudDBZoneQuery @in(string arg0, double[] arg1) {
return Call<CloudDBZoneQuery>("in", arg0, (object)arg1);
public CloudDBZoneQuery lessThanOrEqualTo(string arg0, Date arg1) {
return Call<CloudDBZoneQuery>("lessThanOrEqualTo", arg0, arg1);
public CloudDBZoneQuery @in(string arg0, short[] arg1) {
return Call<CloudDBZoneQuery>("in", arg0, (object)arg1);
public CloudDBZoneQuery lessThanOrEqualTo(string arg0, Text arg1) {
return Call<CloudDBZoneQuery>("lessThanOrEqualTo", arg0, arg1);
public CloudDBZoneQuery @in(string arg0, byte[] arg1) {
return Call<CloudDBZoneQuery>("in", arg0, (object)arg1);
public CloudDBZoneQuery lessThanOrEqualTo(string arg0, byte arg1) {
return Call<CloudDBZoneQuery>("lessThanOrEqualTo", arg0, arg1);
}
public CloudDBZoneQuery lessThanOrEqualTo(string arg0, short arg1) {
return Call<CloudDBZoneQuery>("lessThanOrEqualTo", arg0, arg1);
}
public CloudDBZoneQuery lessThanOrEqualTo(string arg0, int arg1) {
return Call<CloudDBZoneQuery>("lessThanOrEqualTo", arg0, arg1);
}
public CloudDBZoneQuery lessThanOrEqualTo(string arg0, long arg1) {
return Call<CloudDBZoneQuery>("lessThanOrEqualTo", arg0, arg1);
}
public CloudDBZoneQuery lessThanOrEqualTo(string arg0, double arg1) {
return Call<CloudDBZoneQuery>("lessThanOrEqualTo", arg0, arg1);
}
public CloudDBZoneQuery @in(string arg0, Long[] arg1) {
return Call<CloudDBZoneQuery>("in", arg0, arg1);
}
public CloudDBZoneQuery @in(string arg0, Float[] arg1) {
return Call<CloudDBZoneQuery>("in", arg0, arg1);
}
public CloudDBZoneQuery @in(string arg0, Double[] arg1) {
return Call<CloudDBZoneQuery>("in", arg0, arg1);
}
public CloudDBZoneQuery @in(string arg0, Integer[] arg1) {
return Call<CloudDBZoneQuery>("in", arg0, arg1);
}
public CloudDBZoneQuery @in(string arg0, Short[] arg1) {
return Call<CloudDBZoneQuery>("in", arg0, arg1);
}
public CloudDBZoneQuery @in(string arg0, Byte[] arg1) {
return Call<CloudDBZoneQuery>("in", arg0, arg1);
return Call<CloudDBZoneQuery>("in", arg0, (object)arg1);
return Call<CloudDBZoneQuery>("in", arg0, arg1);
return Call<CloudDBZoneQuery>("in", arg0, (object)arg1);
return Call<CloudDBZoneQuery>("in", arg0, arg1);
return Call<CloudDBZoneQuery>("in", arg0, (object)arg1);
}
public CloudDBZoneQuery @in(string arg0, float[] arg1) {
return Call<CloudDBZoneQuery>("in", arg0, (object)arg1);
return Call<CloudDBZoneQuery>("in", arg0, arg1);
}
public CloudDBZoneQuery beginsWith(string arg0, string arg1) {
return Call<CloudDBZoneQuery>("beginsWith", arg0, arg1);

}
public CloudDBZoneQuery endsWith(string arg0, Text arg1) {
public CloudDBZoneQuery endsWith(string arg0, string arg1) {
public CloudDBZoneQuery endsWith(string arg0, string arg1) {
public CloudDBZoneQuery endsWith(string arg0, Text arg1) {
return Call<CloudDBZoneQuery>("endsWith", arg0, arg1);
}
public CloudDBZoneQuery contains(string arg0, string arg1) {

public CloudDBZoneQuery limit(int arg0) {
return Call<CloudDBZoneQuery>("limit", arg0);
}
public CloudDBZoneQuery startAt(CloudDBZoneObject arg0) {
return Call<CloudDBZoneQuery>("startAt", arg0);
}
public CloudDBZoneQuery startAfter(CloudDBZoneObject arg0) {
return Call<CloudDBZoneQuery>("startAfter", arg0);
}
public CloudDBZoneQuery endAt(CloudDBZoneObject arg0) {
return Call<CloudDBZoneQuery>("endAt", arg0);
}
public CloudDBZoneQuery endBefore(CloudDBZoneObject arg0) {
return Call<CloudDBZoneQuery>("endBefore", arg0);
}
public class CloudDBZoneQueryPolicy_Data : IHmsBaseClass{
public class CloudDBZoneQueryPolicy_Data : IHmsBaseClass{
public static CloudDBZoneQueryPolicy POLICY_QUERY_FROM_LOCAL_ONLY => HmsUtil.GetStaticValue<CloudDBZoneQueryPolicy>("POLICY_QUERY_FROM_LOCAL_ONLY", name);
public static CloudDBZoneQueryPolicy POLICY_QUERY_FROM_LOCAL_ONLY => HmsUtil.GetStaticValue<CloudDBZoneQueryPolicy>("POLICY_QUERY_FROM_LOCAL_ONLY");
public static CloudDBZoneQueryPolicy POLICY_QUERY_FROM_CLOUD_ONLY => HmsUtil.GetStaticValue<CloudDBZoneQueryPolicy>("POLICY_QUERY_FROM_CLOUD_ONLY");
public static CloudDBZoneQueryPolicy POLICY_QUERY_FROM_CLOUD_ONLY => HmsUtil.GetStaticValue<CloudDBZoneQueryPolicy>("POLICY_QUERY_FROM_CLOUD_ONLY", name);
public static CloudDBZoneQueryPolicy POLICY_QUERY_DEFAULT => HmsUtil.GetStaticValue<CloudDBZoneQueryPolicy>("POLICY_QUERY_DEFAULT");
public CloudDBZoneQueryPolicy (): base() { }
}

23
Assets/HuaweiService/cloud_db/OnSnapshotListener.cs


using System.Collections.Generic;
using System.Collections.Generic;
namespace HuaweiService.CloudDB {
public class OnSnapshotListener_Data : IHmsBaseListener {
namespace HuaweiService.CloudDB
{
public class OnSnapshotListenerData : IHmsBaseListener
{
public class OnSnapshotListener : HmsListener<OnSnapshotListener_Data> {
public OnSnapshotListener () : base () { }
public virtual void onSnapshot (CloudDBZoneSnapshot arg0, AGConnectCloudDBException arg1) {
Call ("onSnapshot", arg0, arg1);
public class OnSnapshotListener : HmsListener<OnSnapshotListenerData>
{
public virtual void onSnapshot(CloudDBZoneSnapshot arg0, AGConnectCloudDBException arg1) {
Call("onSnapshot", arg0, arg1);
public void onSnapshot (AndroidJavaObject arg0, AndroidJavaObject arg1) {
onSnapshot (HmsUtil.GetHmsBase<CloudDBZoneSnapshot> (arg0),
HmsUtil.GetHmsBase<AGConnectCloudDBException> (arg1));
public void onSnapshot(AndroidJavaObject arg0, AndroidJavaObject arg1){
onSnapshot(HmsUtil.GetHmsBase<CloudDBZoneSnapshot>(arg0), HmsUtil.GetHmsBase<AGConnectCloudDBException>(arg1));
}
}

55
Assets/HuaweiService/cloud_db/Transaction.cs


using System;
using System.Collections.Generic;
using System.Collections.Generic;
namespace HuaweiService.CloudDB {
public delegate bool apply (Transaction t);
public class Transaction_Data : IHmsBaseClass {
namespace HuaweiService.CloudDB
{
public class Transaction_Data : IHmsBaseClass{
public class Transaction : HmsClass<Transaction_Data> {
public Transaction () {
public class Transaction :HmsClass<Transaction_Data>
{
public Transaction (): base() { }
public List executeQuery(CloudDBZoneQuery arg0) {
return Call<List>("executeQuery", arg0);
public List executeQuery (CloudDBZoneQuery arg0) {
return Call<List> ("executeQuery", arg0);
public Transaction executeUpsert(List arg0) {
return Call<Transaction>("executeUpsert", arg0);
public Transaction executeUpsert<T> (List<T> arg0) where T : IDatabaseModel {
return Call<Transaction> ("executeUpsert", arg0);
public Transaction executeDelete(List arg0) {
return Call<Transaction>("executeDelete", arg0);
public Transaction executeDelete (List arg0) {
return Call<Transaction> ("executeDelete", arg0);
}
public bool isTransactionEmpty () {
return Call<bool> ("isTransactionEmpty");
public class FunctionData : IHmsBaseListener
{
public string name => "com.huawei.agconnect.cloud.database.Transaction$Function";
public string buildName => "";
public class Function : AndroidJavaProxy {
private apply cb;
private static string _name = "com.huawei.agconnect.cloud.database.Transaction$Function";
public Function (apply cb) : base (_name) {
this.cb = cb;
public class Function : HmsListener<FunctionData>
{
public virtual bool apply(Transaction arg0) {
return Call<bool>("apply", arg0);
public bool apply (AndroidJavaObject arg0) {
Type type = typeof (Transaction);
Transaction input = (Transaction) Activator.CreateInstance (type);
input.obj = arg0;
return this.cb.Invoke (input);
public bool apply(AndroidJavaObject arg0){
return apply(HmsUtil.GetHmsBase<Transaction>(arg0));
}
}
}

21
Assets/HuaweiServiceDemo/HuaweiCloudDBDemo/Scripts/CloudDBTest.cs


private ListenerHandler mRegister;
private CloudDBZoneConfig mConfig;
private CloudDBZoneQuery mQuery;
private static CloudDBZoneQuery mQuery;
private static bool captureSnapshot;
private static CloudDBZoneObjectList<BookInfo> mObjectList = new CloudDBZoneObjectList<BookInfo> ();

}
var bookInfo = new BookInfo { Id = 4 };
Task task = mCloudDBZone.executeUpsert (bookInfo);
Task task = mCloudDBZone.executeUpsert (bookInfo.toType<CloudDBZoneObject>());
task.addOnSuccessListener (new HmsSuccessListener<int> ((cloudDBZoneResult) => {
TestTip.Inst.ShowText ("upsert " + cloudDBZoneResult + " records");
})).addOnFailureListener (new HmsFailureListener ((exception) => {

mObjectList = snapshot.getSnapshotObjects ();
BookInfo bookInfo = mObjectList.get (3);
Task deleteTask = mCloudDBZone.executeDelete (bookInfo);
Task deleteTask = mCloudDBZone.executeDelete (bookInfo.toType<CloudDBZoneObject>());
deleteTask.addOnSuccessListener (new HmsSuccessListener<int> ((cloudDBZoneResult) => {
TestTip.Inst.ShowText ("delete " + cloudDBZoneResult + " records");
})).addOnFailureListener (new HmsFailureListener ((exception) => {

TestTip.Inst.ShowText ("Snapshot getUpsertedObjects: " + snapshot.getUpsertedObjects ().size ());
}
}
public void testTransaction () {
Transaction.Function f = new Transaction.Function ((t) => {
public class CustomFunction: Transaction.Function
{
public override bool apply(Transaction t)
{
try {
mQuery = CloudDBZoneQuery.where (new AndroidJavaClass (bookInfoClass)).equalTo ("bookName", "testTransaction");
var queryList = t.executeQuery (mQuery);

return false;
}
return true;
});
}
}
public void testTransaction ()
{
Transaction.Function f = new CustomFunction();
TestTip.Inst.ShowText ("Run Transaction.");
mCloudDBZone.runTransaction (f);
}

1
Assets/Plugins/Android/launcherTemplate.gradle


implementation 'com.huawei.hms:base:5.0.5.300'
implementation 'com.huawei.hms:game:5.0.4.302'
implementation 'com.huawei.hms:hwid:5.0.5.301'
implementation 'com.huawei.agconnect:agconnect-cloud-database:1.4.10.300'
}
android {

18
Assets/HuaweiService/cloud_db/EntireEncrypted.cs


using UnityEngine;
using System.Collections.Generic;
namespace HuaweiService.CloudDB
{
public class EntireEncryptedData : IHmsBaseListener
{
public string name => "com.huawei.agconnect.cloud.database.annotations.EntireEncrypted";
public string buildName => "";
}
public class EntireEncrypted : HmsListener<EntireEncryptedData>
{
public virtual bool isEncrypted() {
return Call<bool>("isEncrypted");
}
}
}

37
Assets/HuaweiService/cloud_db/FieldType.cs


using UnityEngine;
using System.Collections.Generic;
namespace HuaweiService.CloudDB
{
public class FieldType_Data : IHmsBaseClass{
public string name => "com.huawei.agconnect.cloud.database.FieldType";
}
public class FieldType :HmsClass<FieldType_Data>
{
public static FieldType b => HmsUtil.GetStaticValue<FieldType>("b");
public static FieldType c => HmsUtil.GetStaticValue<FieldType>("c");
public static FieldType d => HmsUtil.GetStaticValue<FieldType>("d");
public static FieldType e => HmsUtil.GetStaticValue<FieldType>("e");
public static FieldType f => HmsUtil.GetStaticValue<FieldType>("f");
public static FieldType g => HmsUtil.GetStaticValue<FieldType>("g");
public static FieldType h => HmsUtil.GetStaticValue<FieldType>("h");
public static FieldType i => HmsUtil.GetStaticValue<FieldType>("i");
public static FieldType j => HmsUtil.GetStaticValue<FieldType>("j");
public static FieldType k => HmsUtil.GetStaticValue<FieldType>("k");
public static FieldType l => HmsUtil.GetStaticValue<FieldType>("l");
public static FieldType m => HmsUtil.GetStaticValue<FieldType>("m");
public FieldType (): base() { }
}
}
正在加载...
取消
保存