Announcement Announcement Module
No announcement yet.
composite primary key and autogenerated field Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • composite primary key and autogenerated field

    Hi friends,

    I have this configuration....

    @SequenceGenerator(name="SEQ_PATINMOBILIARIO", sequenceName="PATINMOBILIARIO_ID")
    public class PatInmobiliario_PK implements Serializable{
    	private int codigo;
    	private int declaracion;
    	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_PATINMOBILIARIO")
    	public int getCodigo() {
    		return codigo;
    	public void setCodigo(int codigo) {
    		this.codigo = codigo;
    	public int getDeclaracion() {
    		return declaracion;
    	public void setDeclaracion(int declaracion) {
    		this.declaracion = declaracion;
    public class PatInmobiliario {
    	private PatInmobiliario_PK clave;
    	private String descripcion;
    	public PatInmobiliario_PK getClave(){
    		return clave;
    	public void setClave(PatInmobiliario_PK patInmobiliario_PK){
    		this.clave = patInmobiliario_PK;
    	public String getDescripcion() {
    		return descripcion;
    	public void setDescripcion(String descripcion) {
    		this.descripcion = descripcion;
    I read that is possible this configuration in hibernate but the codigo always have the value 0. point Partial identifier generation.

    I'm using Oracle 11g, spring 2.5.6.SEC02, hibernate 3.2 and jboss 4.0.3SP1.

    Thanks a lot!

  • #2
    The following post may help. In particular, setting the database type and Hibernate dialect.