I found via "search" many other guys with the same problem but always without any reasonable approach.
I try to get a JPA property value generated by a sequence, which is defined on a oracle10g db.
I have a property:
Code:
@Column(name = "LEISTUNG_NR_QUELLSYSTEM", insertable = false, updatable = true, nullable = false, precision = 12, scale = 0)
@SequenceGenerator(name="LST_NR_QU_SYS_GEN", sequenceName="CIS_LSLDPLLST_LSTNRQUSYS_SEQ")
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="LST_NR_QU_SYS_GEN")
public long getLeistungNrQuellsystem() {
return this.leistungNrQuellsystem;
}
and the appropriate sequence on the db:
Code:
CREATED 12.11.08
LAST_DDL_TIME 12.11.08
SEQUENCE_OWNER CRDE_ERFASSUNG
SEQUENCE_NAME CIS_LS_LEIST_LEISTNR_SEQ
MIN_VALUE 1
MAX_VALUE 999999999999999999999999999
INCREMENT_BY 1
CYCLE_FLAG N
ORDER_FLAG N
CACHE_SIZE 0
LAST_NUMBER 1
but it is unfortunately not working. The property left "null".
I know that it is basically possible with Hibernate but in case of JPA I'm not sure.
Is there a serious solution or is it simply impossible?
I'm a using Eclipse 3.3.2, ejb3-persistence.jar, Oracle10g, ojdbc14.jar, JDK 1.5.0_14
Mario