]
Constantino Cronemberger commented on JPA-16:
---------------------------------------------
The workaround is simple: create a super class (not annotated with @MappedSuperclass) for
BaseEntity and move the declaration of the abstract methods to this class.
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: