コード例 #1
0
  public void test() {

    Test.store(new Parent1(new Child1()));

    ObjectContainer container = Test.reOpen();
    container
        .ext()
        .configure()
        .addAlias(new TypeAlias("com.db4o.test.aliases.Parent1", "com.db4o.test.aliases.Parent2"));
    container
        .ext()
        .configure()
        .addAlias(new TypeAlias("com.db4o.test.aliases.Child1", "com.db4o.test.aliases.Child2"));

    ObjectSet os = container.query(Parent2.class);

    Test.ensure(os.size() > 0);

    Parent2 p2 = (Parent2) os.next();

    Test.ensure(p2.child != null);
  }
コード例 #2
0
ファイル: RStack.java プロジェクト: amoyano/Biblioadmin
 public void specific(ObjectContainer con, int step) {
   super.specific(con, step);
   TEntry entry = new TEntry().lastElement();
   Stack stack = new Stack();
   if (step > 0) {
     stack.addElement(entry.key);
     ObjectSet set = con.queryByExample(stack);
     if (set.size() != step) {
       Regression.addError("Stack member query not found");
     } else {
       Stack res = (Stack) set.next();
       if (!(stack.pop().equals(new TEntry().lastElement().key))) {
         Regression.addError("Stack order changed.");
       }
     }
   }
 }