// Cria a consulta
String queryString = query.createQuery(filters);
javax.persistence.Query queryJPA;
if (query instanceof NativeQuery) {
NativeQuery nativeQuery = (NativeQuery) query;
Class<?> target = (nativeQuery.getTarget() != null) ? nativeQuery.getTarget() : this.clazz;
queryJPA = manager.createNativeQuery(queryString, target);
} else {
queryJPA = manager.createQuery(queryString);
}