reset password
Author Message
jyotsnam
Posts: 1
Posted 19:06 Mar 08, 2015 |

Hi Professor,

I added @OrderColumn  to runways and stages(Many to many) for ordering runways and stages to avoid getting the edited runway/stage(s) at the end.

However, while saving the runway/stage I get an error stating that the orderColumn violates not-null constraint.

Any suggestions please.

 

cysun
Posts: 2935
Posted 09:04 Mar 09, 2015 |

If you have bidirectional association on stages/runways, read Section 2.4.6.2.1. Bidirectional association with indexed collections in the Hibernate Annotations Reference Guide - it's rather tricky.

If you have unidirectional association, it should be pretty straightforward. Obviously the order column cannot be null and that's what the error message said.