'How to update entries in a database created by spring and jpa
i'm supposed to version the records in a database by year. so if i get a new file from the year 2023 the entries should be changed according to the year. i'm not finding anything useful to versioning data. in most cases, they use timestamps.but i'm not supposed to version the data by a specific timestemp but by the year the data is from. the data can be changed each year and according to the year the records should be modified.
i'm working on java with jpa, spring boot, spring web, h2 database and spring batch
Solution 1:[1]
Below option may be useful.
- When you save the timestamp, then whenever required you can fetch and extract year part from the timestamp, ignore other components of the timestamp (day, month, time) and use it in comparison against year.
- You can add additional customized column to store year.
Solution 2:[2]
If the sensor supports I2C, you should be able to use the builtin MicroPython I2C support.
I also found a library for the SHT3x, by searching on the MicroPython forum.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Crack_it |
| Solution 2 | nekomatic |
