greenrobot / greenDAO

greenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases.
http://greenrobot.org/greendao/
12.63k stars 2.89k forks source link

How to used loadByRowId()? #1020

Open DearDaXiong opened 4 years ago

DearDaXiong commented 4 years ago

package com.example.greendaotest;

import org.greenrobot.greendao.annotation.Entity; import org.greenrobot.greendao.annotation.Id; import org.greenrobot.greendao.annotation.Generated;

@Entity public class User { @Id(autoincrement = true) private Long id;

private String name;

@Generated(hash = 873297011)
public User(Long id, String name) {
    this.id = id;
    this.name = name;
}

@Generated(hash = 586692638)
public User() {
}

public Long getId() {
    return this.id;
}

public void setId(Long id) {
    this.id = id;
}

public String getName() {
    return this.name;
}

public void setName(String name) {
    this.name = name;
}

}

I want to query the records with the specified number of rows。for example,There are five records in this table. I want to check the third record。I see that the loadbyrowid() interface is available,but not query. so,i want to know How to use the loadbyrowid() interface?and my issues can how to query?