Commit bd4de0ad authored by Matija Obreza's avatar Matija Obreza
Browse files

Fixed table alias in listAccessionsGeo query

parent 9562e146
......@@ -256,8 +256,8 @@ public class GenesysLowlevelRepositoryImpl implements GenesysLowlevelRepository
@Override
public void listAccessionsGeo(final ObjectNode filter, RowCallbackHandler rowCallbackHandler) {
final DirectMysqlQuery directQuery = new DirectMysqlQuery("accessiongeo", "g");
directQuery.innerJoin("accession", "a", "a.id=g.accessionId");
final DirectMysqlQuery directQuery = new DirectMysqlQuery("accessiongeo", "geo");
directQuery.innerJoin("accession", "a", "a.id=geo.accessionId");
directQuery.jsonFilter(filter, new MethodResolver() {
@Override
public Method getMethod(long methodId) {
......@@ -269,7 +269,7 @@ public class GenesysLowlevelRepositoryImpl implements GenesysLowlevelRepository
@Override
public PreparedStatement createPreparedStatement(Connection con) throws SQLException {
PreparedStatement stmt = con.prepareStatement(directQuery
.getQuery("a.id, g.latitude, g.longitude, g.elevation, g.datum, g.uncertainty, g.method, g.version"));
.getQuery("a.id, geo.latitude, geo.longitude, geo.elevation, geo.datum, geo.uncertainty, geo.method, geo.version"));
ArgumentPreparedStatementSetter apss = new ArgumentPreparedStatementSetter(directQuery.getParameters());
apss.setValues(stmt);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment