1 package org.apache.ojb.broker.core; 2 3 17 18 import org.apache.ojb.broker.accesslayer.RsIterator; 19 import org.apache.ojb.broker.accesslayer.SqlBasedRsIterator; 20 import org.apache.ojb.broker.accesslayer.RsQueryObject; 21 import org.apache.ojb.broker.metadata.ClassDescriptor; 22 import org.apache.ojb.broker.query.Query; 23 import org.apache.ojb.broker.query.QueryBySQL; 24 25 31 class RsIteratorFactoryImpl implements RsIteratorFactory 32 { 33 private static RsIteratorFactory instance; 34 35 38 public RsIteratorFactoryImpl() 39 { 40 super(); 41 } 42 43 static RsIteratorFactory getInstance() 44 { 45 if (instance == null) 46 { 47 instance = new RsIteratorFactoryImpl(); 48 } 49 50 return instance; 51 } 52 53 56 public RsIterator createRsIterator(Query query, ClassDescriptor cld, PersistenceBrokerImpl broker) 57 { 58 return new RsIterator(RsQueryObject.get(cld, query), broker); 59 } 60 61 65 public RsIterator createRsIterator(QueryBySQL query, ClassDescriptor cld, PersistenceBrokerImpl broker) 66 { 67 return new SqlBasedRsIterator(RsQueryObject.get(cld, query), broker); 68 } 69 70 } 71 | Popular Tags |