[ https://issues.apache.org/jira/browse/OPENJPA-1059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kevin Sutter updated OPENJPA-1059: ---------------------------------- Affects Version/s: 2.1.0 > Unnecessary creation of OPENJPA_SEQUENCE_TABLE for embeddable classes > --------------------------------------------------------------------- > > Key: OPENJPA-1059 > URL: https://issues.apache.org/jira/browse/OPENJPA-1059 > Project: OpenJPA > Issue Type: Bug > Components: jdbc > Affects Versions: 1.2.1, 2.0.0-M2, 2.1.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. > Example > ======= > MainEntity.java: > import javax.persistence.*; > @Entity > public class MainEntity { > @Id @GeneratedValue(strategy = GenerationType.IDENTITY) > int id; > @Embedded > EmbeddedClass e; // Referencing the embedded class yields the bug > } > EmbeddedClass: > import javax.persistence.*; > @Embeddable > public class EmbeddedClass { > String someValue; > } > META-INF/persistence.xml: > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > version="1.0"> > > MainEntity > EmbeddedClass > > > 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: > http://n2.nabble.com/OPENJPA_SEQUENCE_TABLE-created-unnecessarily-for-embeddable-classes-tc2787226.html -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira