dkharrat / NexusData

Core Data for Android
Apache License 2.0
72 stars 19 forks source link

Is weak-typing supported when modifying record? #11

Open j4nos opened 7 years ago

j4nos commented 7 years ago

In iOS it is possible to modify managedObject like this: mo.setValue(obj, forKey: "someAttribute")

Is it possible pass argument i.e. string and not class, pass argument without static type-check?

Or only by passing class as argument? Task task1 = objCtx.newObject(Task.class);

http://stackoverflow.com/questions/40890602/get-dao-with-weak-typing-in-ormlite

dkharrat commented 7 years ago

Yes, it's possible. Each ManagedObject object exposes setValue and getValue. For example:

task1.setValue("name", "the task's name")

Note that the schema for the ManagedObject must define the field.