New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EntityDefinition doesn't pick up inherited fields/methods #640

Closed
jamesdbaker opened this Issue Feb 22, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@jamesdbaker

jamesdbaker commented Feb 22, 2018

I have some interfaces defined as follows:

public interface WithId {
  String getId();
}

public interface MyObject extends WithId {
  //getId() is inherited
  //Some more methods, properties, etc
}

When I try to register the object (with the following), it fails to detect the id property as expected:

Javers javers = JaversBuilder.javers()
    .withMappingStyle(MappingStyle.BEAN)
    .registerEntity(new EntityDefinition(MyObject.class, "id"))
    .build();

The error I get is: PROPERTY_NOT_FOUND: property 'id' not found in class 'MyObject'

If the getId() method is directly on MyObject, then the code above works as expected. This is using javers-core version 3.7.5.

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Feb 22, 2018

And what about the concrete class?

@jamesdbaker

This comment has been minimized.

jamesdbaker commented Feb 23, 2018

A concrete implementation doesn't throw an error, but in my use case I don't necessarily know what concrete implementation I'm going to be passed (just that it will implement the interface MyObject).

@bartoszwalacik bartoszwalacik added the bug label Feb 25, 2018

bartoszwalacik added a commit that referenced this issue Feb 25, 2018

bartoszwalacik added a commit that referenced this issue Feb 26, 2018

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Feb 28, 2018

fix released in 3.8.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment