Closed blonsky95 closed 4 years ago
So the new exercises have to be inserted as new, else they have an id. Solution - when exporting, only export the field hash map (which contains all the fields, no results, and no id) And then provide the Exercise class with a secondary constructor which can be called when importing exercises by only importing the fieldsHashMap object. In this constructor, get the Name and Description of the exercise, and then the hashmap itself.
Lets fuckin go that was a big success - autoid works in great sync with secondary constructor and the fields
Exactly that, add a method in ImportExportUtils which takes a File location and returns a List of Exercises to insert when received.