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 172070 - improve format for NamedQueries
Summary: improve format for NamedQueries
Status: RESOLVED DUPLICATE of bug 124102
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-11 23:54 UTC by err
Modified: 2009-09-14 08:31 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-11 23:54:36 UTC
When generating entity class from database, a slight change in the named queries formatting would make it much easier to
work with them in the editor. In particular adding/deleting queries.

The idea is to always have "@NamedQuery" at the start of a line (except for the first one. Then it is simpler to add or
delete a query. Note that the number of lines is usually the same.

For example, instead of:

@NamedQueries({@NamedQuery(name = "ChartHasEvent.findAll", query =
        "SELECT c FROM ChartHasEvent c"), @NamedQuery(name =
        "ChartHasEvent.findByChartId", query =
        "SELECT c FROM ChartHasEvent c WHERE c.chartHasEventPK.chartId = :chartId"), @NamedQuery(name =
        "ChartHasEvent.findByEventId", query =
        "SELECT c FROM ChartHasEvent c WHERE c.chartHasEventPK.eventId = :eventId")})

format it this way:

@NamedQueries({@NamedQuery(name = "ChartHasEvent.findAll", query =
        "SELECT c FROM ChartHasEvent c"),
        @NamedQuery(name = "ChartHasEvent.findByChartId", query =
        "SELECT c FROM ChartHasEvent c WHERE c.chartHasEventPK.chartId = :chartId"),
        @NamedQuery(name = "ChartHasEvent.findByEventId", query =
        "SELECT c FROM ChartHasEvent c WHERE c.chartHasEventPK.eventId = :eventId")})
Comment 1 err 2009-09-11 23:56:13 UTC
Oops, make component persistence.
Comment 2 Sergey Petrov 2009-09-14 08:31:00 UTC
it's high visile for named queries, but in real the issue is about annotations formatting, i.e. new line for each nested
and may be new line for each parameter.

*** This issue has been marked as a duplicate of 124102 ***