Web server info - List items = new ArrayList( ); Iterator iter
Wednesday, October 3rd, 2007List items = new ArrayList( ); Iterator iter = results.iterator( ); while (iter.hasNext( )){ ItemBO itemBO = (ItemBO)iter.next( ); ItemSummaryView newView = new ItemSummaryView( ); newView.setId( itemBO.getId().toString( ) ); newView.setName( itemBO.getDisplayLabel( ) ); newView.setUnitPrice( itemBO.getBasePrice( ) ); newView.setSmallImageURL( itemBO.getSmallImageURL( ) ); newView.setProductFeature( itemBO.getFeature1( ) ); items.add( newView ); } return items; } public ItemDetailView getItemDetailView( String itemId ) throws DatastoreException { List results = null; try{ OQLQuery query = odmg.newOQLQuery( ); // Set the OQL select statementString queryStr = “select item from ” + ItemBO.class.getName( ); queryStr += ” where id = $1″; query.create(queryStr); query.bind(itemId); // Execute the query results = (List)query.execute( ); }catch( Exception ex ){ ex.printStackTrace( ); throw DatastoreException.datastoreError(ex); } // if (results.isEmpty( ) ){ throw DatastoreException.objectNotFound( ); } ItemBO itemBO = (ItemBO)results.get(0); // Build a ValueObject for the Item ItemDetailView view = new ItemDetailView( ); view.setId( itemBO.getId().toString( ) ); view.setDescription( itemBO.getDescription( ) ); view.setLargeImageURL( itemBO.getLargeImageURL( ) ); view.setName( itemBO.getDisplayLabel( ) ); view.setProductFeature( itemBO.getFeature1( ) );
If you are looking for affordable and reliable webhost to host and run your business application visit our ftp web hosting services.