Ich versuche UNION zu verwenden, um alle eindeutigen Bezeichner (jcr: uuid) mehrerer Knotentypen zu sammeln und eine InvalidQueryException zu erhalten, während die eigentlichen SELECT-Anweisungen selbst erfolgreich sind.
hase Version: 2.12.1JCR-SQL2 InvalidQueryException mit UNION - erwartet:
SELECT [jcr:uuid] FROM [base:nodeType1]
UNION
SELECT [jcr:uuid] FROM [base:nodeType2]
Stacktrace:
SELECT [jcr:uuid] FROM [base:nodeType1]
UNION(*)SELECT [jcr:uuid] FROM [base:nodeType2]; expected: <end>
at org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerObject.java:113)
at org.apache.jackrabbit.rmi.server.ServerQueryManager.createQuery(ServerQueryManager.java:74)
at sun.reflect.GeneratedMethodAccessor2078.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:276)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:253)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:162)
at org.apache.jackrabbit.rmi.server.ServerQueryManager_Stub.createQuery(Unknown Source)
at org.apache.jackrabbit.rmi.client.ClientQueryManager.createQuery(ClientQueryManager.java:66)
Dank Oliver aber die oben vorgeschlagene Lösung nicht funktioniert entweder.
Ich habe die folgenden Abfragen ausprobiert und sie funktionieren auch nicht.
SELECT [jcr: uuid] FROM [base: nodeType1] als UNION SELECT [jcr: uuid] FROM [base: nodeType2] AS a'
SELECT a. [Jcr: uuid] FROM [base: nodeType1] als UNION a [JCR. UUID] FROM [base: nodeType2] AS a'
SELECT a [JCR. UUID] FROM [base:. nodeType1] als UNION SELECT b [ jcr: uuid] FROM [Basis: nodeType2] AS b'
– user3150236