openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Dirichs (JIRA)" <>
Subject [jira] Created: (OPENJPA-1059) Unnecessary creation of OPENJPA_SEQUENCE_TABLE for embeddable classes
Date Mon, 04 May 2009 18:00:30 GMT
Unnecessary creation of OPENJPA_SEQUENCE_TABLE for embeddable classes

                 Key: OPENJPA-1059
             Project: OpenJPA
          Issue Type: Bug
          Components: jdbc
    Affects Versions: 1.2.1, 2.0.0
            Reporter: Martin Dirichs
            Priority: Minor

Using OpenJPA with all identity values generated by the datastore does not
trigger the creation of OPENJPA_SEQUENCE_TABLE. However, as soon as a
embeddable class is used, this table is being created although embeddable
classes do not have a persistent identity on their own.

import javax.persistence.*;

public class MainEntity {
    @Id @GeneratedValue(strategy = GenerationType.IDENTITY)
    int id;

    EmbeddedClass e; // Referencing the embedded class yields the bug

import javax.persistence.*;

public class EmbeddedClass {

    String someValue;

<persistence xmlns=""
    <persistence-unit name="showcase">

Running org.apache.openjpa.jdbc.meta.MappingTool for the above
two classes results in the creation of OPENJPA_SEQUENCE_TABLE.
This is not the case if the reference to the embedded class is removed
from MainEntity.

According to Micheal Dick, there might be some use case where this
behaviour is desired. However, since the sequence table is used to
generate id values and embeddable classes have no id fields at all,
it seems more likely to be a bug. See here for the mailing list discussion:

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message