for cmr collection field, i learnt from somewhere in mock question saying that we have to use an empty Collection/Set as the argument in stead of null, in order to de-associate the movies with the director, is that correct? director 1 ------ 0..* movie
posted 12 years ago
Hi Yi, Answer to your question is in section 10.3.8 on p. 155 of the specifications :
It is the responsibility of the Container to raise the java.lang.IllegalArgumentException if the Bean Provider attempts to assign null as the value of a collection-valued cmr-field by means of the set accessor method.
To clear one director's movies, I'd simply call getMovies().clear(). Regards, Phil.