I'm having a difficulty. I want to modify an attribute's data type from String to Array.
In the preceding one, I want to convert targetMarket from String to Array without affecting its name.{ “id”: “trn:tarb:tradingpartner:uuid:00000464-fa72-49fe-b050-c4bf1cfd8259”, “partnerNumber”: “1098981”, “partnerName”: "AFLO ", “currencyCode”: “GBP”, “commercialPartnerStatus”: “Inactive”, “source”: { “id”: “STV0001$$”, “name”: “QS” }, “corpCode”: “DR”, “subCorpCode”: “001”, “targetMarket”: “UK” }
The issue is with the old data, which is in string format, and if I alter the attribute in java, I receive an error while retrieving data from the database. It cannot automatically cast from string to ArrayList. I saw a method on this page but I'm confused is it compatible here or not? https://www.scaler.com/topics/string-to-array-in-java/“targetMarket”:[ “UK”, “IN” ]
As a result, I must first change the old data before changing the java code. It is also acceptable if data is null or removed after changing the object from string to array.