Closed Queatz closed 10 years ago
Wow ! You made it ?!
I'll test it tomorrow !
Can you provide a full example usage of this new feature ?
@ChristopheCVB it's a simple implementation and not very smart, so I'd only use it for small projects. For small projects it should work great, though.
Basic usage is like this:
Person.java
class Person extends Entity {
public String name;
@Column(inverse = "person")
public ArrayList<Hobby> hobbies;
}
Hobby.java
class Hobby extends Entity {
public String type;
public Person person;
}
And then you would just use it like normal:
Person person = Entity.query(Person).where(eql("name", "Christ")).execute();
for(Hobby hobby : person.hobbies)
Log.d(TAG, "Hobby found: " + hobby.type);
Hope this helps!
This is now in master. Thanks again @Queatz and sorry it took so long!
Awesome, good to have it. :)
it seems to me this feature doesn't work or may be I do something wrong. Question and code snippets here http://stackoverflow.com/questions/24697824/ormdroid-one-to-many-relationship
There are a few changes here.
There are a few white-space removals, I apologize for that. My editor auto trims.