How to combine heuristic and explicit type mapping #587
-
|
Hey I've checked the docs and saw this: https://docs.eclipsestore.io/manual/storage/legacy-type-mapping/index.html#explicit-mapping It claims you can combine the heuristic and the explicit type mapping. However, I couldn't find any examples. Initially I thought it would automatically apply the heuristic mapping, even if you provide an explicit mapping. I am also not 100% sure I provided the explicit mapping the right way. This is what I did: foundation.onConnectionFoundation( connectionFoundation -> {
connectionFoundation.setRefactoringMappingProvider(
PersistenceRefactoringMappingProvider.New( List.of(
KeyValue.New( "a", "b" )
) ) );
} );Upon starting with an older database, I get The reason I am trying to do this, is that the algorithm seems to have match two completely unrelated fields, which caused a start failure. It matched |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
|
We’re currently refactoring the documentation, maybe the next version will bit more readable, it is already in the project main branch: https://github.com/eclipse-store/store/blob/main/docs/modules/storage/pages/legacy-type-mapping/index.adoc It should be sufficient to define an explicit mapping only for the elements that the heuristic can’t handle correctly: KeyValue.New("org.example.MyClass#field1", " org.example.MyClass#field2")Ensure that you use the full class name! |
Beta Was this translation helpful? Give feedback.
-
|
Hm, i did provide full paths and no typos 🤔 Our concrete case is this btw: Version 1: Has field When updating directly from 1 to 3, it matches Or is there a way to configure the required similarity factor? |
Beta Was this translation helpful? Give feedback.
-
|
Ah, i did it!, didn't realize i had to call |
Beta Was this translation helpful? Give feedback.
We’re currently refactoring the documentation, maybe the next version will bit more readable, it is already in the project main branch: https://github.com/eclipse-store/store/blob/main/docs/modules/storage/pages/legacy-type-mapping/index.adoc
It should be sufficient to define an explicit mapping only for the elements that the heuristic can’t handle correctly:
Ensure that you use the full class name!