我正在尝试使用此类字段创建表,但是我不知道如何在postgresql中使用类型映射添加字段(名称和网址)
public class RequestToPlanfix {
private String cmd;
private String providerId;
private String channel;
private String chatId;
private String planfix_token;
private String message;
private String title;
private String contactId;
private String contactName;
private String contactLastName;
private String contactIco;
private String contactEmail;
private String contactPhone;
private String contactData;
@Convert(converter = Attachments.class)
private Map<String,String> name;
@Convert(converter = Attachments.class)
private Map<String,String> url;
private Boolean isEcho;
CREATE TABLE "requestToPlanfix" (
id SERIAL UNIQUE PRIMARY KEY ,
cmd TEXT NOT NULL,
providerId TEXT NOT NULL,
channel TEXT NOT NULL,
chatId TEXT NOT NULL,
planfix_token TEXT NOT NULL,
message TEXT NOT NULL,
title TEXT NOT NULL,
contactId TEXT NOT NULL,
contactName TEXT NOT NULL,
contactLastName TEXT NOT NULL,
contactIco TEXT NOT NULL,
contactEmail TEXT NOT NULL,
contactPhone TEXT NOT NULL,
contactData TEXT NOT NULL,
name
url
)
也就是说,我不知道如何将类型字段写为地图的名称,URL,例如cmd文本不为空