Пример #1
0
 /**
  * Set the range of cells occupied by a Widget.
  *
  * @param index the index of the Widget for which to set the cells
  * @param cells a Rectangle specifying the range of rows and columns to be occupied by the Widget
  */
 public void setChildCells(int index, Rectangle cells) {
   ChildInfo info = child.get(index);
   info.x = cells.x;
   info.y = cells.y;
   info.width = cells.width;
   info.height = cells.height;
   invalidateSize();
 }
  public static ArrayList<ChildInfo> getCommonNumberChildren(String idx, SQLiteDatabase database) {
    Cursor cursor = database.rawQuery("select number,name from table" + idx, null);

    ArrayList<ChildInfo> list = new ArrayList<CommonNumberDao.ChildInfo>();
    while (cursor.moveToNext()) {
      ChildInfo info = new ChildInfo();
      String name = cursor.getString(1);
      String number = cursor.getString(0);
      info.name = name;
      info.number = number;

      list.add(info);
    }

    return list;
  }
Пример #3
0
 public void testOneToOnePropertyRefGeneratedIds() {
   try {
     Session s = openSession();
     s.beginTransaction();
     Child c2 = new Child("c2");
     ChildInfo info = new ChildInfo("blah blah blah");
     c2.setInfo(info);
     info.setOwner(c2);
     s.persist(c2);
     try {
       s.getTransaction().commit();
       fail("expecting TransientObjectException on flush");
     } catch (TransientObjectException e) {
       // expected result
       log.trace("handled expected exception : " + e);
       s.getTransaction().rollback();
     } finally {
       s.close();
     }
   } finally {
     cleanupData();
   }
 }