Hi Lasse,
Let's tackle in-memory read models first. If you are building a
CQRS application, read models are updated in event handlers as reaction to facts that something happened in the system (events are usually published during command processing). The way this models are persisted is up to the application developer - you can use in-memory databases, relational databases, NoSql databases, files, caches, or even Java data structures.
Querying the aggregates - this is something which does not comply with CQRS, but it can be achieved, as the matter a fact I was working on a project where we didn't have dedicated read models but were querying aggregates which were stored using JPA repositories. So, that's one way.
On the other hand if your aggregates are event sourced, you could use EventSourcingRepository to load the aggregate state based on historic events. Of course, this queries can be only by Id and you cannot query based on the aggregate state.
Hope this helps you!
Cheers,
Milan.