1 package org.apache.ojb.broker.accesslayer; 2 3 17 18 import org.apache.ojb.broker.Identity; 19 import org.apache.ojb.broker.PersistenceBrokerException; 20 import org.apache.ojb.broker.core.PersistenceBrokerImpl; 21 22 28 public class SqlBasedRsIterator extends RsIterator 29 { 30 33 public SqlBasedRsIterator(RsQueryObject queryObject, PersistenceBrokerImpl broker) 34 throws PersistenceBrokerException 35 { 36 super(queryObject, broker); 37 if(!queryObject.isSQLBased()) 38 { 39 throw new PersistenceBrokerException("Given query is not a QueryBySQL object"); 40 } 41 } 42 43 47 protected Object getObjectFromResultSet() throws PersistenceBrokerException 48 { 49 50 try 51 { 52 return super.getObjectFromResultSet(); 55 } 56 catch (PersistenceBrokerException e) 60 { 61 Identity oid = getIdentityFromResultSet(); 62 return getBroker().getObjectByIdentity(oid); 63 } 64 65 } 66 } 67 | Popular Tags |