The 'originalRequest' field / property is of type PaymentRequest and it has a field / property called 'id'. ProcessedCheque and PaymentRequest have a ManyToOne mapping (ie there can be many ProcessedCheques for a given PaymentRequest). I'm using Hibernate / EJB3 annotations within a spring application that creates the SessionFactory using a Spring AnnotationSessionFactoryBean. The mapping for 'originalRequest' is :
Code:
@ManyToOne(fetch = FetchType.EAGER, cascade = {CascadeType.ALL})
@JoinColumn(name = "payment_request_id", nullable = false)
@NotNull(message = "{error.field.not_set}") @Valid
private PaymentRequest originalRequest;
...and as you can see, I'm using Hibernate Validator for my validation, both at the presentation and persistence layers.