[英]unchecked cast warning on Collection
我正在將一個 postgres array_agg 值映射到一個列表,但是我在 Unchecked cast: 'java.lang.Object' to 'java.util.Collection<java.lang.String> 下面收到一個警告,對此有什么解決辦法?
public UserDTO transformTuple(Object[] objects, String[] strings) {
List<String> roleList = new ArrayList<>((Collection<String>)objects[7]);
You need to create Custom Types so that your java application can map postgresql data type into your application, I assume you are using hibernate in this scenario so here is a reference link for further details.
您可以在這里查看其他鏈接參考
使用 Java arrays 插入、檢索和更新 PostgreSQL ZA3CBC3F9D0CE2F2C1554E1B671DD1
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.