ORDER BY pub.autores
This is probably the reason of the exception. Ordering by a collection doesn't make sense.
Another problem is
SELECT publicacao
publicacao
is not an alias defined in the query. You should use select pub
instead.
Also, you shouldn't have the @Column
annotation on autores
. It's a ManyToMany association, and is thus not mapped as a column. And you also use inverseJoinColumns
where you should use joinColumns
, and vice-versa.