google-code-export / simplejpa

Automatically exported from code.google.com/p/simplejpa
1 stars 0 forks source link

Entities with Id annotation on property does not work #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When using a JPA-annotated class that has the Id annotation on the id property 
rather than getter 
method, SimpleJPA throws an exception.

It appears that AnnotationManager only checks for a method with the Id 
annotation in the entity 
class and ignores the properties.  This causes problems using Groovy beans as 
entity classes since 
the getters are auto-generated.

Ideally, SimpleJPA should also examine the properties for the required 
annotations, and use the 
Introspector to get the appropriate getter method.

Original issue reported on code.google.com by craigwblake@gmail.com on 15 Dec 2008 at 4:49

GoogleCodeExporter commented 9 years ago
Attached is a patch to this lookup on properties.

Original comment by craigwblake@gmail.com on 15 Dec 2008 at 4:58

Attachments: