如何在 android中创建findAll() ?我已经尝试过了,但我无法实现;
public List findAll() { Cursor c = mDb.rawQuery("select * from " + TABLE_NAME, "", "" ); }
这是Medicament.java
public class Medicament {
private long id;
private String nom;
private String fabriquant;
private String pharmacie;
private String description;
private float prix;
public Medicament( long id, String nom, String fabriquant, String pharmacie, String description, float prix ) {
super();
this.id = id;
this.nom = nom;
this.fabriquant = fabriquant;
this.pharmacie = pharmacie;
this.description = description;
this.prix = prix;
}
public long getId() {
return id;
}
public void setId( long id ) {
this.id = id;
}
public String getNom() {
return nom;
}
public void setNom( String nom ) {
this.nom = nom;
}
public String getFabriquant() {
return fabriquant;
}
public void setFabriquant( String fabriquant ) {
this.fabriquant = fabriquant;
}
public String getPharmacie() {
return pharmacie;
}
public void setPharmacie( String pharmacie ) {
this.pharmacie = pharmacie;
}
public String getDescription() {
return description;
}
public void setDescription( String description ) {
this.description = description;
}
public float getPrix() {
return prix;
}
public void setPrix( float prix ) {
this.prix = prix;
} }
编辑:请不要忘记退货声明。
提前致谢。