You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Pinaki Poddar (JIRA)" <ji...@apache.org> on 2008/08/29 18:58:44 UTC
[jira] Reopened: (OPENJPA-697) @VersionColumns annotation throws
exception when multiple columns are specified
[ https://issues.apache.org/jira/browse/OPENJPA-697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pinaki Poddar reopened OPENJPA-697:
-----------------------------------
A relevant use case for multi-column versioning is setting version columns across primary and secondary tables. The version strategy and schema definition does not address the case where the columns are spread across multiple tables.
> @VersionColumns annotation throws exception when multiple columns are specified
> -------------------------------------------------------------------------------
>
> Key: OPENJPA-697
> URL: https://issues.apache.org/jira/browse/OPENJPA-697
> Project: OpenJPA
> Issue Type: Bug
> Components: jpa
> Affects Versions: 1.2.0
> Reporter: Dinkar Rao
> Assignee: Pinaki Poddar
> Priority: Minor
> Fix For: 1.3.0
>
>
> 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 error>
> org.apache.openjpa.util.MetaDataException: For "entities.Employee<version>", expected 1 column(s),
> but found 2."
> @Entity
> @VersionColumns({@VersionColumn(name="vcol1"),@VersionColumn(name="vcol2")})
> @SecondaryTable(name="EADDRESS", pkJoinColumns=@PrimaryKeyJoinColumn(name="EMPID"))
> public class Employee {
> @Id @GeneratedValue(strategy=GenerationType.AUTO)
> private int empid;
> private String name;
>
> @Column(table="EADDRESS")
> private String street1;
> @Column(table="EADDRESS")
> private String street2;
> @Column(table="EADDRESS")
> private String city;
> @Column(table="EADDRESS")
> private int zipcode;
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.