When I use 'active' below, I get Query<SessionS...
# squarelibraries
z
When I use 'active' below, I get Query<SessionSql>; but when I use 'recent' I get Query<Recent> even though both queries include the same exact fields. If I comment out
WHERE endTime IS NOT NULL
I get identical behavior between the two.
Copy code
active:
SELECT *
FROM sessionSql
WHERE endTime IS NULL
ORDER BY startTime;

recent:
SELECT *
FROM sessionSql
WHERE endTime IS NOT NULL
ORDER BY endTime DESC
LIMIT :count;
h
Recent.endTime should be non null, while SessionSql.endTime should be nullable
z
Makes sense, thank you! Any way I can force recent to return SessionSql despite that?
h
You can pass a custom Mapper, just pass the constructor
👍🏽 1