当前位置: 首页>>代码示例>>Java>>正文


Java Delete.tables方法代码示例

本文整理汇总了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
    );
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:28,代码来源:PopulateDB.java

示例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();;*/
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:19,代码来源:MalariaEspressoTest.java

示例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
    );
}
 
开发者ID:dhis2,项目名称:dhis2-android-dashboard,代码行数:19,代码来源:UserController.java

示例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
    );
}
 
开发者ID:EyeSeeTea,项目名称:malariapp,代码行数:29,代码来源:ConversionLocalDataSource.java

示例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
    );
}
 
开发者ID:EyeSeeTea,项目名称:malariapp,代码行数:29,代码来源:PopulateDB.java

示例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
        );
    }
 
开发者ID:EyeSeeTea,项目名称:malariapp,代码行数:24,代码来源:PullDhisSDKDataSource.java

示例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);
}
 
开发者ID:clrvynt,项目名称:android-offline,代码行数:12,代码来源:NoteServiceImpl.java

示例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");
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:13,代码来源:PopulateDB.java

示例9: wipeEvents

import com.raizlabs.android.dbflow.sql.language.Delete; //导入方法依赖的package包/类
public void wipeEvents() {
    Delete.tables(
            EventFlow.class,
            TrackedEntityDataValueFlow.class,
            StateFlow.class
    );
}
 
开发者ID:EyeSeeTea,项目名称:malariapp,代码行数:8,代码来源:PushDhisSDKDataSource.java

示例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
    );
}
 
开发者ID:EyeSeeTea,项目名称:pictureapp,代码行数:11,代码来源:PopulateDB.java

示例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);
}
 
开发者ID:peterjosling,项目名称:scroball,代码行数:5,代码来源:ScroballDB.java

示例12: deleteSurveys

import com.raizlabs.android.dbflow.sql.language.Delete; //导入方法依赖的package包/类
@After
public void deleteSurveys() throws Exception{
    Delete.tables(Survey.class);
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:5,代码来源:AssessCompulsoryIncompleteTest.java

示例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
    );
}
 
开发者ID:EyeSeeTea,项目名称:pictureapp,代码行数:9,代码来源:PopulateDB.java

示例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();
}
 
开发者ID:EyeSeeTea,项目名称:pictureapp,代码行数:66,代码来源:PopulateDB.java

示例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();
}
 
开发者ID:EyeSeeTea,项目名称:pictureapp,代码行数:63,代码来源:PopulateDB.java


注:本文中的com.raizlabs.android.dbflow.sql.language.Delete.tables方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。