emilsjolander / sprinkles

Sprinkles is a boiler-plate-reduction-library for dealing with databases in android applications
Apache License 2.0
772 stars 84 forks source link

What is the best way to delete all the data of a table? #62

Closed tmsbn closed 10 years ago

tmsbn commented 10 years ago

I have read the documentation but I am a little confused about how to clear the current date in the table. Currently I am doing this

ModelList person=ModelList.from(Query.all(Person.class).get()) person.deleteAll()

Is this the best way?

emilsjolander commented 10 years ago

Yes, this is the best way if you want att the callbacks to be called on Person.class

You could also perform the delete manually via new SqlStatement("delete from Persons")