本文整理汇总了Java中com.raizlabs.android.dbflow.sql.language.Delete类的典型用法代码示例。如果您正苦于以下问题:Java Delete类的具体用法?Java Delete怎么用?Java Delete使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Delete类属于com.raizlabs.android.dbflow.sql.language包,在下文中一共展示了Delete类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: wipeDatabase
import com.raizlabs.android.dbflow.sql.language.Delete; //导入依赖的package包/类
/**
* Deletes all data from the app database
*/
public static void wipeDatabase() {
Delete.tables(
Value.class,
Score.class,
Survey.class,
SurveySchedule.class,
OrgUnit.class,
OrgUnitLevel.class,
OrgUnitProgramRelation.class,
User.class,
QuestionOption.class,
Match.class,
QuestionRelation.class,
Question.class,
CompositeScore.class,
Option.class,
Answer.class,
Header.class,
Tab.class,
Program.class,
ServerMetadata.class,
Media.class
);
}
示例2: cleanDB
import com.raizlabs.android.dbflow.sql.language.Delete; //导入依赖的package包/类
public static void cleanDB(){
if(!databaseExists()){
return;
}
// Clean DB
Delete.tables(Question.class, CompositeScore.class, Option.class, Answer.class, Header.class, Tab.class, Program.class, OrgUnit.class, User.class, Value.class, Survey.class);
/*new Delete().from(Question.class).where(Condition.column(Question$Table.ID).isNotNull()).query();
new Delete().from(CompositeScore.class).where(Condition.column(CompositeScore$Table.ID).isNotNull()).query();;
new Delete().from(Option.class).where(Condition.column(Option$Table.ID).isNotNull()).query();;
new Delete().from(Answer.class).where(Condition.column(Answer$Table.ID).isNotNull()).query();;
new Delete().from(Header.class).where(Condition.column(Header$Table.ID).isNotNull()).query();;
new Delete().from(Tab.class).where(Condition.column(Tab$Table.ID).isNotNull()).query();;
new Delete().from(Program.class).where(Condition.column(Program$Table.ID).isNotNull()).query();;
new Delete().from(OrgUnit.class).where(Condition.column(OrgUnit$Table.ID).isNotNull()).query();;
new Delete().from(User.class).where(Condition.column(User$Table.ID).isNotNull()).query();;
new Delete().from(Value.class).where(Condition.column(Value$Table.ID).isNotNull()).query();;
new Delete().from(Survey.class).where(Condition.column(Survey$Table.ID).isNotNull()).query();;*/
}
示例3: addFun_Part
import com.raizlabs.android.dbflow.sql.language.Delete; //导入依赖的package包/类
public static void addFun_Part(List<Results> results) {
Delete.table(PartDbBean.class);
for (Results result : results) {
PartDbBean partDbBean = new PartDbBean();
partDbBean.who = result.getWho();
partDbBean.publishedAt = result.getPublishedAt();
partDbBean.desc = result.getDesc();
partDbBean.type = result.getType();
partDbBean.url = result.getUrl();
partDbBean.used = result.getUsed();
partDbBean.objectId = result.get_id();
partDbBean.createdAt = result.getCreatedAt();
partDbBean.save();
}
}
示例4: addFun_Girly
import com.raizlabs.android.dbflow.sql.language.Delete; //导入依赖的package包/类
public static void addFun_Girly(List<Results> results) {
Delete.table(GirlyDbBean.class);
for (Results result : results) {
GirlyDbBean girlyDbBean = new GirlyDbBean();
girlyDbBean.who = result.getWho();
girlyDbBean.publishedAt = result.getPublishedAt();
girlyDbBean.desc = result.getDesc();
girlyDbBean.type = result.getType();
girlyDbBean.url = result.getUrl();
girlyDbBean.used = result.getUsed();
girlyDbBean.objectId = result.get_id();
girlyDbBean.createdAt = result.getCreatedAt();
girlyDbBean.save();
}
}
示例5: addFun_Real
import com.raizlabs.android.dbflow.sql.language.Delete; //导入依赖的package包/类
public static void addFun_Real(List<List<Results>> results) {
Delete.table(RealDbBean.class);
for (List<Results> result : results) {
for (int i = 0; i < result.size(); i++) {
RealDbBean realDbBean = new RealDbBean();
realDbBean.who = result.get(i).getWho();
realDbBean.publishedAt = result.get(i).getPublishedAt();
realDbBean.desc = result.get(i).getDesc();
realDbBean.type = result.get(i).getType();
realDbBean.url = result.get(i).getUrl();
realDbBean.used = result.get(i).getUsed();
realDbBean.objectId = result.get(i).get_id();
realDbBean.createdAt = result.get(i).getCreatedAt();
realDbBean.save();
}
}
}
示例6: logOut
import com.raizlabs.android.dbflow.sql.language.Delete; //导入依赖的package包/类
public void logOut() {
LastUpdatedManager.getInstance().delete();
DateTimeManager.getInstance().delete();
SessionManager.getInstance().delete();
// remove data
Delete.tables(
Dashboard.class,
DashboardElement.class,
DashboardItem.class,
DashboardItemContent.class,
Interpretation.class,
InterpretationComment.class,
InterpretationElement.class,
User.class,
UserAccount.class
);
}
示例7: wipeDataBase
import com.raizlabs.android.dbflow.sql.language.Delete; //导入依赖的package包/类
/**
* Deletes all data from the app database
*/
public static void wipeDataBase() {
Delete.tables(
Value.class,
Score.class,
Survey.class,
SurveySchedule.class,
OrgUnit.class,
OrgUnitLevel.class,
OrgUnitProgramRelation.class,
User.class,
QuestionOption.class,
Match.class,
QuestionRelation.class,
Question.class,
CompositeScore.class,
Option.class,
Answer.class,
Header.class,
Tab.class,
Program.class,
ServerMetadata.class,
Media.class
);
}
示例8: wipeDatabase
import com.raizlabs.android.dbflow.sql.language.Delete; //导入依赖的package包/类
/**
* Deletes all data from the app database
*/
public static void wipeDatabase() {
Delete.tables(
Value.class,
Score.class,
Survey.class,
SurveySchedule.class,
OrgUnit.class,
OrgUnitLevel.class,
OrgUnitProgramRelation.class,
User.class,
QuestionOption.class,
Match.class,
QuestionRelation.class,
Question.class,
CompositeScore.class,
org.eyeseetea.malariacare.data.database.model.Option.class,
Answer.class,
Header.class,
Tab.class,
org.eyeseetea.malariacare.data.database.model.Program.class,
ServerMetadata.class,
Media.class
);
}
示例9: wipeDataBase
import com.raizlabs.android.dbflow.sql.language.Delete; //导入依赖的package包/类
public void wipeDataBase() {
Delete.tables(
EventFlow.class,
TrackedEntityDataValueFlow.class,
DataElementFlow.class,
ProgramFlow.class,
AttributeFlow.class,
AttributeValueFlow.class,
ModelLinkFlow.class,
OptionSetFlow.class,
OptionFlow.class,
OrganisationUnitFlow.class,
OrganisationUnitLevelFlow.class,
OrganisationUnitToProgramRelationFlow.class,
ProgramStageDataElementFlow.class,
ProgramStageSectionFlow.class,
ProgramStageFlow.class,
FailedItemFlow.class,
StateFlow.class,
FailedItemFlow.class
);
}
示例10: onDelete
import com.raizlabs.android.dbflow.sql.language.Delete; //导入依赖的package包/类
@Test
public void onDelete() {
save("张三");
new Delete().from(UserModel.class)
.where(UserModel_Table.name.eq("张三"))
.execute();
Assert.assertEquals(0, new Select(Method.count()).from(UserModel.class).count());
}
示例11: deleteEntityWithId
import com.raizlabs.android.dbflow.sql.language.Delete; //导入依赖的package包/类
@CheckResult
@NonNull
@Override
public Completable deleteEntityWithId(@NonNull Id entityId) {
return Completable
.fromAction(() ->
new Delete()
.from(getModelClass())
.where(getPropertyId().eq(entityId))
.execute())
.subscribeOn(Schedulers.io());
}
示例12: deleteStock
import com.raizlabs.android.dbflow.sql.language.Delete; //导入依赖的package包/类
public Observable<Stocks> deleteStock(final String symbol) {
return Observable.defer(new Func0<Observable<Stocks>>() {
@Override
public Observable<Stocks> call() {
Delete.table(Quote.class,
Quote_Table.msymbol.eq(symbol));
return getStocks();
}
});
}
示例13: onAdded
import com.raizlabs.android.dbflow.sql.language.Delete; //导入依赖的package包/类
@Override
public void onAdded() {
ITransaction it = new ITransaction() {
@Override
public void execute(DatabaseWrapper databaseWrapper) {
// List all model tables here to delete.
Delete.tables(Note.class);
}
};
FlowManager.getDatabase(NoteDB.class).executeTransaction(it);
}
示例14: clearTable
import com.raizlabs.android.dbflow.sql.language.Delete; //导入依赖的package包/类
@OnClick(R.id.btnClearTable)
public void clearTable()
{
if (radioGroup.getCheckedRadioButtonId() == R.id.radioUser)
{
Delete.table(UserModel.class);
Snackbar.make(layoutMain, "User Table cleared in Database!", Snackbar.LENGTH_SHORT).show();
}
else if (radioGroup.getCheckedRadioButtonId() == R.id.radioCompany)
{
Delete.table(CompanyModel.class);
Snackbar.make(layoutMain, "Company Table Cleared in Database!", Snackbar.LENGTH_SHORT).show();
}
updateCountText();
}
示例15: wipeSDKData
import com.raizlabs.android.dbflow.sql.language.Delete; //导入依赖的package包/类
/**
* Deletes all data from the sdk database
*/
public static void wipeSDKData() {
Delete.tables(
Event.class,
DataValue.class,
FailedItem.class
);
DateTimeManager.getInstance().delete();
Log.d(TAG,"Delete sdk db");
}