openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maria Jurcovicova (Created) (JIRA)" <>
Subject [jira] [Created] (OPENJPA-2125) Default join table name does not follow JPA v2 specification
Date Fri, 10 Feb 2012 12:52:59 GMT
Default join table name does not follow JPA v2 specification

                 Key: OPENJPA-2125
             Project: OpenJPA
          Issue Type: Bug
          Components: jdbc, jpa
    Affects Versions: 2.1.1
            Reporter: Maria Jurcovicova

According to JPA v2 specification, two types of relationship use join table to keep relational
* many-to-many described in page 48,
* unidirectional one-to-many described in page 50.

In both cases, the joining table name should be composed from entity names (e.g. class names)
by default. OpenJPA uses entity table names by default.

Quote from JPA v2 specification:
"Entity A is mapped to a table named A. 
Entity B is mapped to a table named B. 

There is a join table that is named A_B (owner name first). The join table has ..."

Example entities:
public class MtmOwner {
  private long id;
  private String name;
  private Collection<MtmInverse> inverses = new ArrayList<MtmInverse>();
public class MtmInverse{
  private long id;
  private Map<String, MtmOwner> owners = new HashMap<String, MtmOwner>();

Expected join table name: MtmOwner_MtmInverse
OpenJPA join table name:  tblMtmOwner_MtmInverse

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message