openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dinkar Rao <>
Subject @VersionColumns usage
Date Wed, 20 Aug 2008 18:36:52 GMT


The OpenJPA manual very briefly talks about the @VersionColumns annotation,
but its usage is not clear. I have an entity that tries to use this
annotation (below), but I get back an exception when I run the mapping tool
against it:

"Exception in thread "main" <openjpa-1.3.0-SNAPSHOT-runknown fatal user
org.apache.openjpa.util.MetaDataException: For "entities.Employee<version>",
expected 1 column(s),
but found 2."

1. What is the correct usage for @VersionColumns ?
2. Is it to be used when the underlying database supports multiple surrogate
version columns for the same table ? Or...
3. it to be used in conjunction with secondary tables, where the
primary and each secondary table have their own database-generated surrogate
version column ? In the snippet below, it doesn't matter whether I have the
@SecondaryTable annotation or not - I get the exception from the mapping
tool anyway.


public class Employee {
	@Id @GeneratedValue(strategy=GenerationType.AUTO)
	private int empid;
	private String name;
	private String street1;
	private String street2;
	private String city;
	private int zipcode;
View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message