97 words

Subquery error

2016-02-24 09:47

My query:

TypedQuery<Station> query = em.createQuery("SELECT p FROM Station p WHERE rid = (SELECT p FROM Station p where tpl='York') AND tpl != 'York'", Station.class);


Exception in thread "main" [ObjectDB 2.6.6_04] SELECT p FROM Station p WHERE rid = ( ==> SELECT <==  p FROM Station p where tpl='York') AND tpl != 'York'
Unexpected query token 'SELECT' (error 752)
(position 37) at com.objectdb.jpa.JpaQuery.getResultList(JpaQuery.java:728)
at Main.main(Main.java:37)
Caused by: com.objectdb.o.UserException: Unexpected query token 'SELECT'

Is this the correct way of using a subquery? Or is this not possible?



AEnimaH's picture
Joined on 2016-02-08
User Post #2
2016-02-24 09:58

Unfortunately this is one of the few JPA features that are not supported yet (see this list).

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support's picture
Joined on 2010-05-03
User Post #2,441

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Maximum file size: 32 MB