I have many EntityManager, one per schema that I have (I use entity-mappings file to map EMs with schemas). It works.
When I use @NamedQuery it's working like a charm but when I use @NamedNativeQuery schema is not used. I have to qualify with it SELECT foo FROM schema.table.
Is it the right behaviour ?
I think it's not possible to parameter @NamedNativeQuery to dynamically pass schema (I believe only columns can be dynamics not tables or schemas or anything else) so how can I use @NamedNativeQuery with dynamic schema please ?