开发者

JPA / OpenJPA Same value in all rows

I have a problem with OpenJPA

I try to read all rows from a table but the primary key has always a same value(value = 0)!?!?!?

for (Object o : em.createQuery("select x from AnnouncementsEntry x")
                .getResultList()) {
            //alway returns "0" in every row
                long id = ((AnnouncementsEntry) o).getEntryId();

my entry:

@Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    private Long entryId;
开发者_如何学运维


This is way old, but I'm fairly certain that the problem was how your Entities were enhanced. More than likely you used an eclipse plugin that has some problems.

To anyone else having this problem, please checkout the OpenJPA enhancement docs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜