Skip to content
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

#414 - @Labels setter is not called when loading entity #485

Closed
wants to merge 2 commits into from

Conversation

jdorleans
Copy link
Contributor

@jdorleans jdorleans commented May 12, 2018

Description

  • Ensuring overridden @PostLoad method is called in child class
  • Loading parent methods and replacing child's overridden ones in MethodsInfo
  • Adding test for overridden @PostLoad method

NOTE:

Related Issue

#414 - @Labels setter is not called when loading entity

Motivation and Context

Perform entity properties updates during load based on current labels state and be able to override this behaviour on children entities by overriding @PostLoad parent's method. e.g.

class Parent {
  @PostLoad
  public void postLoad() {...}
}
class Child extends Parent {
  @Override
  public void postLoad() {...} // this is not possible today 
}

How Has This Been Tested?

Using existing test case in addition to new tests

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

jdorleans added 2 commits May 11, 2018 15:50
- Preventing AutoIndex initialization when disabled in configuration
- Preventing Session creation when AutoIndex is disabled
- Building AutoIndex during initialization to avoid redundant operation
- Fixing LabelPrimaryId to set child's label instead of parent's
- Fixing LabelPrimaryId equals and hashcode to avoid NPE during lookup
- Updating AutoIndex test accordingly
- Creating AutoIndex and LabelPrimaryId tests in EntityAbstractionTest

neo4j#437
- Loading parent methods and replacing child's overridden ones
- Adding test for overridden @PostLoad method

NOTE:
- Reflection method invocation calls overridden methods if exists
- Those changes depends on neo4j#484

neo4j#414
@michael-simons
Copy link
Collaborator

I'm closing this in favor of #517.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants