| 1 21 package com.db4o.test; 22 23 import com.db4o.ext.*; 24 25 26 public class StorePrimitiveDirectly { 27 28 public void test(){ 29 30 ExtObjectContainer oc = Test.objectContainer(); 31 32 boolean exceptionOccurred = false; 33 34 oc.configure().exceptionsOnNotStorable(false); 35 36 try{ 37 oc.set(new Integer (1)); 38 }catch(ObjectNotStorableException onse){ 39 40 42 exceptionOccurred = true; 43 44 } 45 46 48 50 51 oc.configure().exceptionsOnNotStorable(true); 52 53 exceptionOccurred = false; 54 55 try{ 56 oc.set(new Integer (1)); 57 }catch(ObjectNotStorableException onse){ 58 exceptionOccurred = true; 59 } 60 61 62 64 66 oc.configure().exceptionsOnNotStorable(false); 67 } 68 69 } 70 | Popular Tags |