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 - "Enitty Classes from Database" missing named query "findByPK"
Summary: "Enitty Classes from Database" missing named query "findByPK"
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-20 18:23 UTC by err
Modified: 2016-07-07 08:56 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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