最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

用Hibernate映射一个整数列表

SEO心得admin40浏览0评论
本文介绍了用Hibernate映射一个整数列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

类似于这样:

@Entity class A { List< Integer>磷; @OneToMany getP(...){..}; setP(...){..}; }

解决方案

使用@ElementCollection映射。请参阅文档

How can I map a list of integers in Hibernate?

Something like this:

@Entity class A{ List<Integer> p; @OneToMany getP(...){..}; setP(...){..}; }

解决方案

Use @ElementCollection mapping. See documentation

发布评论

评论列表(0)

  1. 暂无评论