agrosner / DBFlow

A blazing fast, powerful, and very simple ORM android database library that writes database code for you.
MIT License
4.87k stars 598 forks source link

where is updated documentation for new version of DBFlow #1656

Closed mpt212 closed 3 years ago

mpt212 commented 5 years ago

in new version of dbflow as 5.0.0-alpha1 below code doesn't work and we have old documentation in https://agrosner.gitbooks.io link

import com.dbflow5.annotation.Column;
import com.dbflow5.annotation.OneToMany;
import com.dbflow5.annotation.PrimaryKey;
import com.dbflow5.annotation.Table;
import com.dbflow5.query.SQLite;
import com.dbflow5.structure.BaseModel;

import java.util.List;

@Table(database = AppDatabase.class, cachingEnabled = true)
public class MonthSections extends BaseModel {
    @PrimaryKey(autoincrement = true)
    private int id;

    public List<SectionLesson> lessons;

    @OneToMany(methods = {OneToMany.Method.ALL}, variableName = "lessons")
    public List<SectionLesson> getUserStoryItems() {
        if (lessons == null || lessons.isEmpty()) {
            lessons = SQLite.select()
                    .from(SectionLesson.class)
                    .where(SectionLesson_Table.monthId.eq(id))
                    .queryList();
        }
        return lessons;
    }
}

Method and eq dont work in this version

stawil15 commented 5 years ago

I'm having the same issue. I'm updating a project from 4.2.4 to the latest so that we can shift to Kotlin, and this is the one thing preventing me from compiling.

stawil15 commented 5 years ago

replace "methods = {OneToMany.Method.All)" with "oneToManyMethods = {OneToManyMethod.ALL}"

But seriously, why isn't this documented anywhere?

agrosner commented 3 years ago

https://dbflow.gitbook.io/dbflow/