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 225444 - JPA: Don't show error for @Transient on getter without field if otherwise field access is used.
Summary: JPA: Don't show error for @Transient on getter without field if otherwise fie...
Status: RESOLVED INCOMPLETE
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-29 05:01 UTC by pekarna
Modified: 2013-12-24 15:55 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pekarna 2013-01-29 05:01:31 UTC
In 7.3.beta2, having an @Entity with some JPA annotations by fields and some by getter appears as an error.

I suggest to lessen this to just warning. Reasons:

1) This error isn't easily "mutable".

2) In some special cases, field access must be used, but then, for helper "getters" (like "getNameAndSurname()"), there's no field to move the @Transient annotation to.

3) I've tested Hibernate and Toplink; both tolerate combined.
Comment 1 Sergey Petrov 2013-01-29 05:15:33 UTC
case for getter+no field+transient may need special handling, but it may not be good design to add helper methods in beans notation in a bean.
not sure what {1} may mean.
Comment 2 pekarna 2013-01-29 16:45:23 UTC
+1. Actually I have noticed that Hibernate tolerates only some annotations getting mixed.

So, let's re-state this for getter + no field + @Transient.
Comment 3 Sergey Petrov 2013-04-04 12:45:38 UTC
can you provide an example?
is it necessary to apply @Transient on "helper getter" if other fields have fields access?
Comment 4 Sergey Petrov 2013-12-24 15:55:46 UTC
sorry, I'm a bit mixed with the issue, and there was a request for sample above, pleas provide one and reopen. also it may be less annoying as you can switch off jpa warning now.