-
Notifications
You must be signed in to change notification settings - Fork 39
Feature/finished/iia 1602 write to database and autosave temp bug fix #323
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
Feature/finished/iia 1602 write to database and autosave temp bug fix #323
Conversation
…mit-Data-in-database-for-Component-ComponentList-and-ComponentSet
…ished/IIA-1367-Implement-Capability-to-Submit-Data-in-database-for-Component-ComponentList-and-ComponentSet # Conflicts: # kview/src/main/java/dev/ikm/komet/kview/mvvm/view/genediting/SemanticFieldsController.java
…ished/IIA-1367-Alternate-approach-Implement-Capability-to-Submit-Data-in-database # Conflicts: # kview/src/main/java/dev/ikm/komet/kview/mvvm/view/genediting/SemanticFieldsController.java
Feature/finished/iia 1456: Exception Triggered when we click on "Tink…
…ished/IIA-1367-Alternate-approach-Implement-Capability-to-Submit-Data-in-database
Sync with main
Sync with main.
sync with main
Sync with main
…ished/IIA-1367-Alternate-aproach-autosave-and-retrive # Conflicts: # kview/src/main/java/dev/ikm/komet/kview/klfields/KlFieldHelper.java # kview/src/main/java/dev/ikm/komet/kview/mvvm/view/genediting/GenEditingDetailsController.java # kview/src/main/java/dev/ikm/komet/kview/mvvm/view/genediting/SemanticFieldsController.java
Sync with main
Feature/finished/iia 1279 score order search matching (#312)
Feature/finished/iia 1279 score order search matching (#312)
Sync with Main
Sync with main
…ished/IIA-1367-Alternate-aproach-autosave-and-retrive # Conflicts: # kview/src/main/java/dev/ikm/komet/kview/mvvm/view/genediting/SemanticFieldsController.java
Sync with main.
…ished/IIA-1602-writeToDatabase-and-autosave-temp-bug-fix # Conflicts: # kview/src/main/java/dev/ikm/komet/kview/mvvm/view/genediting/SemanticFieldsController.java
dholubek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had a couple comments for adding javadocs to public methods
| } | ||
|
|
||
| public static int calculteHashValue(List<ObservableField<?>> observableFieldsList ) { | ||
| StringBuilder stringBuilder = new StringBuilder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have a brief javadoc for this method?
| return observableFields.get(fieldRecord.fieldIndex()); | ||
| ImmutableList<ObservableSemanticVersion> observableSemanticVersionImmutableList = observableSemanticSnapshot.getHistoricVersions(); | ||
| if(uncommitted || observableSemanticVersionImmutableList == null || observableSemanticVersionImmutableList.isEmpty()){ | ||
| //Get the latest version which is uncommited version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we put spaces before after the if condition and the else keyword like this:
if (uncommited) {
} else {
instead of
if(uncommited){
}else{
| return entityVersionLatest.get(); | ||
| } | ||
|
|
||
| public static int calculteHashValue(List<ObservableField<?>> observableFieldsList ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also include the Semantic's reference component's publicId?
My reasoning: During create (new Semantic) the user can change the reference component. the hash is stating any change. By default a reference component during created would be TinkarTerms.ANONOUMOUS_CONCEPT (I can't remember).
framework/src/main/java/dev/ikm/komet/framework/observable/ObservableField.java
Show resolved
Hide resolved
| public static int calculteHashValue(List<ObservableField<?>> observableFieldsList ) { | ||
| StringBuilder stringBuilder = new StringBuilder(); | ||
| observableFieldsList.forEach(observableField -> { | ||
| stringBuilder.append(observableField.valueProperty().get().toString()).append("|"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe out of scope for this issue but we might want to be careful and not just use toString for complex values like IntIdSet and IntIdList but actually iterate through those collections (when that's the case) and do toString on each item. toString for those collections are usually really meant for debugging purposes, etc and not as a reliable source of how whether the list or set was changed. Example: a toString for a Set or List might return the same value for 2 different Sets or Lists when the only difference is the order that they have.
Bottomline toString for a complex object (IntIdSet or IntIdList) is not reliable as a way to know exactly what they contain. But again might be out of scope for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's good to know. But I think we can get away with it for now. I believe IntIdSet and List had aways provided a toString() to dump out an array representing all elements. To be more accurate I think iterating through each is technically better.
Another minor concern I have might be that as a user (in a String/Text) field typing that each keystroke would have to exercise this (expensive) validation code. Not sure if large fields could in fact appear slow.
Feature/finished/IIA-1557: component list for set AND IIA-1312: Imple…
…oDatabase-and-autosave-temp-bug-fix' into feature/finished/IIA-1602-writeToDatabase-and-autosave-temp-bug-fix
carldea
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks @swaroopsalvi !
This is a temp bug fix for wtireToDB / AutoSave.