OpenJPA 2.0.1, jdk1.6.0_23
I have a base entity with @Version field:
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class BasicEntity implements Serializable {
/*...some other fields...*/
@Version protected Integer rowVersion;
}
and a child entity :
@Entity()
public class ana_custom extends BasicEntity {
@Basic(optional=false) @Column(nullable=false)
private String name;
}
when I execute the query "select c from ana_custom c order by c.name" OpenJPA
execute the query:
SELECT t0.id, t0.rowVersion, t0.name
FROM ana_custom t0 ORDER BY t0.name ASC
and the OpenJPA executes the following query for each row:
SELECT t0.rowVersion
FROM ana_custom t0
WHERE t0.id = ? AND t0.id = ?
what is wrong ? any hint ?
Thank you