Primary keys not added to source

I have a table, Pdetail, that has two primary keys: ncode and linecode. I cannot reference these columns in the front end (using Polymer), and I cannot use them in a predefined JPQL query. The source for the entity does not show these two columns in the table. I cannot add it as an attribute - it complains that the attribute already exists.

I have attached the source for the query and for the entity, as well as the auto-generated DDL for Pdetail.

The database type is MSSQL. It was migrated to Cuba.platform, not built from scratch.

pdetail.source.java.txt (4.3K)

query.source.xml (408B)

pdetail.source.ddl.txt (722B)

Hi.
Fields of composite primary key should be addressed as entity.id.fieldName. ID is always included to view.
In your case, the rest query should be as follows:

<?xml version="1.0"?>
<queries xmlns="[url=http://schema.haulmont.com/cuba/rest-queries.xsd">]http://schema.haulmont.com/cuba/rest-queries.xsd">[/url];
    <query name="lineitemsByPolicyholder" entity="test$Pdetail" view="_local">
        <jpql><!&#91;CDATA&#91;
        SELECT row FROM test$Pdetail row WHERE row.id.ncode = :policyholder
        &#93;&#93;></jpql>
        <params>
            <param name="policyholder" type="java.lang.String"/>
        </params>
    </query>
</queries>

Great, that works! Thanks.