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

Add support for JSON bean mutation detection via HASH and SOURCE of JSON string content #2274

Merged
merged 27 commits into from
Jul 30, 2021

Commits on Jul 23, 2021

  1. JSON bean dirty detection via MD5 of JSON string content

    - MD5 of json content stored on EntityBeanIntercept for dirty detection
    - Only convert to JSON once (at dirty detection time). Store this json content on EntityBeanIntercept to later push to ScalarTypeJsonObjectMapper for bind
    
    Should consider alternative to extend BeanProperty rather than have these if blocks.
    rbygrave committed Jul 23, 2021
    Configuration menu
    Copy the full SHA
    6c262f1 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2021

  1. Configuration menu
    Copy the full SHA
    11eed4c View commit details
    Browse the repository at this point in the history
  2. Modify SqlBeanLoad to use readSet()

    Note that we don't need to use readSetIntercept() now as there is no property change listener support
    rbygrave committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    49b86d0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5e595ec View commit details
    Browse the repository at this point in the history
  4. some refactor and tidying

    rPraml committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    b497b86 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    eb70c7e View commit details
    Browse the repository at this point in the history
  6. Merge branch 'FOCONIS-feature/json-dirty-detection-md5' into feature/…

    …json-dirty-detection-md5
    rbygrave committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    11a047b View commit details
    Browse the repository at this point in the history
  7. Temporarily disable TestDbJson_Jackson3 updateIncludesJsonColumn_when…

    …_list_loadedAndNotDirtyAware()
    
        BeanState state = DB.getBeanState(found);
        assertThat(state.getChangedProps()).containsExactlyInAnyOrder("beanList");
        // this test fails, because we have a OmList instead of a GenericObject
        // TODO: Can/Should we enhance the @DbJson/@DbJsonB annotations with a property "dirtyDetection"
    rbygrave committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    d0270db View commit details
    Browse the repository at this point in the history
  8. Refactor move createMutableHash() method from ScalarType to BeanPrope…

    …rty / BeanPropertyJsonMapper
    rbygrave committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    94fb641 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    52fe3cf View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    92d7a75 View commit details
    Browse the repository at this point in the history
  11. Use scalarType.format(value) removing scalarType.jsonMapper(value)

    Remove scalarType.jsonMapper(value) as we can just use format(value) instead
    rbygrave committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    86483ff View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2021

  1. No effective change - format EntityBeanIntercept only

    Plus adjust timing on SqlQueryCancelTest
    rbygrave committed Jul 29, 2021
    Configuration menu
    Copy the full SHA
    8832bbc View commit details
    Browse the repository at this point in the history
  2. Use new @dbjson dirtyDetection and keepSource attributes

    - Bump ebean-annotation with new @dbjson dirtyDetection and keepSource attributes
    - Get those to BeanPropertyJsonMapper to chose MutableHash implementation
    - Modify MD5MutableHash to include check for isDirty()
    - EBasicJsonList needs keepSource=true to pass that test with oldValue
    rbygrave committed Jul 29, 2021
    Configuration menu
    Copy the full SHA
    5ad8e7e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2bc5d3d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    991c6d6 View commit details
    Browse the repository at this point in the history
  5. Change Checksum to use CRC32

    rbygrave committed Jul 29, 2021
    Configuration menu
    Copy the full SHA
    0d8e7c8 View commit details
    Browse the repository at this point in the history
  6. Add MutableValueNext to replace mutableContent such that hash compute…

    … is only done once
    
    Adds MutableValueInfo.nextDirty() to replace the isEqualToJson() method. The next is computed once and stored. BindablePropertyJsonUpdate makes the .mutableNext(propertyIndex) call to move the next MutableValueInfo and return the json content.
    rbygrave committed Jul 29, 2021
    Configuration menu
    Copy the full SHA
    c66d248 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    5aa8557 View commit details
    Browse the repository at this point in the history
  8. Use MutationDetection replacing dirtyDetection and keepSource

    Also adds NoMutationDetection to support NONE
    rbygrave committed Jul 29, 2021
    Configuration menu
    Copy the full SHA
    20becf9 View commit details
    Browse the repository at this point in the history
  9. Re-enable TestDbJson_Jackson3 via adding mutationDetection = HASH to …

    …beanList property
    
      @DbJsonB(mutationDetection = HASH)
      List<PlainBean> beanList;
    rbygrave committed Jul 29, 2021
    Configuration menu
    Copy the full SHA
    20e0eb1 View commit details
    Browse the repository at this point in the history
  10. Due to mutableNext handling, with checkMutableProperties() even when …

    …known dirty go into beanProperty.checkMutable()
    
    As per rPraml's PR and comment
    
    Due to handling of mutableNext we need  checkMutableProperties() to call into what is now beanProperty.checkMutable() even when we already know it's dirty.
    rbygrave committed Jul 29, 2021
    Configuration menu
    Copy the full SHA
    822fb73 View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2021

  1. Update TestDbJson_Jackson3

    rbygrave committed Jul 30, 2021
    Configuration menu
    Copy the full SHA
    c43e2e6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ea741d0 View commit details
    Browse the repository at this point in the history
  3. Fix when json/jackson bean inserted as null and not changed

    Expectation is that it is not included in update (still null, no change)
    rbygrave committed Jul 30, 2021
    Configuration menu
    Copy the full SHA
    ca1636f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7bd7640 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d9f7531 View commit details
    Browse the repository at this point in the history