Loading src/adql/query/ADQLQuery.java +7 −2 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ import adql.search.ISearchHandler; * <p>The resulting object of the {@link ADQLParser} is an object of this class.</p> * * @author Grégory Mantelet (CDS;ARI) * @version 1.2 (11/2013) * @version 1.2 (09/2014) */ public class ADQLQuery implements ADQLObject { Loading Loading @@ -262,6 +262,11 @@ public class ADQLQuery implements ADQLObject { ADQLOperand operand = item.getOperand(); if (item instanceof SelectAllColumns){ try{ // If "{table}.*", add all columns of the specified table: if (((SelectAllColumns)item).getAdqlTable() != null) columns.addAll(((SelectAllColumns)item).getAdqlTable().getDBColumns()); // Otherwise ("*"), add all columns of all selected tables: else columns.addAll(from.getDBColumns()); }catch(ParseException pe){ // Here, this error should not occur any more, since it must have been caught by the DBChecker! Loading src/adql/query/SelectAllColumns.java +9 −4 Original line number Diff line number Diff line Loading @@ -20,15 +20,16 @@ import adql.query.from.ADQLTable; * You should have received a copy of the GNU Lesser General Public License * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2012 - UDS/Centre de Données astronomiques de Strasbourg (CDS) * Copyright 2012,2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS), * Astronomisches Rechen Institut (ARI) */ /** * In ADQL it corresponds to the '*' and '{tableName}.*' items in the SELECT clause. * It means: 'select all columns'. * * @author Grégory Mantelet (CDS) * @version 01/2012 * @author Grégory Mantelet (CDS;ARI) * @version 1.2 (09/2014) */ public final class SelectAllColumns extends SelectItem { Loading Loading @@ -106,7 +107,7 @@ public final class SelectAllColumns extends SelectItem { * @param table An {@link ADQLTable} (MUST NOT BE NULL). */ public final void setAdqlTable(final ADQLTable table){ if (table == null){ if (table != null){ adqlTable = table; query = null; } Loading @@ -128,6 +129,7 @@ public final class SelectAllColumns extends SelectItem { private boolean tableGot = (adqlTable == null); @Override public ADQLObject next() throws NoSuchElementException{ if (tableGot) throw new NoSuchElementException(); Loading @@ -135,10 +137,12 @@ public final class SelectAllColumns extends SelectItem { return adqlTable; } @Override public boolean hasNext(){ return !tableGot; } @Override public void replace(ADQLObject replacer) throws UnsupportedOperationException, IllegalStateException{ if (replacer == null) remove(); Loading @@ -150,6 +154,7 @@ public final class SelectAllColumns extends SelectItem { adqlTable = (ADQLTable)replacer; } @Override public void remove(){ if (!tableGot) throw new IllegalStateException("remove() impossible: next() has not yet been called !"); Loading Loading
src/adql/query/ADQLQuery.java +7 −2 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ import adql.search.ISearchHandler; * <p>The resulting object of the {@link ADQLParser} is an object of this class.</p> * * @author Grégory Mantelet (CDS;ARI) * @version 1.2 (11/2013) * @version 1.2 (09/2014) */ public class ADQLQuery implements ADQLObject { Loading Loading @@ -262,6 +262,11 @@ public class ADQLQuery implements ADQLObject { ADQLOperand operand = item.getOperand(); if (item instanceof SelectAllColumns){ try{ // If "{table}.*", add all columns of the specified table: if (((SelectAllColumns)item).getAdqlTable() != null) columns.addAll(((SelectAllColumns)item).getAdqlTable().getDBColumns()); // Otherwise ("*"), add all columns of all selected tables: else columns.addAll(from.getDBColumns()); }catch(ParseException pe){ // Here, this error should not occur any more, since it must have been caught by the DBChecker! Loading
src/adql/query/SelectAllColumns.java +9 −4 Original line number Diff line number Diff line Loading @@ -20,15 +20,16 @@ import adql.query.from.ADQLTable; * You should have received a copy of the GNU Lesser General Public License * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2012 - UDS/Centre de Données astronomiques de Strasbourg (CDS) * Copyright 2012,2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS), * Astronomisches Rechen Institut (ARI) */ /** * In ADQL it corresponds to the '*' and '{tableName}.*' items in the SELECT clause. * It means: 'select all columns'. * * @author Grégory Mantelet (CDS) * @version 01/2012 * @author Grégory Mantelet (CDS;ARI) * @version 1.2 (09/2014) */ public final class SelectAllColumns extends SelectItem { Loading Loading @@ -106,7 +107,7 @@ public final class SelectAllColumns extends SelectItem { * @param table An {@link ADQLTable} (MUST NOT BE NULL). */ public final void setAdqlTable(final ADQLTable table){ if (table == null){ if (table != null){ adqlTable = table; query = null; } Loading @@ -128,6 +129,7 @@ public final class SelectAllColumns extends SelectItem { private boolean tableGot = (adqlTable == null); @Override public ADQLObject next() throws NoSuchElementException{ if (tableGot) throw new NoSuchElementException(); Loading @@ -135,10 +137,12 @@ public final class SelectAllColumns extends SelectItem { return adqlTable; } @Override public boolean hasNext(){ return !tableGot; } @Override public void replace(ADQLObject replacer) throws UnsupportedOperationException, IllegalStateException{ if (replacer == null) remove(); Loading @@ -150,6 +154,7 @@ public final class SelectAllColumns extends SelectItem { adqlTable = (ADQLTable)replacer; } @Override public void remove(){ if (!tableGot) throw new IllegalStateException("remove() impossible: next() has not yet been called !"); Loading