if (!this.pm.isClosed()) this.pm.close();
}
public void _testOneVariableSubstitution()
{
Person p = new Person("George", "Harrison");
pm.currentTransaction().begin();
pm.makePersistent(p);
pm.currentTransaction().commit();
pm.evictAll();
pm.currentTransaction().begin();
Query q = pm.newQuery(Person.class);
q.declareVariables("java.lang.Integer pid");
q.declareImports("org.apache.ojb.otm.Person");
q.setFilter( "id == pid");
Collection results = (Collection) q.execute(new Integer(p.getId()));
assertNotNull(results);
assertEquals(1, results.size());
Person same = (Person) results.iterator().next();
assertEquals(p.getId(), same.getId());
pm.currentTransaction().commit();
}