Error while trying to save a new app table from Android Java based on Java object

java.lang.RuntimeException: Cannot save entity with primitive collection property goals
at com.backendless.async.callback.BackendlessCallback.handleFault(BackendlessCallback.java:28)
at com.backendless.Persistence$3.handleFault(Persistence.java:177)
at com.backendless.async.message.AsyncMessage$FaultHandler.handle(AsyncMessage.java:83)
at com.backendless.async.message.AsyncMessage.handleCallback(AsyncMessage.java:41)
at com.backendless.core.AndroidCarrier$1.handleMessage(AndroidCarrier.java:37)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5635)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
at dalvik.system.NativeStart.main(Native Method)

What is the data type of the “goals” property?

it’s an ArrayList of Strings

Backendless does not support arrays of primitive values, strings or date objects.

What’s the best practice to save an array of Strings related to an object?

Convert it to a JSON array and save it as a String object.

I’m hitting the 500 character limit, any way I can store it automatically as a text object through android java? Any other options?

Hi,

If json representation of array is more than 500 characters, please use TEXT column type. You can also store values as string with some separator and parse it on client side.

Regards,

Denys