简体   繁体   English

如何在 postgresql 中存储 Arraylist 数据

[英]How to store Arraylist data in postgresql

I am trying to write Arraylist<String> to postgresql.我正在尝试将Arraylist<String>写入 postgresql。 but getting below error.但低于错误。

ERROR: column "data" is of type character varying[] but expression is of type bytea
  Hint: You will need to rewrite or cast the expression.

If someone knows which data type i should use for column to store arraylist content in postgresql?如果有人知道我应该使用哪种数据类型作为列在 postgresql 中存储数组列表内容?

Thanks谢谢

Are you using JPA, Spring Data?您在使用 JPA、Spring Data 吗?

Have you looked up for @ElementCollection ?您是否查找过@ElementCollection I think it's gonna be helpful.我认为它会有所帮助。

Java JPA ElementCollection Doc Java JPA ElementCollection 文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM