1 21 package com.db4o.test; 22 23 import com.db4o.*; 24 25 public class SortResult { 26 private final static int[] ORIG={2,4,1,3}; 27 28 public int id; 29 30 public SortResult() { 31 this(0); 32 } 33 34 public SortResult(int id) { 35 this.id = id; 36 } 37 38 public int id() { 39 return id; 40 } 41 42 public String toString() { 43 return "<"+id+">"; 44 } 45 46 public void configure(){ 47 Db4o.configure().optimizeNativeQueries(false); 48 } 49 50 public void store() { 51 for (int idx = 0; idx < ORIG.length; idx++) { 52 SortResult sortResult = new SortResult(ORIG[idx]); 53 Test.store(sortResult); 54 } 56 } 57 58 public void test() { 59 ObjectSet result=Test.objectContainer().get(SortResult.class); 60 68 79 } 80 } 81 | Popular Tags |