src/org/ohmage/query/impl/ObserverQueries.java
@Override
					public Object mapRow(
							final ResultSet rs, 
							final int rowNum)
							throws SQLException {
						
						// Get the observer's ID.
						String observerId = rs.getString("observer_id");
						
						// Get the streams from the result.
						Collection<Observer.Stream> streams =
							result.get(observerId);
						
						// If no collection exists for that observer ID yet,
						// create a new collection and add it.
						if(streams == null) {
							streams = new LinkedList<Observer.Stream>();
							result.put(observerId, streams);
						}
						
						// Because the with_* values are optional and
						// may be null, they must be retrieve in this
						// special way.
						Boolean withId, withTimestamp, withLocation;
						withId = rs.getBoolean("with_id");
						if(rs.wasNull()) {
							withId = null;
						}
						withTimestamp =
							rs.getBoolean("with_timestamp");
						if(rs.wasNull()) {
							withTimestamp = null;
						}
						withLocation = rs.getBoolean("with_location");
						if(rs.wasNull()) {
							withLocation = null;
						}
						
						// Add the stream to its respective result list.
						try {
							streams
								.add(
									new Observer.Stream(
										rs.getString("stream_id"), 
										rs.getLong("version"), 
										rs.getString("name"), 
										rs.getString("description"), 
										withId,
										withTimestamp, 
										withLocation, 
										rs.getString("stream_schema")));
						}
						catch(DomainException e) {
							throw new SQLException(e);
						}
						
						// Return nothing as it will never be used.
						return null;
					}
/**
					 * Maps the row of data to a new stream.
					 */
Maps the row of data to a new stream.
Maps the row of data to a new stream .
@Override
					public Object mapRow(
							final ResultSet rs, 
							final int rowNum)
							throws SQLException {
						String observerId = rs.getString("observer_id");
						Collection<Observer.Stream> streams =
							result.get(observerId);
						if(streams == null) {
							streams = new LinkedList<Observer.Stream>();
							result.put(observerId, streams);
						}
						Boolean withId, withTimestamp, withLocation;
						withId = rs.getBoolean("with_id");
						if(rs.wasNull()) {
							withId = null;
						}
						withTimestamp =
							rs.getBoolean("with_timestamp");
						if(rs.wasNull()) {
							withTimestamp = null;
						}
						withLocation = rs.getBoolean("with_location");
						if(rs.wasNull()) {
							withLocation = null;
						}
						try {
							streams
								.add(
									new Observer.Stream(
										rs.getString("stream_id"), 
										rs.getLong("version"), 
										rs.getString("name"), 
										rs.getString("description"), 
										withId,
										withTimestamp, 
										withLocation, 
										rs.getString("stream_schema")));
						}
						catch(DomainException e) {
							throw new SQLException(e);
						}
						return null;
					}
@ Override public Object mapRow ( final ResultSet rs , final int rowNum ) throws SQLException { String observerId = rs . getString ( "observer_id" ) ; Collection < Observer . Stream > streams = result . get ( observerId ) ; if ( streams == null ) { streams = new LinkedList < Observer . Stream > ( ) ; result . put ( observerId , streams ) ; } Boolean withId , withTimestamp , withLocation ; withId = rs . getBoolean ( "with_id" ) ; if ( rs . wasNull ( ) ) { withId = null ; } withTimestamp = rs . getBoolean ( "with_timestamp" ) ; if ( rs . wasNull ( ) ) { withTimestamp = null ; } withLocation = rs . getBoolean ( "with_location" ) ; if ( rs . wasNull ( ) ) { withLocation = null ; } try { streams . add ( new Observer . Stream ( rs . getString ( "stream_id" ) , rs . getLong ( "version" ) , rs . getString ( "name" ) , rs . getString ( "description" ) , withId , withTimestamp , withLocation , rs . getString ( "stream_schema" ) ) ) ; } catch ( DomainException e ) { throw new SQLException ( e ) ; } return null ; }
Maps the row of data to a new stream.
Maps the row of data to a new stream .
// Get the observer's ID. // Get the streams from the result. // If no collection exists for that observer ID yet, // create a new collection and add it. // Because the with_* values are optional and // may be null, they must be retrieve in this // special way. // Add the stream to its respective result list. // Return nothing as it will never be used.