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.
Summary: | There is no ID defined for this entity hierarchy. | ||
---|---|---|---|
Product: | javaee | Reporter: | gualtiero65 |
Component: | Persistence | Assignee: | Sergey Petrov <sj-nb> |
Status: | REOPENED --- | ||
Severity: | normal | CC: | mpetras |
Priority: | P3 | ||
Version: | 7.1 | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | Java class wich defined an entity |
Description
gualtiero65
2012-02-14 19:49:34 UTC
Created attachment 115722 [details]
Java class wich defined an entity
I'm not able to reproduce in latest build. Anyway assigning to the proper category... Hi, I've found that the issue is connected to @Transient fields. If I comment out @Transient fields/getters the problem disappears. Gualtiero You mean that you had your ID annotated as @Transient? In that case would be the hint ok since @Transient entity fields aren't stored into database or not? Anyway, Sergey will be able to provide more information for sure. No. ID is not Transient. @Id @GeneratedValue(generator = "system-uuid") @GenericGenerator(name = "system-uuid", strategy = "uuid") protected String id; In the same entity/class I have getters like this @Transient public String getNomeCompleto() { return String.format("%s %s", getCognome() == null ? "" : getCognome(), getNome() == null ? "" : getNome()); } If I comment out these getters the "There is no ID defined for this entity hierarchy." error disappears. it seems to be valid issue, but also looks like there is entity declaration issue with mixed access type, id have fields access type but transient is applied to property, I need to double check but it may not be good according to specification also if no explicit default access type is selected and modified by @Access later, but in this case there should be a warning regarding access type mixing not regarding @Id in my opinion(not supported yet) ok, just tried to mix access type and got both warnings(inside one) - regarding access type and missed id, first one regarding access type and it's ok as it do not allow to determine if there is id properly we suppose there is no id. do you see both warnings? the issue may be invalid then. Please reopen if you see only one or I miss something regarding mixed access. I confirm this happens on entities with mixed access (field + property). I have properly configured mixed access on three entities and the misleading error hint appears just on these entity classes. In all three entities: - field access is the default access type (the entity class is annotatited with @Access(AccessType.FIELD)) - the ID column (@Id) is using the default access type, i.e. field access type - there are 1 to 3 columns with the property access type (the getter is annotated with @Access(AccessType.PROPERTY)) - fields corresponding to these columns are annotated with @Transient (as required by JPA) 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 (In reply to Martin Balin from comment #9) > 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 Just tried it on Netbeans IDE 8.2 and the issue remains the same. Got some entities with @Transient properties (not ID) and got the same error. |