I have a hibernate entity Super Class:
@MappedSuperclass
public abstract class Pojo_Entity_SuperClass
{
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="ID", unique=true, nullable=false, precision=18, scale=0)
protected long id;
public Long getId() {return id;}
//Other entity fields and methods
}
Next I inherite other entity classes like this:
@Entity
@Table(name="USR")
public class Usr extends Pojo_Entity_SuperClass
{
//Columns, fileds and others
}
But in some cases I want to inherit entity with "id" field without @GeneratedValue annotation. The question is - how to disable @GeneratedValue annotation for id in child class ?