358 words

Issue #131 - Query Execution Error

BugVersion: 2.3.6Priority: NormalStatus: FixedReplies: 4
#1
2012-01-18 15:30

This query

SELECT DISTINCT $1 FROM com.lexware.vereinsverwaltung.verein.mitglied.Mitglied $1 LEFT JOIN $1.mitgliedschaft $2 LEFT JOIN $2.abteilungen $3 LEFT JOIN $3.abteilung $4 WHERE (((NOT ((($2 IS NOT NULL) AND ($3 IS NOT NULL) AND ($4 IS NOT NULL) AND ($4.qubletID=383))) OR NOT (((com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedDebitorenKontoFragment) $1.qubletFRAGMENTMAP.get('com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedDebitorenKontoFragment')).debitor=true)) AND ((((com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedVertraegeFragment) $1.qubletFRAGMENTMAP.get('com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedVertraegeFragment')).contracts.contractItem=387) AND (((com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedVertraegeFragment) $1.qubletFRAGMENTMAP.get('com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedVertraegeFragment')).contracts.automatic=true) AND (((com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedVertraegeFragment) $1.qubletFRAGMENTMAP.get('com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedVertraegeFragment')).contracts.active=true))))

results in "Query Execution Error===null" in Explorer and Internal Exception in java client code. Please note that this one worked before but stopped working.. I'd be so happy to get this finally running though still struggling :(

 

Find attached the db for testing

quasado
quasado's picture
Joined on 2011-04-30
User Post #93
#2
2012-01-18 15:32

Aaah.. I can see.. I guess it is because of the collection access again jeeze..

Well okay, anyway the error code (NullPointerException seems to occurr) isn't very helpful :(

Alex

quasado
quasado's picture
Joined on 2011-04-30
User Post #94
#3
2012-01-18 15:39

Well ok, the null pointer occurrs now even without collection stuff which has worked just fine before!!!

See this more simple query (no collection and the such)

SELECT DISTINCT $1 FROM com.lexware.vereinsverwaltung.verein.mitglied.Mitglied $1 LEFT JOIN $1.mitgliedschaft $2 LEFT JOIN $2.abteilungen $3 LEFT JOIN $3.abteilung $4 WHERE (((NOT ((($2 IS NOT NULL) AND ($3 IS NOT NULL) AND ($4 IS NOT NULL) AND ($4.qubletID=383))) OR NOT (((com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedDebitorenKontoFragment) $1.qubletFRAGMENTMAP.get('com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedDebitorenKontoFragment')).debitor=true))))

-> same error, try in explorer with attached db.

Alex

quasado
quasado's picture
Joined on 2011-04-30
User Post #95
#4
2012-01-18 15:40

Okay, this seems to work (adding a null check for map return first as there might be null values):

SELECT DISTINCT $1 FROM com.lexware.vereinsverwaltung.verein.mitglied.Mitglied $1 LEFT JOIN $1.mitgliedschaft $2 LEFT JOIN $2.abteilungen $3 LEFT JOIN $3.abteilung $4 WHERE (((NOT ((($2 IS NOT NULL) AND ($3 IS NOT NULL) AND ($4 IS NOT NULL) AND ($4.qubletID=383))) OR NOT (((com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedDebitorenKontoFragment) $1.qubletFRAGMENTMAP.get('com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedDebitorenKontoFragment')) IS NOT NULL))))

Whereas putting the null check in front and after that make the check for debitor=true still results in null pointer:

SELECT DISTINCT $1 FROM com.lexware.vereinsverwaltung.verein.mitglied.Mitglied $1 LEFT JOIN $1.mitgliedschaft $2 LEFT JOIN $2.abteilungen $3 LEFT JOIN $3.abteilung $4 WHERE (((NOT ((($2 IS NOT NULL) AND ($3 IS NOT NULL) AND ($4 IS NOT NULL) AND ($4.qubletID=383))) OR NOT (((com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedDebitorenKontoFragment) $1.qubletFRAGMENTMAP.get('com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedDebitorenKontoFragment')) IS NOT NULL AND ((com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedDebitorenKontoFragment) $1.qubletFRAGMENTMAP.get('com.lexware.vereinsverwaltung.abrechnung.api.model.mitglied.MitgliedDebitorenKontoFragment')).debitor=true))))

BTW - should null pointer exceptions EVER happen if query access not set fields or their subfields? Because I've assumed that in such cases, the expressions are not evaluated // do return false??

Alex

quasado
quasado's picture
Joined on 2011-04-30
User Post #96
#5
2012-01-18 15:51

This is the result of a change done today. Try 2.3.6_11.

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

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