Opened 11 years ago

Closed 10 years ago

#500 closed defect (fixed)

Use String constants for Multipoint PostGIS requests

Reported by: Piero Campalani Owned by: Piero Campalani
Priority: minor Milestone: Future
Component: petascope Version: 8.5
Keywords: multipoint string constants Cc: Alireza
Complexity: Easy

Description

SQL queries to resolve data/metadata on Multipoint coverages need to use String constants for referencing database tables and attributes.
They are used mainly in petascope.core.DbMetadataSource and petascope.wcps.server.core.XmlQuery classes.

Additionally, WCPS constants should *not* be used there. The SQL commands like SELECT, INSERT etc, are standard and can be written without setting up a constant.

Example, taking petascope.core.DbMetadatasource.java:

...

+++ public static final String TABLE_MULTIPOINT      = TABLES_PREFIX + "multipoint";
+++ public static final String MULTIPOINT_ID         = "id";
+++ public static final String MULTIPOINT_COORDINATE = "name";
...

--- String genQuery = WcpsConstants.MSG_SELECT + " St_X(coordinate) AS x, "
+++ String genQuery = " SELECT St_X(" + MULTIPOINT_COORDINATE + ") AS x, "

Change History (1)

comment:1 by Piero Campalani, 10 years ago

Resolution: fixed
Status: newclosed

Fixed in changeset:e58719d.

Note: See TracTickets for help on using tickets.