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 168657 - ManyToOne relations field naming
Summary: ManyToOne relations field naming
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@javaee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-16 07:50 UTC by firatkucuk
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 firatkucuk 2009-07-16 07:50:21 UTC
For instance:

cars
---------------
ID
Name

drivers
---------------
ID
Name
CarID


entity fields:

Car
---------------
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Basic(optional = false)
  @Column(name = "ID", nullable = false)
  private Integer id;

  @Basic(optional = false)
  @Column(name = "Name", nullable = false, length = 45)
  private String name;

  @OneToMany(cascade = CascadeType.ALL, mappedBy = "carID")
  private List<Driver> driverList;


Driver
---------------
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Basic(optional = false)
  @Column(name = "ID", nullable = false)
  private Integer id;

  @Basic(optional = false)
  @Column(name = "Name", nullable = false, length = 45)
  private String name;

  @JoinColumn(name = "CarID", referencedColumnName = "ID", nullable = false)
  @ManyToOne(optional = false)
  private Car carID;


private Car carID should be "car"
and if there were multiple many to one relations in the entity. it should be:
car, car1, car2 ....

Driver d = new Driver("Michael Schumacher");
d.car = new Car("Ferrari");
Comment 1 Martin Balin 2016-07-07 08:56:05 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