Relacionamento ManyToMany - Duvida em consulta de tabela n:n JPA Netbeans

Tenho uma base de dados onde foi criado uma tabela de relacionamento n:n chamada Perfil_Func:

Perfil ------ Perfil_Func--------Funcionalidade

Esta tabela é responsável por armazenar os códigos dos perfil e suas funcionalidades.

Quando gero as classes de persistências pelo Netbeans, somente na classe de Funcionalidades existe a notação:

@JoinTable(name = "tbl_perfil_func", joinColumns = {
    @JoinColumn(name = "COD_FUNC", referencedColumnName = "ID_FUNCIONALIDADE")}, inverseJoinColumns = {
    @JoinColumn(name = "COD_PERFIL", referencedColumnName = "ID_PERFIL")})
@ManyToMany
private Collection<TblPerfil> tblPerfilCollection;

Quando tento fazer uma simples consulta para pegar as funcionalidades de um determinado perfil usando a notação:

Query q = controller.getEntityManager().createQuery("SELECT F.CODIGO FROM TBL_PERFIL_FUNC PF, TBL_FUNCIONALIDADE F WHERE F.ID_FUNCIONALIDADE = PF.COD_FUNC AND PF.COD_PERFIL =:id");
q.setParameter("id", 1);

Recebo o seguinte erro:

Exception Description: Error compiling the query [SELECT F.CODIGO FROM TBL_PERFIL_FUNC PF, TBL_FUNCIONALIDADE F WHERE F.ID_FUNCIONALIDADE = PF.COD_FUNC AND PF.COD_PERFIL =:id]. Unknown entity type [TBL_FUNCIONALIDADE].
    at org.eclipse.persistence.exceptions.JPQLException.entityTypeNotFound(JPQLException.java:483)

Alguem poderia me dar uma luz para fazer esta simples pesquisa?

existe a entidade TBL_FUNCIONALIDADE ?

Cara, createQuery é para HQL, onde vc usa o nome de suas entidades nas pesquisas não da tabela;

Se quer usar SQL nativo, tens que fazer um createNativeQuery;