atlanmod / Mogwai

Automatic translation from OCL to Gremlin
10 stars 6 forks source link

Add isSingleResult() to MogwaiQueryResult #6

Closed agarciadom closed 8 years ago

agarciadom commented 8 years ago

When accepting external OCL queries, we might not know in advance if the query will return a single value or a collection. However, right now it is not possible to check if that was the case or not: calling the "wrong" method will result in a MogwaiException, and resultSize() might still return 1 if the OCL query happens to produce a collection with 1 element.

MogwaiQueryResult needs a method that tells the client if the result is a single value or not.