本文整理汇总了Java中com.raizlabs.android.dbflow.sql.language.Delete.tables方法的典型用法代码示例。如果您正苦于以下问题:Java Delete.tables方法的具体用法?Java Delete.tables怎么用?Java Delete.tables使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.raizlabs.android.dbflow.sql.language.Delete
的用法示例。
在下文中一共展示了Delete.tables方法的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: 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
);
}
示例4: 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
);
}
示例5: 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
);
}
示例6: 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
);
}
示例7: 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);
}
示例8: 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");
}
示例9: wipeEvents
import com.raizlabs.android.dbflow.sql.language.Delete; //导入方法依赖的package包/类
public void wipeEvents() {
Delete.tables(
EventFlow.class,
TrackedEntityDataValueFlow.class,
StateFlow.class
);
}
示例10: wipeSurveys
import com.raizlabs.android.dbflow.sql.language.Delete; //导入方法依赖的package包/类
/**
* Delete all surveys from database (and its related info)
*/
public static void wipeSurveys() {
Delete.tables(
Value.class,
Score.class,
Survey.class
);
}
示例11: clear
import com.raizlabs.android.dbflow.sql.language.Delete; //导入方法依赖的package包/类
/** Clears all {@link Scrobble} and {@link PlaybackItem}s from the database. */
public void clear() {
Delete.tables(ScrobbleLogEntry.class, PendingPlaybackItemEntry.class);
}
示例12: deleteSurveys
import com.raizlabs.android.dbflow.sql.language.Delete; //导入方法依赖的package包/类
@After
public void deleteSurveys() throws Exception{
Delete.tables(Survey.class);
}
示例13: wipeTables
import com.raizlabs.android.dbflow.sql.language.Delete; //导入方法依赖的package包/类
/**
* Deletes all data from the app database
*/
public static void wipeTables(Class<? extends BaseModel>[] classes) {
Delete.tables(
classes
);
}
示例14: addOptionAttributes
import com.raizlabs.android.dbflow.sql.language.Delete; //导入方法依赖的package包/类
public static void addOptionAttributes(Context context) throws IOException {
FileCsvs fileCsvs = new FileCsvs();
fileCsvs.saveCsvFromAssetsToFile(PopulateDB.OPTION_ATTRIBUTES_CSV);
fileCsvs.saveCsvFromAssetsToFile(PopulateDB.OPTIONS_CSV);
List<Option> options = Option.getAllOptions();
//Reset inner references
cleanInnerLists();
CSVReader reader = new CSVReader(
new InputStreamReader(context.openFileInput(OPTION_ATTRIBUTES_CSV)), SEPARATOR,
QUOTECHAR);
CSVReader readerOptions = new CSVReader(
new InputStreamReader(context.openFileInput(OPTIONS_CSV)), SEPARATOR, QUOTECHAR);
//Remove bad optionAttributes.
Delete.tables(OptionAttribute.class);
String[] line;
//save new optionattributes
while ((line = reader.readNext()) != null) {
OptionAttribute optionAttribute = new OptionAttribute();
optionAttribute.setBackground_colour(line[1]);
optionAttribute.setPath(line[2]);
if (line.length > 3 && !line[3].equals("")) {
optionAttribute.setHorizontal_alignment(Integer.valueOf(line[3]));
} else {
optionAttribute.setHorizontal_alignment(
OptionAttribute.DEFAULT_HORIZONTAL_ALIGNMENT);
}
if (line.length > 4 && !line[4].equals("")) {
optionAttribute.setVertical_alignment(Integer.valueOf(line[4]));
} else {
optionAttribute.setVertical_alignment(OptionAttribute.DEFAULT_VERTICAL_ALIGNMENT);
}
if (line.length > 5 && !line[5].equals("")) {
optionAttribute.setText_size(Integer.valueOf(line[5]));
} else {
optionAttribute.setText_size(Integer.parseInt(
PreferencesState.getInstance().getContext().getResources().getString(
R.string.default_option_text_size)));
}
if (line.length > 6 && !line[6].equals("")) {
optionAttribute.setDefaultOption(Integer.valueOf(line[6]));
} else {
optionAttribute.setDefaultOption(0);
}
optionAttribute.save();
optionAttributeList.put(Integer.valueOf(line[0]), optionAttribute);
}
line = null;
//Save new optionattributes for each question
while ((line = readerOptions.readNext()) != null) {
for (Option option : options) {
if (String.valueOf(option.getId_option()).equals(line[0])) {
if (!line[5].equals("")) {
option.setOptionAttribute(
optionAttributeList.get(Integer.valueOf(line[5])));
option.save();
}
break;
}
}
}
reader.close();
}
示例15: addOptionTextSize
import com.raizlabs.android.dbflow.sql.language.Delete; //导入方法依赖的package包/类
public static void addOptionTextSize(Context context) throws IOException {
List<Option> options = Option.getAllOptions();
//Reset inner references
cleanInnerLists();
CSVReader reader = new CSVReader(
new InputStreamReader(context.openFileInput(OPTION_ATTRIBUTES_CSV)), SEPARATOR,
QUOTECHAR);
CSVReader readerOptions = new CSVReader(
new InputStreamReader(context.openFileInput(OPTIONS_CSV)), SEPARATOR, QUOTECHAR);
//Remove bad optionAttributes.
Delete.tables(OptionAttribute.class);
String[] line;
//save new optionattributes
while ((line = reader.readNext()) != null) {
OptionAttribute optionAttribute = new OptionAttribute();
optionAttribute.setBackground_colour(line[1]);
optionAttribute.setPath(line[2]);
if (line.length > 3 && !line[3].equals("")) {
optionAttribute.setHorizontal_alignment(Integer.valueOf(line[3]));
} else {
optionAttribute.setHorizontal_alignment(
OptionAttribute.DEFAULT_HORIZONTAL_ALIGNMENT);
}
if (line.length > 4 && !line[4].equals("")) {
optionAttribute.setVertical_alignment(Integer.valueOf(line[4]));
} else {
optionAttribute.setVertical_alignment(OptionAttribute.DEFAULT_VERTICAL_ALIGNMENT);
}
if (line.length > 5 && !line[5].equals("")) {
optionAttribute.setText_size(Integer.valueOf(line[5]));
} else {
optionAttribute.setText_size(Integer.parseInt(
PreferencesState.getInstance().getContext().getResources().getString(
R.string.default_option_text_size)));
}
if (line.length > 6 && !line[6].equals("")) {
optionAttribute.setDefaultOption(Integer.valueOf(line[6]));
} else {
optionAttribute.setDefaultOption(0);
}
optionAttribute.save();
optionAttributeList.put(Integer.valueOf(line[0]), optionAttribute);
}
line = null;
//Save new optionattributes for each question
while ((line = readerOptions.readNext()) != null) {
for (Option option : options) {
if (String.valueOf(option.getId_option()).equals(line[0])) {
if (!line[5].equals("")) {
option.setOptionAttribute(
optionAttributeList.get(Integer.valueOf(line[5])));
option.save();
}
break;
}
}
}
reader.close();
}