Hi Heiko, <jpa spec p. 383>The following types are supported for version properties: int, Integer, short, Short, long,
Long, Timestamp. </jpa spec>
Try changing the type of the version field and see if that helps.If so, please file a JIRA to give an error message instead of a silent fail.
Thanks, Craig On May 20, 2009, at 2:10 AM, it-media.k...@daimler.com wrote:
Hello, I'm having an issue in openJPA 1.2.1 with a entity model as follows: @Entity @Table(name = "PARTNER", schema = "PART")@NamedQuery(name = "getPartner", query = "SELECT p FROM Partner p wherep.partKey = :partKey") public class Partner { @Id @Column(name = "PART_KEY") private BigDecimal partKey; @OneToMany(mappedBy = "partner", fetch = FetchType.LAZY) private List<PartnerRolle> rollen; } @Entity @Table(name = "PARTNERROLLE") public class PartnerRolle { @EmbeddedId private PartnerRolleKey key; @Version @Column(name = "VERSION") private BigDecimal version; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "PART_KEY") private Partner partner; } When I ask for a Partner and later on call getRollen(), in thecorresponding SELECT (prepstmt), the Column VERSION of PARTNERROLLE is NOT queried (not listed in the SELECT). When I remove the @Version annotation, it works corerctly, thus the VERSION is filled with the correct value. Itonly works as expected, when I do NOT set @Version to that column.I doubt this is correct behaviour, cause even though its a simple query, ALL annotated columns should be returned, whether or not they changed. Iwas relying on the return of the VERSION field and ran into aNullPointerException because the BigDecimal was not correctly instatiated.Any suggestion, even if it is "this is correct behaviour, because ..." would be appreciated. Thanx, Best regards, HeikoIf you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
Craig L Russell Architect, Sun Java Enterprise System http://db.apache.org/jdo 408 276-5638 mailto:craig.russ...@sun.com P.S. A good JDO? O, Gasp!
smime.p7s
Description: S/MIME cryptographic signature