views:

35

answers:

1

I use Netbeans as IDE and use the wizards to generate Entities. If I want to define custom NamedQueries (not the ones auto generated) how can I define those outside of the entity so I don't lose them if I have to recreate the entity using the wizard?

+1  A: 

You can add the custom named queries instead like:

        <persistence-unit>
         ...
        <named-query name="xxxxxx">
        <query>
        <![CDATA[
        SELECT x FROM XXXXXXXX x
        ]]>
        </query>
        </named-query>
        </persistence-unit>
javydreamercsw
Found the answer myself after some more investigation.
javydreamercsw