hi,
I have a problem with a class, Document, that can have a Document as parent.


<class-descriptor class="ws.openlab.webwork.document.Document" table="document">
...
<field-descriptor id="1" name="id" column="id" jdbc-type="VARCHAR" length="50" primarykey="true"/>

<field-descriptor id="2" name="parentId" column="parentId" jdbc-type="VARCHAR" length="50"/>
<reference-descriptor name="parent" class-ref="ws.openlab.webwork.document.Document" auto-update="true" auto-retrieve="true">
<foreignkey field-id-ref="2"/>
</reference-descriptor>
...

As API I am using PersistenceBroker. The class is saved ok; but when I try to retrieve a collection of documents,
either by getCollectionByQuery or getIteratorByQuery, I get

" java.util.NoSuchElementException at org.apache.ojb.broker.accesslayer.RsIterator.next(RsIterator.java:219)
..
at org.apache.ojb.broker.metadata.PersistentFieldPropertyImpl.set(PersistentFieldPropertyImpl.java:100)
at org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.retrieveCollection(PersistenceBrokerImpl.java:943)
at org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.retrieveCollections(PersistenceBrokerImpl.java:969)
at org.apache.ojb.broker.accesslayer.RsIterator.getObjectFromResultSet(RsIterator.java:420)
at org.apache.ojb.broker.accesslayer.RsIterator.next(RsIterator.java:204)
.."

It seems that the collection is retrieved ok, but when each single object is fetched the exception above is thrown.
It may be because it finds parentId to be null, but I don't want to force each Document to have a parent.

I am using ojb 0.97 on jdk 1.4.1 .

thanks,

pietro




--
To unsubscribe, e-mail: <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>

Reply via email to