Using JPA, I try to modify a persisted object for multilingual content, which means I need a composite key, with an id and a language. The id also needs to increment using a sequence (I'm using Oracle). How can it be done?
For the moment, I get a Contenu class:
@Entity
@Table(name = "CONTENUS")
public class Contenus implements java.io.Serializable {
private ContenusId id;
...
}
and a ContenusId class:
@Embeddable
public class ContenusId implements java.io.Serializable {
private Long id;
private String langue;
...
}
But this doesn't handle the incremental id. Any idea?