[jboss-user] [EJB 3.0] - Re: Composite Primary Keys - org.hibernate.AnnotationExcepti

mrodrigues do-not-reply at jboss.com
Thu Nov 9 18:44:36 EST 2006


Hi there, I solve it this way.

I hope it could be useful.

Best regards,
Mário Rodrigues

@Entity
@IdClass(RegistoPontoRondaPK.class)
public class RegistoPontoRonda {
        ........ fileds declaration

	@Id public Date getData() { return data; }
	@Id public long getTurno_id() { return turno_id; }
	@Id public long getPonto_id() { return ponto_id; }

        ........ getters and setters

}

@Embeddable
class RegistoPontoRondaPK implements Serializable { 
	private Date			data;
	private long			turno_id;
	private long			ponto_id;
	
        ........ getters and setters

}



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984690#3984690

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984690




More information about the jboss-user mailing list