1 7 8 package org.enhydra.snapper.business; 9 10 import org.enhydra.snapper.spec.*; 12 import org.enhydra.snapper.data.*; 13 14 import com.lutris.appserver.server.sql.DBTransaction; 15 import com.lutris.appserver.server.sql.ObjectId; 16 17 20 public class SiteListImpl implements SiteList { 21 22 23 public Site[] getList(DBTransaction dbt) throws Exception { 24 SiteImpl[] sitesArray = null; 25 try { 26 SitesQuery query = new SitesQuery(dbt); 27 query.addOrderByNAME(); 31 SitesDO[] DOarray = query.getDOArray(); 32 sitesArray = new SiteImpl[ DOarray.length ]; 33 for ( int i = 0; i < DOarray.length; i++ ) 34 sitesArray[i] = new SiteImpl(DOarray[i], dbt); 35 }catch(Exception ex) { 36 throw new Exception ("Exception in getList()", ex); 37 } 38 39 return sitesArray; 40 } 41 42 public Site findSiteByID(String id, DBTransaction dbt) throws Exception 43 { 44 SiteImpl site = null; 45 try { 46 SitesQuery query = new SitesQuery(dbt); 47 query.setQueryOId(new ObjectId(id)); 49 query.requireUniqueInstance(); 51 SitesDO sitesDO = query.getNextDO(); 52 site = new SiteImpl(sitesDO, dbt); 53 return site; 54 }catch(Exception ex) { 55 throw new Exception ("Exception in findDiscsByID()", ex); 56 } 57 } 58 59 } 60 | Popular Tags |