The JPQL query "delete from foo" throws an exception when executed:
java.lang.ArrayIndexOutOfBoundsException: 1
at net.sf.jpasecurity.jpql.parser.SimpleNode.jjtGetChild(SimpleNode.java:82)
at net.sf.jpasecurity.jpql.compiler.JpqlCompiler$AliasVisitor.getAlias(JpqlCompiler.java:394)
at net.sf.jpasecurity.jpql.compiler.JpqlCompiler$AliasVisitor.visit(JpqlCompiler.java:325)
at net.sf.jpasecurity.jpql.compiler.JpqlCompiler$AliasVisitor.visit(JpqlCompiler.java:301)
at net.sf.jpasecurity.jpql.parser.JpqlFromItem.jjtAccept(JpqlFromItem.java:18)
at net.sf.jpasecurity.jpql.parser.SimpleNode.visit(SimpleNode.java:113)
at net.sf.jpasecurity.jpql.parser.SimpleNode.visit(SimpleNode.java:115)
at net.sf.jpasecurity.jpql.parser.SimpleNode.visit(SimpleNode.java:115)
at net.sf.jpasecurity.jpql.compiler.JpqlCompiler.getAliasDefinitions(JpqlCompiler.java:130)
at net.sf.jpasecurity.jpql.compiler.JpqlCompiler.compile(JpqlCompiler.java:95)
at net.sf.jpasecurity.jpql.compiler.JpqlCompiler.compile(JpqlCompiler.java:85)
at net.sf.jpasecurity.security.EntityFilter.compile(EntityFilter.java:374)
at net.sf.jpasecurity.security.EntityFilter.filterQuery(EntityFilter.java:128)
at net.sf.jpasecurity.persistence.DefaultSecureEntityManager.createQuery(DefaultSecureEntityManager.java:275)
at net.sf.jpasecurity.persistence.DefaultSecureEntityManager.createQuery(DefaultSecureEntityManager.java:264)
Using an alias like "delete from foo f" works without problems.
Hmm, it's ok to throw an exception since the JPQL does not conform to the spec. We just should throw a more explaining exception