Issue #644: Query Execution Error

Type: Bug ReoprtVersion: 2.3.6Priority: NormalStatus: FixedReplies: 4
#1

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

#2

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

#3

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

#4

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

#5

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

ObjectDB Support

Reply