Beginner |
|
Joined: Wed Nov 19, 2008 8:25 am Posts: 46 Location: Saint Petersburg, Russian Federation
|
That's correct behavior. <composite-id> element defines a natural key, i.e. it's user responsibility to fill in the necessary properties before storing the object. I.e. if you have a not-null constraint on ACCSR_KEY column and don't fill that property at the java level you get an integrity violation exception and that's correct.
Solution is to fill all necessary values at the java code if you're using natural keys or switch to surrogate keys and generate them automatically.
|
|