javax.persistence.PersistenceException: org.postgresql.util.PSQLException: ERROR: subquery in FROM must have an alias Hint: For example, FROM (SELECT ...) [AS] foo. Position: 22 at com.avaje.ebeaninternal.server.query.CQueryEngine.findRowCount(CQueryEngine.java:138) at com.avaje.ebeaninternal.server.query.DefaultOrmQueryEngine.findRowCount(DefaultOrmQueryEngine.java:57)
This occurs when a count is used on a query with a predicate on a *ToMany property. In this case there is a select count(*) from ( ... ) wrapped around the sql.
In this case Postgres needs a " AS c" alias added to the sql.
Fixed in HEAD.