public class DaoManager {
private static DaoManager daoManager;
private final DaoSession daoSession;
private DaoManager(Context context) {
daoSession = DaoMaster.newDevSession(context, "my.db");
}
public static DaoManager instance(Context context) {
if (daoManager == null) {
synchronized (DaoManager.class) {
if (daoManager == null) {
daoManager = new DaoManager(context);
}
}
}
return daoManager;
}
public DaoSession getDaoSession() {
return daoSession;
}
}
@Entity(nameInDb = "person")
public class Person {
@Id(autoincrement = true)
private Long id;
@Property(nameInDb = "name")
private String name1;
private int age;
@Transient
private int genger;