ztx1491 / hibernate-generic-dao

Automatically exported from code.google.com/p/hibernate-generic-dao
1 stars 0 forks source link

MappedSuperclass missing from JPAAnnotationMetadata getProps() #89

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
JPAAnnotationMetadata.getProps() {
...

  // FIX: To also include methods from MappedSuperclass
        if (null != method.getDeclaringClass().getAnnotation(Entity.class)
            || null != method.getDeclaringClass().getAnnotation(Embeddable.class)
            || null != method.getDeclaringClass().getAnnotation(MappedSuperclass.class)) {

Original issue reported on code.google.com by gugur...@gmail.com on 20 Apr 2011 at 10:46

GoogleCodeExporter commented 8 years ago
Thanks for the fix. I I'll be sure to check into this when I gave time.

Original comment by dwolvert on 21 Apr 2011 at 1:48

GoogleCodeExporter commented 8 years ago
Hi gugurete,

Can you please provide a patch? I can guess it goes in line 176 of version 
1.2.0, buts a bit ambiguous on whether MappedSuperclass has to be checked 
somewhere else in JPAAnnotationMetadata.getProps().

Thanks.

Original comment by pablit...@gmail.com on 13 Jun 2014 at 10:55

GoogleCodeExporter commented 8 years ago
Hi David,

Is there anywhere else where I have to add this check for MappedSuperclass, 
such as here (above the change defined by gugurete):

if (!isEntity() && !isEmbeddable())
    return props; //Will have no persistable properties.

for (Field field : klass.getFields()) {
    if (null != field.getDeclaringClass().getAnnotation(Entity.class)
        || null != field.getDeclaringClass().getAnnotation(Embeddable.class)) {
            props.put(field.getName(), new Property(field));
    }
}

Original comment by pablit...@gmail.com on 10 Jul 2014 at 3:03

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I don't know for sure. Ideally, you should add to the model in 
test-base/src/main/java/test/googlecode/genericdao/model/ in order to exercise 
the use of MappedSuperclass mappings and write some tests that use them.

Original comment by dwolvert on 27 Jul 2014 at 9:59