• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SQLiteUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.activeandroid.util.SQLiteUtils的典型用法代码示例。如果您正苦于以下问题:Java SQLiteUtils类的具体用法?Java SQLiteUtils怎么用?Java SQLiteUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SQLiteUtils类属于com.activeandroid.util包,在下文中一共展示了SQLiteUtils类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: executeCreateIndex

import com.activeandroid.util.SQLiteUtils; //导入依赖的package包/类
private void executeCreateIndex(SQLiteDatabase db) {
	db.beginTransaction();
	try {
		for (TableInfo tableInfo : Cache.getTableInfos()) {
			String[] definitions = SQLiteUtils.createIndexDefinition(tableInfo);

			for (String definition : definitions) {
				db.execSQL(definition);
			}
		}
		db.setTransactionSuccessful();
	}
	finally {
		db.endTransaction();
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:DatabaseHelper.java


示例2: fixUpTable

import com.activeandroid.util.SQLiteUtils; //导入依赖的package包/类
private static void fixUpTable() {
    if (patched) return;
    final String[] patchup = {
            "CREATE TABLE BloodTest (_id INTEGER PRIMARY KEY AUTOINCREMENT);",
            "ALTER TABLE BloodTest ADD COLUMN timestamp INTEGER;",
            "ALTER TABLE BloodTest ADD COLUMN created_timestamp INTEGER;",
            "ALTER TABLE BloodTest ADD COLUMN state INTEGER;",
            "ALTER TABLE BloodTest ADD COLUMN mgdl REAL;",
            "ALTER TABLE BloodTest ADD COLUMN source TEXT;",
            "ALTER TABLE BloodTest ADD COLUMN uuid TEXT;",
            "CREATE UNIQUE INDEX index_Bloodtest_uuid on BloodTest(uuid);",
            "CREATE UNIQUE INDEX index_Bloodtest_timestamp on BloodTest(timestamp);",
            "CREATE INDEX index_Bloodtest_created_timestamp on BloodTest(created_timestamp);",
            "CREATE INDEX index_Bloodtest_state on BloodTest(state);"};

    for (String patch : patchup) {
        try {
            SQLiteUtils.execSql(patch);
            //  UserError.Log.e(TAG, "Processed patch should not have succeeded!!: " + patch);
        } catch (Exception e) {
            //  UserError.Log.d(TAG, "Patch: " + patch + " generated exception as it should: " + e.toString());
        }
    }
    patched = true;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:26,代码来源:BloodTest.java


示例3: fixUpTable

import com.activeandroid.util.SQLiteUtils; //导入依赖的package包/类
private static void fixUpTable() {
    if (patched) return;
    String[] patchup = {
            "CREATE TABLE PebbleMovement (_id INTEGER PRIMARY KEY AUTOINCREMENT);",
            "ALTER TABLE PebbleMovement ADD COLUMN timestamp INTEGER;",
            "ALTER TABLE PebbleMovement ADD COLUMN metric INTEGER;",
            "CREATE UNIQUE INDEX index_PebbleMovement_timestamp on PebbleMovement(timestamp);"};

    for (String patch : patchup) {
        try {
            SQLiteUtils.execSql(patch);
            //  UserError.Log.e(TAG, "Processed patch should not have succeeded!!: " + patch);
        } catch (Exception e) {
            //  UserError.Log.d(TAG, "Patch: " + patch + " generated exception as it should: " + e.toString());
        }
    }
    patched = true;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:19,代码来源:PebbleMovement.java


示例4: fixUpTable

import com.activeandroid.util.SQLiteUtils; //导入依赖的package包/类
private static void fixUpTable() {
    if (patched) return;
    String[] patchup = {
            "CREATE TABLE HeartRate (_id INTEGER PRIMARY KEY AUTOINCREMENT);",
            "ALTER TABLE HeartRate ADD COLUMN timestamp INTEGER;",
            "ALTER TABLE HeartRate ADD COLUMN bpm INTEGER;",
            "ALTER TABLE HeartRate ADD COLUMN accuracy INTEGER;",
            "CREATE UNIQUE INDEX index_HeartRate_timestamp on HeartRate(timestamp);"};

    for (String patch : patchup) {
        try {
            SQLiteUtils.execSql(patch);
            //  UserError.Log.e(TAG, "Processed patch should not have succeeded!!: " + patch);
        } catch (Exception e) {
            //  UserError.Log.d(TAG, "Patch: " + patch + " generated exception as it should: " + e.toString());
        }
    }
    patched = true;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:20,代码来源:HeartRate.java


示例5: fixUpTable

import com.activeandroid.util.SQLiteUtils; //导入依赖的package包/类
private static void fixUpTable() {
    if (patched) return;
    String[] patchup = {
            "CREATE TABLE Treatments (_id INTEGER PRIMARY KEY AUTOINCREMENT);",
            "ALTER TABLE Treatments ADD COLUMN timestamp INTEGER;",
            "ALTER TABLE Treatments ADD COLUMN uuid TEXT;",
            "ALTER TABLE Treatments ADD COLUMN eventType TEXT;",
            "ALTER TABLE Treatments ADD COLUMN enteredBy TEXT;",
            "ALTER TABLE Treatments ADD COLUMN notes TEXT;",
            "ALTER TABLE Treatments ADD COLUMN created_at TEXT;",
            "ALTER TABLE Treatments ADD COLUMN insulin REAL;",
            "ALTER TABLE Treatments ADD COLUMN carbs REAL;",
            "CREATE INDEX index_Treatments_timestamp on Treatments(timestamp);",
            "CREATE UNIQUE INDEX index_Treatments_uuid on Treatments(uuid);"};

    for (String patch : patchup) {
        try {
            SQLiteUtils.execSql(patch);
            //Log.e(TAG, "Processed patch should not have succeeded!!: " + patch);
        } catch (Exception e) {
            // Log.d(TAG, "Patch: " + patch + " generated exception as it should: " + e.toString());
        }
    }
    patched = true;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:26,代码来源:Treatments.java


示例6: execute

import com.activeandroid.util.SQLiteUtils; //导入依赖的package包/类
public <T extends Model> List<T> execute() {
	if (mQueryBase instanceof Select) {
		return SQLiteUtils.rawQuery(mType, toSql(), getArguments());
		
	} else {
		SQLiteUtils.execSql(toSql(), getArguments());
		Cache.getContext().getContentResolver().notifyChange(ContentProvider.createUri(mType, null), null);
		return null;
		
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:From.java


示例7: executeSingle

import com.activeandroid.util.SQLiteUtils; //导入依赖的package包/类
public <T extends Model> T executeSingle() {
	if (mQueryBase instanceof Select) {
		limit(1);
		return (T) SQLiteUtils.rawQuerySingle(mType, toSql(), getArguments());
		
	} else {
		limit(1);
		SQLiteUtils.rawQuerySingle(mType, toSql(), getArguments()).delete();
		return null;
		
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:From.java


示例8: executeCreate

import com.activeandroid.util.SQLiteUtils; //导入依赖的package包/类
private void executeCreate(SQLiteDatabase db) {
	db.beginTransaction();
	try {
		for (TableInfo tableInfo : Cache.getTableInfos()) {
			db.execSQL(SQLiteUtils.createTableDefinition(tableInfo));
		}
		db.setTransactionSuccessful();
	}
	finally {
		db.endTransaction();
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:DatabaseHelper.java


示例9: cleanup

import com.activeandroid.util.SQLiteUtils; //导入依赖的package包/类
public static void cleanup(long timestamp) {
    try {
        SQLiteUtils.execSql("delete from CalibrationRequest");
        List<Calibration> data = new Select()
                .from(BgReading.class)
                .where("timestamp < ?", timestamp)
                .orderBy("timestamp desc")
                .execute();
        if (data != null) Log.d(TAG, "cleanup Calibration size=" + data.size());
        new Calibration.Cleanup().execute(data);
    } catch (Exception e) {
        Log.e(TAG, "Got exception running cleanup " + e.toString());
    }
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:15,代码来源:Calibration.java


示例10: fixUpTable

import com.activeandroid.util.SQLiteUtils; //导入依赖的package包/类
public static void fixUpTable() {
    if (patched) return;

    for (String patch : schema) {
        try {
            SQLiteUtils.execSql(patch);
        } catch (Exception e) {
            if (d)
                UserError.Log.d(TAG, "Patch: " + patch + " generated exception as it should: " + e.toString());
        }
    }
    patched = true;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:14,代码来源:UserNotification.java


示例11: fixUpTable

import com.activeandroid.util.SQLiteUtils; //导入依赖的package包/类
private static void fixUpTable() {
    if (patched) return;
    String[] patchup = {
            "CREATE TABLE Treatments (_id INTEGER PRIMARY KEY AUTOINCREMENT);",
            "ALTER TABLE Treatments ADD COLUMN timestamp INTEGER;",
            "ALTER TABLE Treatments ADD COLUMN systimestamp INTEGER;",
            "ALTER TABLE Treatments ADD COLUMN uuid TEXT;",
            "ALTER TABLE Treatments ADD COLUMN eventType TEXT;",
            "ALTER TABLE Treatments ADD COLUMN enteredBy TEXT;",
            "ALTER TABLE Treatments ADD COLUMN notes TEXT;",
            "ALTER TABLE Treatments ADD COLUMN created_at TEXT;",
            "ALTER TABLE Treatments ADD COLUMN insulin REAL;",
            "ALTER TABLE Treatments ADD COLUMN carbs REAL;",
            "CREATE INDEX index_Treatments_timestamp on Treatments(timestamp);",
            "CREATE INDEX index_Treatments_systimestamp on Treatments(systimestamp);",
            "CREATE UNIQUE INDEX index_Treatments_uuid on Treatments(uuid);"};

    for (String patch : patchup) {
        try {
            SQLiteUtils.execSql(patch);
            //Log.e(TAG, "Processed patch should not have succeeded!!: " + patch);
        } catch (Exception e) {
            // Log.d(TAG, "Patch: " + patch + " generated exception as it should: " + e.toString());
        }
    }
    patched = true;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:28,代码来源:Treatments.java


示例12: fixUpTable

import com.activeandroid.util.SQLiteUtils; //导入依赖的package包/类
protected synchronized static void fixUpTable(String[] schema) {
    if (patched) return;

    for (String patch : schema) {
        try {
            SQLiteUtils.execSql(patch);
        } catch (Exception e) {
            //
        }
    }
    patched = true;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:13,代码来源:PlusModel.java


示例13: updateDB

import com.activeandroid.util.SQLiteUtils; //导入依赖的package包/类
public static void updateDB(){
    String[] updates = new String[]{"ALTER TABLE BgReadings ADD COLUMN dg_mgdl REAL;", "ALTER TABLE BgReadings ADD COLUMN dg_slope REAL;", "ALTER TABLE BgReadings ADD COLUMN dg_delta_name TEXT;"};
    for (String patch:updates) {
        try {
            SQLiteUtils.execSql(patch);
        } catch (Exception e){
        }
    }

}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:11,代码来源:BgReading.java


示例14: deleteALL

import com.activeandroid.util.SQLiteUtils; //导入依赖的package包/类
public static void deleteALL() {
    try {
        SQLiteUtils.execSql("delete from BgSendQueue");
        SQLiteUtils.execSql("delete from BgReadings");
        Log.d(TAG, "Deleting all BGReadings");
    } catch (Exception e) {
        Log.e(TAG, "Got exception running deleteALL " + e.toString());
    }
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:10,代码来源:BgReading.java


示例15: cleanup

import com.activeandroid.util.SQLiteUtils; //导入依赖的package包/类
public static void cleanup(long timestamp) {
    try {
    SQLiteUtils.execSql("delete from BgSendQueue");
    List<BgReading> data = new Select()
            .from(BgReading.class)
            .where("timestamp < ?", timestamp)
            .orderBy("timestamp desc")
            .execute();
    if (data != null) Log.d(TAG, "cleanup BgReading size=" + data.size());
    new Cleanup().execute(data);
    } catch (Exception e) {
        Log.e(TAG, "Got exception running cleanup " + e.toString());
    }
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:15,代码来源:BgReading.java


示例16: fixUpTable

import com.activeandroid.util.SQLiteUtils; //导入依赖的package包/类
protected synchronized static void fixUpTable(String[] schema) {
    if (patched) return;
    for (String patch : schema) {
        try {
            SQLiteUtils.execSql(patch);
        } catch (Exception e) {
            //
        }
    }
    patched = true;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:12,代码来源:Reminder.java


示例17: fixUpTable

import com.activeandroid.util.SQLiteUtils; //导入依赖的package包/类
protected synchronized static boolean fixUpTable(String[] schema, boolean patched) {
    if (patched) return true;

    for (String patch : schema) {
        try {
            SQLiteUtils.execSql(patch);
        } catch (Exception e) {
            //
        }
    }
    return true;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:13,代码来源:PlusModel.java


示例18: fixUpTable

import com.activeandroid.util.SQLiteUtils; //导入依赖的package包/类
private static void fixUpTable() {
    if (patched) return;

    for (String patch : schema) {
        try {
            SQLiteUtils.execSql(patch);
        } catch (Exception e) {
            if (d)
                UserError.Log.d(TAG, "Patch: " + patch + " generated exception as it should: " + e.toString());
        }
    }
    patched = true;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:14,代码来源:UploaderQueue.java



注:本文中的com.activeandroid.util.SQLiteUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ConnectionStyle类代码示例发布时间:2022-05-22
下一篇:
Java IContext类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap