Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is weak-typing supported when modifying record? #11

Open
j4nos opened this issue Nov 30, 2016 · 1 comment
Open

Is weak-typing supported when modifying record? #11

j4nos opened this issue Nov 30, 2016 · 1 comment

Comments

@j4nos
Copy link

j4nos commented Nov 30, 2016

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants