Skip to content
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

Parser regression with top level treat expressions #857

Closed
Mobe91 opened this issue Sep 27, 2019 · 0 comments · Fixed by #862
Closed

Parser regression with top level treat expressions #857

Mobe91 opened this issue Sep 27, 2019 · 0 comments · Fixed by #862

Comments

@Mobe91
Copy link
Contributor

Mobe91 commented Sep 27, 2019

An entity-view mapping @Mapping("TREAT(parent AS BaseProduct)") fails to parse with 1.4.0-Alpha2 that previously worked.

Also, the parser does not restore the original whitespaces in an expression when it throws a SyntaxErrorException.

Caused by: com.blazebit.persistence.parser.expression.SyntaxErrorException: A top level treat expression is not allowed. Consider to further dereference the expression: TREAT(parentASBaseProduct)
	at com.blazebit.persistence.parser.expression.JPQLNextExpressionVisitorImpl.visitPathExpression(JPQLNextExpressionVisitorImpl.java:599)
	at com.blazebit.persistence.parser.expression.JPQLNextExpressionVisitorImpl.visitPathExpression(JPQLNextExpressionVisitorImpl.java:56)
	at com.blazebit.persistence.parser.JPQLNextParser$PathExpressionContext.accept(JPQLNextParser.java:6638)
	at com.blazebit.persistence.parser.expression.JPQLNextExpressionVisitorImpl.visitParseExpression(JPQLNextExpressionVisitorImpl.java:94)
	at com.blazebit.persistence.parser.expression.JPQLNextExpressionVisitorImpl.visitParseExpression(JPQLNextExpressionVisitorImpl.java:56)
	at com.blazebit.persistence.parser.JPQLNextParser$ParseExpressionContext.accept(JPQLNextParser.java:408)
	at com.blazebit.persistence.parser.antlr.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at com.blazebit.persistence.parser.expression.AbstractExpressionFactory.createExpression(AbstractExpressionFactory.java:186)
	at com.blazebit.persistence.parser.expression.AbstractExpressionFactory.createSimpleExpression(AbstractExpressionFactory.java:213)
	at com.blazebit.persistence.parser.expression.AbstractCachingExpressionFactory$2.get(AbstractCachingExpressionFactory.java:56)
	at com.blazebit.persistence.parser.expression.AbstractCachingExpressionFactory.getOrDefault(AbstractCachingExpressionFactory.java:158)
	at com.blazebit.persistence.parser.expression.AbstractCachingExpressionFactory.createSimpleExpression(AbstractCachingExpressionFactory.java:109)
	at com.blazebit.persistence.view.impl.MacroConfigurationExpressionFactory.createSimpleExpression(MacroConfigurationExpressionFactory.java:67)
	at com.blazebit.persistence.parser.expression.AbstractExpressionFactoryMacroAdapter.createSimpleExpression(AbstractExpressionFactoryMacroAdapter.java:66)
	at com.blazebit.persistence.view.impl.metamodel.AbstractAttribute.getCollectionJoinMappings(AbstractAttribute.java:395)
	at com.blazebit.persistence.view.impl.metamodel.ManagedViewTypeImpl.checkAttributes(ManagedViewTypeImpl.java:391)
	at com.blazebit.persistence.view.impl.metamodel.ViewMetamodelImpl.<init>(ViewMetamodelImpl.java:103)
	at com.blazebit.persistence.view.impl.EntityViewManagerImpl.<init>(EntityViewManagerImpl.java:166)
@beikov beikov self-assigned this Sep 27, 2019
@beikov beikov added this to the 1.4.0 milestone Sep 27, 2019
@beikov beikov assigned Mobe91 and unassigned beikov Sep 30, 2019
Mobe91 added a commit to Mobe91/blaze-persistence that referenced this issue Oct 2, 2019
Mobe91 added a commit to Mobe91/blaze-persistence that referenced this issue Oct 7, 2019
Mobe91 added a commit to Mobe91/blaze-persistence that referenced this issue Oct 7, 2019
beikov pushed a commit that referenced this issue Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants