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.
JPA @Embedded annotation is erraneously considered a basic type by the editor and flagged with an ERROR: basic attributes can only be of the following types. (NB6.7RC3) Code builds fine.
@Embedded public Address getAddress() { return address; }
either fixed or need more details. just tried to create entity in 6.9: @Entity public class NewEntity implements Serializable { private static final long serialVersionUID = 1L; private Long id; private Customer cust; @Id @GeneratedValue(strategy = GenerationType.AUTO) public Long getId() { return id; } public void setId(Long id) { this.id = id; } @Embedded public Customer getCust(){ return cust; } and embedded have no errors regarding basic type, have only a warning about undefined relationship. if the issue is still valid, please provide complete source if possible.
I can confirm that the bug is still present in latest official version 6.8. Did not install 6.9 yet.
I don't remember any fixes in the area, can you provide more details?
(slowly) downloaded 6.9b: the issue is solved! thanks!
Created attachment 98262 [details] error message in 6.9b
Created attachment 98263 [details] entity with editor error
Created attachment 98264 [details] copied class + dependencies
Well, I was too fast (or NB6.9b is too slow). It took about 10' before he rescanned everything and the error reappeared. I copied over the offending class to a test package for isolated reproduction and... the error disappeared. Another warning dissappeared in the editor in the copied class: in the original Organization.java there's an editor warning "the project does not contain a persistence unit". In the copied class the warning is not there. This is a multimodule maven project.
Can you provide complete sample project? I got this error on @Embedded public Address getLocation() { but only when Address was simple class isn't annotated with @Embeddable, after annotation addition error gone away.
Created attachment 98267 [details] maven module
tried to open the project, it complain about source level 1.3 and after change to 1.6 became corrupted, it may be an issue in maven projects support. may be the issue with projects created on windows and opened on linux. will try on win a bit later.
I'm on vista/java 6 indeed
ok, tried it on windows with 6.9.1 and it show some dependencies is missed (not in local repository), also it's still 1.3 source level and attempt to correct source level make project corrupted, have you tried to open attached project?
I reproduced the bug on NB 7.0.1. I think I now what the issue is: The error is reported if the Embeddable class (Address) is NOT Serializable (which is valid code). NetBeans will display a hint to make it Serializable. If you make the embeddable Serializable the error in the embedding class disappears. Netbeans should not give an error on embedding of non Serializable Embeddables.
I also have this issue with 7.3 beta 2, and consider it a very annoying bug. As catweasle said: the error goes away if you make the embeddable serialisable as well, but you shouldn't have to.
*** Bug 225343 has been marked as a duplicate of this bug. ***
Can confirm it is an issue on Windows 8 x64 Professional, using Netbeans IDE 7.3, build 201302132200.
http://hg.netbeans.org/web-main/rev/8c584b8da6e4 Basic... validator should skip @Embedded now.