Hi!
I declare a class-descriptor of A. Its proxy property is set dynamic. I try to
load it from DB by oql command. The return collection is DList(because the
OqlCollectionClass=org.apache.ojb.odmg.collections.DListImpl is set in
OJB.properties), but the elements in DList are proxy objects not A. How can I get A
from DList except that I must not set A proxy property dynamic?
A class descript:
<class-descriptor class="A" table="A" proxy="dynamic">
:
:
:
</class-descriptor>
oql command : "select o from A"
Using ODMG:
1 String pQueryString = "select o from A";
2 DList tResult = null;
3 try {
4 Transaction tx = this.odmg.currentTransaction();
5 OQLQuery tQuery = this.odmg.newOQLQuery();
6 tQuery.create(pQueryString);
7 tResult = (DList)tQuery.execute();
8 } catch (Exception e) {
9 e.printStackTrace();
10 throw new DBServerException(e.getMessage());
11 }
12 Iterator tIter = tResult.iterator();
13 while (tIter.hasNext()){
14 �� tA = (A)tIter.next();
:
:
}
I got a error message :"java.lang.ClassCastException: $Proxy119" on line 14.