【发布时间】:2020-05-18 08:30:38
【问题描述】:
@Entity
@Table(name = "profiles")
data class Profile(
@Id
@GeneratedValue(generator = "UUID")
@GenericGenerator(
name = "UUID",
strategy = "org.hibernate.id.UUIDGenerator"
)
@Column(name = "id", updatable = false, nullable = false)
val id: UUID,
@Column(name = "first_name")
var firstName: String? = null,
@Column(name = "last_name")
var lastName: String? = null,
@Column(name = "phones")
var phones: String? = null
}
在 Postgres 中具有表配置文件并具有列“电话”=> 字符变化 [](数组) 如何设置类型来更新和插入数据?
如果我设置 List 或 Array ArrayList 会有错误:
org.postgresql.util.PSQLException: ERROR: column "phones" is of type character varying[] but expression is of type character varying
Hint: You will need to rewrite or cast the expression.
【问题讨论】:
标签: spring postgresql jpa kotlin psql