I'm new to Java related techniques, and I currently working on a SpringBoot Project, and I need to store a list of numbers, such as 'XXXXX':[1,2,3,4...]
, but the result is not what I want.
Here is my entity:
This is the repository class:
This is how I save the data in my project:
And this is the final result that the data store in the database:
I don't want data stored in such style, cause I may need to get time_slot_list
using connectio_id
. It would increase my program complexity. How could I fix it? If there is some information is ambiguity, please let me, I would fix that. Thanks in advance.
CodePudding user response:
There is no need to 'fix' something. It's the correct way to store a List for an entity in a relational database. Just take a look at database normalization. I understand that it might look unnecessary at first but this way is better to work with over all.