Hi all,
I'm using Hibernate annotation to generate sequence number in Oracle 10g database, but i get this error message while trying to insert to the SubClass.
The error message like "SQL Error: 2289, SQLState: 42000 ORA-02289: the sequence does not exist". the sequence named "EBMS_MAX_CAPABILITY_SEQ" was found in DB.
The SuperClass like:
Code:
@MappedSuperclass
public abstract class IdEntity implements Serializable{
protected Long id;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
//@GeneratedValue(strategy = GenerationType.IDENTITY)
//@GeneratedValue(generator = "system-uuid")
//@GenericGenerator(name = "system-uuid", strategy = "uuid")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
}
The Subclass like:
Code:
@Entity
@Table(name = "TM_SGM_MAX_CAPABILITY")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@AttributeOverride( name="id", column = @Column(name="MAX_CAPABILITY_ID",insertable=false,updatable=false) )
//@SequenceGenerator(name="myStrategy",sequenceName="EBMS_MAX_CAPABILITY_SEQ")
//@GeneratedValue(strategy = GenerationType.SEQUENCE,generator="myStrategy")
public class MaxCapability extends IdEntity{
.............
@Id
@SequenceGenerator(name="MY_SEQ",sequenceName="EBMS_MAX_CAPABILITY_SEQ")
@GeneratedValue(strategy = GenerationType.SEQUENCE,generator="MY_SEQ")
//@Column( name="MAX_CAPABILITY_ID")
//@Override
//public Long getId() {
// return id;
//}
.............
}
When i created a sequence named "hibernate_sequence", the program works well. As we known, the default sequence is "hibernate_sequence". Now my concern problem is that it is there have any way to override the "hibernate_sequence" in SubClass?
Any idea? I sorry for any mistakes due to I'm still a newbie here. Anybody can help me to resolve this problem?
Thanks in advance!