[hibernate-issues] [Hibernate-JIRA] Created: (JPA-16) duplicated id column when abstract id methods are defined in a @MappedSuperclass

Constantino Cronemberger (JIRA) noreply at atlassian.com
Thu Jun 16 10:38:24 EDT 2011


duplicated id column when abstract id methods are defined in a @MappedSuperclass
--------------------------------------------------------------------------------

                 Key: JPA-16
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/JPA-16
             Project: Java Persistence API
          Issue Type: Bug
         Environment: Database H2, Hibernate 3.6.4.Final
            Reporter: Constantino Cronemberger
            Priority: Minor


The following classes:

@MappedSuperclass
public abstract class BaseEntity {
    public abstract Long getId();

    public abstract void setId(Long id);
}

@Entity
@Table(name="STCB")
public class SimpleTestClassB extends BaseEntity {
    
    private Long primaryKey;
    
    @Override
    @Id
    @Column(nullable = false, precision = 10, name = "sb_id")
    public Long getId() {
        return primaryKey;
    }

    @Override
    public void setId(Long primaryKey) {
        this.primaryKey = primaryKey;
    }
}

will generate the following table:

create table STCB (sb_id number(19,0) not null, id number(19,0), primary key (sb_id));


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list