Skip to content

Add postgress nested with clause #361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
import net.sf.jsqlparser.expression.operators.relational.MinorThan;
import net.sf.jsqlparser.expression.operators.relational.MinorThanEquals;
import net.sf.jsqlparser.expression.operators.relational.NotEqualsTo;
import net.sf.jsqlparser.expression.operators.relational.DoubleAnd;//Added by mathew on 21st Nov 2016
import net.sf.jsqlparser.expression.operators.relational.Contains;//Added by mathew on 21st Nov 2016
import net.sf.jsqlparser.expression.operators.relational.ContainedBy;//Added by mathew on 21st Nov 2016
import net.sf.jsqlparser.expression.operators.relational.RegExpMatchOperator;
import net.sf.jsqlparser.expression.operators.relational.RegExpMySQLOperator;
import net.sf.jsqlparser.expression.operators.relational.JsonOperator;
Expand Down Expand Up @@ -109,6 +112,12 @@ public interface ExpressionVisitor {
void visit(MinorThanEquals minorThanEquals);

void visit(NotEqualsTo notEqualsTo);

void visit(DoubleAnd doubleAnd);//Added by mathew on 21st Nov 2016

void visit(Contains contains);//Added by mathew on 21st Nov 2016

void visit(ContainedBy containedBy);//Added by mathew on 21st Nov 2016

void visit(Column tableColumn);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,25 @@ public void visit(MinorThanEquals expr) {
public void visit(NotEqualsTo expr) {
visitBinaryExpression(expr);
}

/*Added by mathew on 21st Nov 2016*/
@Override
public void visit(DoubleAnd expr) {
visitBinaryExpression(expr);
}

/*Added by mathew on 21st Nov 2016*/
@Override
public void visit(Contains expr) {
visitBinaryExpression(expr);
}

/*Added by mathew on 21st Nov 2016*/
@Override
public void visit(ContainedBy expr) {
visitBinaryExpression(expr);
}


@Override
public void visit(Column column) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* #%L
* JSQLParser library
* %%
* Copyright (C) 2004 - 2013 JSQLParser
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-2.1.html>.
* #L%
*/
/*Added by Mathew on 21st Nov 2016*/
package net.sf.jsqlparser.expression.operators.relational;

import net.sf.jsqlparser.expression.ExpressionVisitor;

public class ContainedBy extends ComparisonOperator {

public ContainedBy() {
super("<&");
}

public ContainedBy(String operator) {
super(operator);
}

@Override
public void accept(ExpressionVisitor expressionVisitor) {
expressionVisitor.visit(this);
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* #%L
* JSQLParser library
* %%
* Copyright (C) 2004 - 2013 JSQLParser
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-2.1.html>.
* #L%
*/
/*Added by Mathew on 21st Nov 2016*/
package net.sf.jsqlparser.expression.operators.relational;

import net.sf.jsqlparser.expression.ExpressionVisitor;

public class Contains extends ComparisonOperator {

public Contains() {
super("&>");
}

public Contains(String operator) {
super(operator);
}

@Override
public void accept(ExpressionVisitor expressionVisitor) {
expressionVisitor.visit(this);
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* #%L
* JSQLParser library
* %%
* Copyright (C) 2004 - 2013 JSQLParser
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-2.1.html>.
* #L%
*/
/*Added by Mathew on 1st Aug 2016*/
package net.sf.jsqlparser.expression.operators.relational;

import net.sf.jsqlparser.expression.ExpressionVisitor;

public class DoubleAnd extends ComparisonOperator {

public DoubleAnd() {
super("&&");
}

public DoubleAnd(String operator) {
super(operator);
}

@Override
public void accept(ExpressionVisitor expressionVisitor) {
expressionVisitor.visit(this);
}
}
24 changes: 24 additions & 0 deletions src/main/java/net/sf/jsqlparser/util/TablesNamesFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,30 @@ public void visit(Multiplication multiplication) {
public void visit(NotEqualsTo notEqualsTo) {
visitBinaryExpression(notEqualsTo);
}

/* Added by Mathew on 21st Nov 2016
*
*/
@Override
public void visit(DoubleAnd doubleAnd) {
visitBinaryExpression(doubleAnd);
}

/* Added by Mathew on 21st Nov 2016
*
*/
@Override
public void visit(Contains contains) {
visitBinaryExpression(contains);
}

/* Added by Mathew on 21st Nov 2016
*
*/
@Override
public void visit(ContainedBy containedBy) {
visitBinaryExpression(containedBy);
}

@Override
public void visit(NullValue nullValue) {
Expand Down
Loading