91 words

Issue with alias

#1
2012-01-17 04:30

Hi,

This query works and correctly casts and selects my entity into the tuplet:

SELECT $1, ((com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedDebitorenKontoFragment)$1.qubletFRAGMENTMAP.get('com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedDebitorenKontoFragment')) AS DEB FROM com.lexware.vereinsverwaltung.verein.mitglied.Mitglied $1 WHERE DEB.debitor=true

however, trying to access "DEB" in the where clause causes an "unexpected token" error?

Alex

quasado
quasado's picture
Joined on 2011-04-30
User Post #78
#2
2012-01-17 05:35

A result alias can only be used in the ORDER BY clause of the query (and after query execution in managing result elements using Tuple).

This is because the real order of query clauses is:
    FROM -> WHERE -> GROUP BY -> HAVING -> SELECT -> ORDER BY

and you cannot use an element before it is defined.

 

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

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.
Attachments:
Maximum file size: 32 MB
Cancel