Example #1
0
 /**
  * 根据ids 删除相应的行
  *
  * @param ids 如超过一条,别忘了中间以,隔开
  * @return 受影响的行数
  */
 public int Delete(String ids) {
   Pattern p = Pattern.compile("^[\\w,-]+$"); // 检查数据合法性
   Matcher m = p.matcher(ids);
   if (m.find() == false) {
     throw new IllegalArgumentException();
   }
   ids = ModelHelper.AddSingleMark(ids); // 加上单引号
   int count = db.delete(SchemeCreator.BTNAME, String.format("bookId in (%s)", ids), null);
   return count;
 }
Example #2
0
 /**
  * 取得一个Activity实体
  *
  * @param c
  * @return MdlActivity
  */
 public static Book GetInfo(Cursor c) {
   Book model = new Book();
   ModelHelper.Parse(c, model);
   return model;
 }