You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@baremaps.apache.org by GitBox <gi...@apache.org> on 2022/11/30 14:49:08 UTC

[GitHub] [incubator-baremaps] bchapuis commented on a diff in pull request #543: Order IP to location by size of IP range

bchapuis commented on code in PR #543:
URL: https://github.com/apache/incubator-baremaps/pull/543#discussion_r1036065366


##########
baremaps-core/src/main/java/org/apache/baremaps/iploc/database/InetnumLocationDaoSqliteImpl.java:
##########
@@ -38,13 +38,12 @@ public final class InetnumLocationDaoSqliteImpl implements InetnumLocationDao {
   private static final String INSERT_SQL =
       "INSERT INTO inetnum_locations(address, ip_start, ip_end, latitude, longitude, network, country) VALUES(?,?,?,?,?,?,?)";
 
-  private static final String SELECT_ALL_SQL =
-      "SELECT " + "id, \n" + "address, \n" + "ip_start, \n" + "ip_end, \n" + "latitude, \n"
-          + "longitude, \n" + "network, \n" + "country \n" + " FROM inetnum_locations;";
+  private static final String SELECT_ALL_SQL = "SELECT id, address, ip_start, ip_end, latitude, "

Review Comment:
   You can use the new multi-line string syntax for this kind of queries.
   
   ```java
   String SELECT_ALL_SQL = """
       SELECT id, address, ip_start, ip_end, latitude,
       FROM inetnum_locations 
       WHERE ip_start <= ? AND ip_end >= ?;"""
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org