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 203150 - No JPA hints in the editor
Summary: No JPA hints in the editor
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 7.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-05 14:11 UTC by artisan
Modified: 2016-07-07 08:53 UTC (History)
1 user (show)

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 artisan 2011-10-05 14:11:05 UTC
In the previous version I got a hint about missing annotations for an association between JPA entities. There was the choice to set annotations for uni- and bidirectional @OneToMany and @OneToOne.

They're gone now. I'm still getting the warning though that the field is not basic so it should be properly annotated.
Comment 1 Sergey Petrov 2011-10-05 14:28:49 UTC
It may be the issue for specific use-case only, can you provide sample code?
Comment 2 Sergey Petrov 2011-10-05 14:51:31 UTC
just tried latest, create entities A and B and add line 'private A some;' to B. have all mentioned hints (create uni/bi onetoone/many)
Comment 3 artisan 2011-10-06 10:48:16 UTC
That's weird, I can't reproduce it. It's working indeed.

Anyway, I don't think it's useful to waste any time on this.

My sincere apologies for the inconvenience...
Comment 4 artisan 2011-10-06 13:00:32 UTC
OK - could reproduce. The hint is missing when the generic type is an interface (and probably also an abstract class). Although this is not common practice, it is allowed if the "targetentity" attribute is specified.


An interface :

interface Bar {
}


Implemented by a default class :

class BarImpl implements Bar {
}


Using it for an association :

@Entity
class Test {

  private Bar bar; <== No hints. But there's a warning though.

}


However, this is JPA-compliant :

@Entity
class Test {
   
  @OneToOne(targetEntity=BarImpl.class)
  private Bar bar;

}
Comment 5 Sergey Petrov 2011-10-06 13:03:20 UTC
ok, need to investigate, but it may be not a regression and isn't p2 as some corner case and just isn't "yet supported" case.
Comment 6 artisan 2011-10-06 13:04:23 UTC
No problem :-) Just signalling it.
Comment 7 Sergey Petrov 2011-10-06 13:06:12 UTC
thanks, for the report, will try in 7.1
Comment 8 Sergey Petrov 2011-10-13 16:00:06 UTC
BarImpl isn't entity in sample provided. But it it's meant to be an entity it's not usual hint as for other cases with relationship, it's some indirect hint with additional analysis for possible target classes implemented by provided interface, instead of direct hint which say "hey, it's entity and it should be some kind of relationship instead of plain member". Such analysis is clear enhancement request for me, it can last forever, some hint may be provided even if Bar will not be implemented by any entity but there may be a hint to create such entity and so on.
Comment 9 Martin Balin 2016-07-07 08:53:54 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