+ " FROM [Area]"
+ " WHERE AREA_CODE = ?");
stmt.setInt(1, Integer.parseInt(primaryKey));
final ResultSet result = stmt.executeQuery();
while (result.next()) {
ExtentImpl extent = null;
final String description = result.getString(1);
if (description != null) {
extent = new ExtentImpl();
extent.setDescription(new SimpleInternationalString(description));
}
final double ymin = result.getDouble(2);
if (!result.wasNull()) {
final double ymax = result.getDouble(3);
if (!result.wasNull()) {
final double xmin = result.getDouble(4);
if (!result.wasNull()) {
final double xmax = result.getDouble(5);
if (!result.wasNull()) {
if (extent == null) {
extent = new ExtentImpl();
}
extent.setGeographicElements(Collections.singleton(
new GeographicBoundingBoxImpl(xmin, xmax, ymin, ymax)));
}
}
}
}
if (extent != null) {
returnValue = (Extent) ensureSingleton(extent.unmodifiable(), returnValue, code);
}
}
result.close();
} catch (SQLException exception) {
throw databaseFailure(Extent.class, code, exception);