1 21 22 package org.opensubsystems.patterns.listdata.persist.db; 23 24 import java.util.List ; 25 26 import org.opensubsystems.core.error.OSSException; 27 import org.opensubsystems.core.persist.db.DatabaseImpl; 28 import org.opensubsystems.patterns.listdata.data.ListOptions; 29 30 39 public class PostgreSQLListDatabaseUtils extends ListDatabaseUtils 40 { 41 43 46 public PostgreSQLListDatabaseUtils() 47 { 48 super(); 49 } 50 51 53 56 public List getObjectList( 57 ListOptions options, 58 String query, 59 ListDatabaseFactory factory, 60 ListDatabaseSchema schema 61 ) throws OSSException 62 { 63 return super.getObjectList(options, query, factory, schema); 64 65 80 257 } 258 259 262 protected String preprocessSelectQuery( 263 String inputQuery, 264 ListOptions options, 265 ListDatabaseSchema schema 266 ) throws OSSException 267 { 268 if (DatabaseImpl.getInstance().hasSelectListRangeSupport()) 270 { 271 StringBuffer buffer = new StringBuffer (); 274 275 buffer.append(inputQuery); 276 buffer.append(" limit "); 277 buffer.append(options.getPageSize()); 278 buffer.append(" offset "); 279 buffer.append(options.getBeginPosition() - 1); 280 281 return buffer.toString(); 282 } 283 else 284 { 285 return super.preprocessSelectQuery(inputQuery, options, schema); 287 } 288 } 289 } 290 | Popular Tags |