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.
精彩评论