org.greenrobot.greendao.database.Database.execSQL()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(239)

本文整理了Java中org.greenrobot.greendao.database.Database.execSQL()方法的一些代码示例,展示了Database.execSQL()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Database.execSQL()方法的具体详情如下:
包路径:org.greenrobot.greendao.database.Database
类名称:Database
方法名:execSQL

Database.execSQL介绍

暂无

代码示例

代码示例来源:origin: greenrobot/greenDAO

  1. /** Drops the underlying database table. */
  2. public static void dropTable(Database db, boolean ifExists) {
  3. String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"ORDER TRANSACTION GROUP BY\"";
  4. db.execSQL(sql);
  5. }

代码示例来源:origin: greenrobot/greenDAO

  1. /** Creates the underlying database table. */
  2. public static void createTable(Database db, boolean ifNotExists) {
  3. String constraint = ifNotExists? "IF NOT EXISTS ": "";
  4. db.execSQL("CREATE TABLE " + constraint + "\"TREE_ENTITY\" (" + //
  5. "\"_id\" INTEGER PRIMARY KEY ," + // 0: id
  6. "\"PARENT_ID\" INTEGER);"); // 1: parentId
  7. }

代码示例来源:origin: greenrobot/greenDAO

  1. /** Drops the underlying database table. */
  2. public static void dropTable(Database db, boolean ifExists) {
  3. String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"AUTOINCREMENT_ENTITY\"";
  4. db.execSQL(sql);
  5. }

代码示例来源:origin: greenrobot/greenDAO

  1. /** Drops the underlying database table. */
  2. public static void dropTable(Database db, boolean ifExists) {
  3. String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"ABCDEF_ENTITY\"";
  4. db.execSQL(sql);
  5. }

代码示例来源:origin: greenrobot/greenDAO

  1. /** Drops the underlying database table. */
  2. public static void dropTable(Database db, boolean ifExists) {
  3. String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"EXTENDS_IMPLEMENTS_ENTITY\"";
  4. db.execSQL(sql);
  5. }

代码示例来源:origin: greenrobot/greenDAO

  1. /** Drops the underlying database table. */
  2. public static void dropTable(Database db, boolean ifExists) {
  3. String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"KEEP_ENTITY\"";
  4. db.execSQL(sql);
  5. }

代码示例来源:origin: greenrobot/greenDAO

  1. /** Drops the underlying database table. */
  2. public static void dropTable(Database db, boolean ifExists) {
  3. String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TO_ONE_TARGET2\"";
  4. db.execSQL(sql);
  5. }

代码示例来源:origin: greenrobot/greenDAO

  1. /** Drops the underlying database table. */
  2. public static void dropTable(Database db, boolean ifExists) {
  3. String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"JOIN_MANY_TO_DATE_ENTITY\"";
  4. db.execSQL(sql);
  5. }

代码示例来源:origin: greenrobot/greenDAO

  1. /** Creates the underlying database table. */
  2. public static void createTable(Database db, boolean ifNotExists) {
  3. String constraint = ifNotExists? "IF NOT EXISTS ": "";
  4. db.execSQL("CREATE TABLE " + constraint + "\"TO_MANY_TARGET2\" (" + //
  5. "\"_id\" INTEGER PRIMARY KEY ," + // 0: id
  6. "\"FK_ID\" INTEGER);"); // 1: fkId
  7. }

代码示例来源:origin: greenrobot/greenDAO

  1. /** Drops the underlying database table. */
  2. public static void dropTable(Database db, boolean ifExists) {
  3. String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"INDEXED_STRING_ENTITY\"";
  4. db.execSQL(sql);
  5. }

代码示例来源:origin: greenrobot/greenDAO

  1. /** Creates the underlying database table. */
  2. public static void createTable(Database db, boolean ifNotExists) {
  3. String constraint = ifNotExists? "IF NOT EXISTS ": "";
  4. db.execSQL("CREATE TABLE " + constraint + "\"RELATION_SOURCE2\" (" + //
  5. "\"_id\" INTEGER PRIMARY KEY ," + // 0: id
  6. "\"TO_ONE_ID\" INTEGER);"); // 1: toOneId
  7. }

代码示例来源:origin: greenrobot/greenDAO

  1. /** Drops the underlying database table. */
  2. public static void dropTable(Database db, boolean ifExists) {
  3. String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TREE_ENTITY\"";
  4. db.execSQL(sql);
  5. }

代码示例来源:origin: greenrobot/greenDAO

  1. /** Creates the underlying database table. */
  2. public static void createTable(Database db, boolean ifNotExists) {
  3. String constraint = ifNotExists? "IF NOT EXISTS ": "";
  4. db.execSQL("CREATE TABLE " + constraint + "\"AUTOINCREMENT_ENTITY\" (" + //
  5. "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT );"); // 0: id
  6. }

代码示例来源:origin: greenrobot/greenDAO

  1. /** Creates the underlying database table. */
  2. public static void createTable(Database db, boolean ifNotExists) {
  3. String constraint = ifNotExists? "IF NOT EXISTS ": "";
  4. db.execSQL("CREATE TABLE " + constraint + "\"TO_MANY_ENTITY\" (" + //
  5. "\"_id\" INTEGER PRIMARY KEY ," + // 0: id
  6. "\"SOURCE_JOIN_PROPERTY\" TEXT);"); // 1: sourceJoinProperty
  7. }

代码示例来源:origin: greenrobot/greenDAO

  1. /** Drops the underlying database table. */
  2. public static void dropTable(Database db, boolean ifExists) {
  3. String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TO_MANY_ENTITY\"";
  4. db.execSQL(sql);
  5. }

代码示例来源:origin: greenrobot/greenDAO

  1. /** Drops the underlying database table. */
  2. public static void dropTable(Database db, boolean ifExists) {
  3. String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TEST_ENTITY\"";
  4. db.execSQL(sql);
  5. }

代码示例来源:origin: greenrobot/greenDAO

  1. /** Drops the underlying database table. */
  2. public static void dropTable(Database db, boolean ifExists) {
  3. String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"SIMPLE_ENTITY_NOT_NULL\"";
  4. db.execSQL(sql);
  5. }

代码示例来源:origin: greenrobot/greenDAO

  1. /** Drops the underlying database table. */
  2. public static void dropTable(Database db, boolean ifExists) {
  3. String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"CUSTOM_TYPE_ENTITY\"";
  4. db.execSQL(sql);
  5. }

代码示例来源:origin: greenrobot/greenDAO

  1. public static int executeSqlStatements(Database db, String[] statements) {
  2. int count = 0;
  3. for (String line : statements) {
  4. line = line.trim();
  5. if (line.length() > 0) {
  6. db.execSQL(line);
  7. count++;
  8. }
  9. }
  10. return count;
  11. }

代码示例来源:origin: greenrobot/greenDAO

  1. public void deleteAll() {
  2. // String sql = SqlUtils.createSqlDelete(config.tablename, null);
  3. // db.execSQL(sql);
  4. db.execSQL("DELETE FROM '" + config.tablename + "'");
  5. if (identityScope != null) {
  6. identityScope.clear();
  7. }
  8. }

相关文章