Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new parser: added support to traverse strategy and parallel, fixed so…
…me test cases (old unsupported stuff)
- Loading branch information
1 parent
7bc203a
commit 3fdfaed
Showing
14 changed files
with
3,103 additions
and
3,000 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 61 additions & 61 deletions
122
core/src/main/java/com/orientechnologies/orient/core/exception/OQueryParsingException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,77 @@ | ||
/* | ||
* | ||
* * Copyright 2014 Orient Technologies LTD (info(at)orientechnologies.com) | ||
* * | ||
* * Licensed under the Apache License, Version 2.0 (the "License"); | ||
* * you may not use this file except in compliance with the License. | ||
* * You may obtain a copy of the License at | ||
* * | ||
* * http://www.apache.org/licenses/LICENSE-2.0 | ||
* * | ||
* * Unless required by applicable law or agreed to in writing, software | ||
* * distributed under the License is distributed on an "AS IS" BASIS, | ||
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* * See the License for the specific language governing permissions and | ||
* * limitations under the License. | ||
* * | ||
* * For more information: http://www.orientechnologies.com | ||
* | ||
*/ | ||
* | ||
* * Copyright 2014 Orient Technologies LTD (info(at)orientechnologies.com) | ||
* * | ||
* * Licensed under the Apache License, Version 2.0 (the "License"); | ||
* * you may not use this file except in compliance with the License. | ||
* * You may obtain a copy of the License at | ||
* * | ||
* * http://www.apache.org/licenses/LICENSE-2.0 | ||
* * | ||
* * Unless required by applicable law or agreed to in writing, software | ||
* * distributed under the License is distributed on an "AS IS" BASIS, | ||
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* * See the License for the specific language governing permissions and | ||
* * limitations under the License. | ||
* * | ||
* * For more information: http://www.orientechnologies.com | ||
* | ||
*/ | ||
package com.orientechnologies.orient.core.exception; | ||
|
||
import com.orientechnologies.common.exception.OException; | ||
import com.orientechnologies.orient.core.sql.OCommandSQLParsingException; | ||
|
||
public class OQueryParsingException extends OException { | ||
public class OQueryParsingException extends OCommandSQLParsingException { | ||
|
||
private String text; | ||
private int position = -1; | ||
private static final long serialVersionUID = -7430575036316163711L; | ||
private String text; | ||
private int position = -1; | ||
private static final long serialVersionUID = -7430575036316163711L; | ||
|
||
public OQueryParsingException(final String iMessage) { | ||
super(iMessage); | ||
} | ||
public OQueryParsingException(final String iMessage) { | ||
super(iMessage); | ||
} | ||
|
||
public OQueryParsingException(final String iMessage, final Throwable cause) { | ||
super(iMessage, cause); | ||
} | ||
public OQueryParsingException(final String iMessage, final Throwable cause) { | ||
super(iMessage, cause); | ||
} | ||
|
||
public OQueryParsingException(final String iMessage, final String iText, final int iPosition, final Throwable cause) { | ||
super(iMessage, cause); | ||
text = iText; | ||
position = iPosition; | ||
} | ||
public OQueryParsingException(final String iMessage, final String iText, final int iPosition, final Throwable cause) { | ||
super(iMessage, cause); | ||
text = iText; | ||
position = iPosition; | ||
} | ||
|
||
public OQueryParsingException(final String iMessage, final String iText, final int iPosition) { | ||
super(iMessage); | ||
text = iText; | ||
position = iPosition; | ||
} | ||
public OQueryParsingException(final String iMessage, final String iText, final int iPosition) { | ||
super(iMessage); | ||
text = iText; | ||
position = iPosition; | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
StringBuilder buffer = new StringBuilder(); | ||
if (position > -1) { | ||
buffer.append("Error on parsing query at position #"); | ||
buffer.append(position); | ||
buffer.append(": "); | ||
} | ||
@Override | ||
public String getMessage() { | ||
StringBuilder buffer = new StringBuilder(); | ||
if (position > -1) { | ||
buffer.append("Error on parsing query at position #"); | ||
buffer.append(position); | ||
buffer.append(": "); | ||
} | ||
|
||
buffer.append(super.getMessage()); | ||
buffer.append(super.getMessage()); | ||
|
||
if (text != null) { | ||
buffer.append("\nQuery: "); | ||
buffer.append(text); | ||
buffer.append("\n------"); | ||
for (int i = 0; i < position - 1; ++i) | ||
buffer.append("-"); | ||
if (text != null) { | ||
buffer.append("\nQuery: "); | ||
buffer.append(text); | ||
buffer.append("\n------"); | ||
for (int i = 0; i < position - 1; ++i) | ||
buffer.append("-"); | ||
|
||
buffer.append("^"); | ||
} | ||
return buffer.toString(); | ||
} | ||
buffer.append("^"); | ||
} | ||
return buffer.toString(); | ||
} | ||
|
||
public String getText() { | ||
return text; | ||
} | ||
public String getText() { | ||
return text; | ||
} | ||
|
||
} |
114 changes: 59 additions & 55 deletions
114
core/src/main/java/com/orientechnologies/orient/core/sql/OCommandSQLParsingException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,67 @@ | ||
/* | ||
* | ||
* * Copyright 2014 Orient Technologies LTD (info(at)orientechnologies.com) | ||
* * | ||
* * Licensed under the Apache License, Version 2.0 (the "License"); | ||
* * you may not use this file except in compliance with the License. | ||
* * You may obtain a copy of the License at | ||
* * | ||
* * http://www.apache.org/licenses/LICENSE-2.0 | ||
* * | ||
* * Unless required by applicable law or agreed to in writing, software | ||
* * distributed under the License is distributed on an "AS IS" BASIS, | ||
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* * See the License for the specific language governing permissions and | ||
* * limitations under the License. | ||
* * | ||
* * For more information: http://www.orientechnologies.com | ||
* | ||
*/ | ||
* | ||
* * Copyright 2014 Orient Technologies LTD (info(at)orientechnologies.com) | ||
* * | ||
* * Licensed under the Apache License, Version 2.0 (the "License"); | ||
* * you may not use this file except in compliance with the License. | ||
* * You may obtain a copy of the License at | ||
* * | ||
* * http://www.apache.org/licenses/LICENSE-2.0 | ||
* * | ||
* * Unless required by applicable law or agreed to in writing, software | ||
* * distributed under the License is distributed on an "AS IS" BASIS, | ||
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* * See the License for the specific language governing permissions and | ||
* * limitations under the License. | ||
* * | ||
* * For more information: http://www.orientechnologies.com | ||
* | ||
*/ | ||
package com.orientechnologies.orient.core.sql; | ||
|
||
import com.orientechnologies.common.exception.OException; | ||
|
||
public class OCommandSQLParsingException extends OException { | ||
|
||
private String text; | ||
private int position; | ||
private static final long serialVersionUID = -7430575036316163711L; | ||
|
||
public OCommandSQLParsingException(String iMessage) { | ||
super(iMessage, null); | ||
} | ||
|
||
public OCommandSQLParsingException(String iMessage, String iText, int iPosition, Throwable cause) { | ||
super(iMessage, cause); | ||
text = iText; | ||
position = iPosition; | ||
} | ||
|
||
public OCommandSQLParsingException(String iMessage, String iText, int iPosition) { | ||
super(iMessage); | ||
text = iText; | ||
position = iPosition; | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
StringBuilder buffer = new StringBuilder(); | ||
buffer.append("Error on parsing command at position #"); | ||
buffer.append(position); | ||
buffer.append(": " + super.getMessage()); | ||
if (text != null) { | ||
buffer.append("\nCommand: "); | ||
buffer.append(text); | ||
buffer.append("\n---------"); | ||
for (int i = 0; i < position - 1; ++i) | ||
buffer.append("-"); | ||
|
||
buffer.append("^"); | ||
} | ||
return buffer.toString(); | ||
} | ||
private String text; | ||
private int position; | ||
private static final long serialVersionUID = -7430575036316163711L; | ||
|
||
public OCommandSQLParsingException(String iMessage) { | ||
super(iMessage, null); | ||
} | ||
|
||
public OCommandSQLParsingException(String iMessage, String iText, int iPosition, Throwable cause) { | ||
super(iMessage, cause); | ||
text = iText; | ||
position = iPosition; | ||
} | ||
|
||
public OCommandSQLParsingException(final String iMessage, final Throwable cause) { | ||
super(iMessage, cause); | ||
} | ||
|
||
public OCommandSQLParsingException(String iMessage, String iText, int iPosition) { | ||
super(iMessage); | ||
text = iText; | ||
position = iPosition; | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
StringBuilder buffer = new StringBuilder(); | ||
buffer.append("Error on parsing command at position #"); | ||
buffer.append(position); | ||
buffer.append(": " + super.getMessage()); | ||
if (text != null) { | ||
buffer.append("\nCommand: "); | ||
buffer.append(text); | ||
buffer.append("\n---------"); | ||
for (int i = 0; i < position - 1; ++i) | ||
buffer.append("-"); | ||
|
||
buffer.append("^"); | ||
} | ||
return buffer.toString(); | ||
} | ||
} |
Oops, something went wrong.