This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 172622

Summary: "Enitty Classes from Database" missing named query "findByPK"
Product: javaee Reporter: err <err>
Component: PersistenceAssignee: Sergey Petrov <sj-nb>
Status: RESOLVED WONTFIX    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description err 2009-09-20 18:23:04 UTC
This may not be considered an issue; I'll point it out while I'm remembering. When generating named queries for the
following entity, seems like there should be

    @NamedQuery(name = "Aspectdisplay.findByPK", query =
        "SELECT d FROM Aspectdisplay d WHERE d.chevPK = :pk")})

Of course I think you can also do
    em.find(Aspectdisplay, pk)



public class Aspectdisplay implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected ChevPK chevPK;
    ...

@Embeddable
public class ChevPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "CHART_ID", nullable = false)
    private int chartId;
    @Basic(optional = false)
    @Column(name = "EVENT_ID", nullable = false)
    private int eventId;
    ...
Comment 1 Sergey Petrov 2009-09-21 07:17:47 UTC
doesn't look like a defect for me. but it may be good to have this named query
Comment 2 Martin Balin 2016-07-07 08:56:50 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss