About Question enthuware.oce-jpad.v6.2.548 :
Posted: Fri Mar 16, 2012 4:01 pm
I disagree with existing answers:
1) I selected option A as correct. Although it's not clear if the Employee is detached and sent via network, it's fine.
2) I disagree with option B, which says if Address marked as Embeddable, then Employee valid entity. To be a valid entity, Employee also must mark addr with @Embedded. Otherwise application will fail.
3) I selected option D as correct, because Employee in current state is invalid - Address is not a basic type (persistence provider does not know how to process by default), so to make it persistable we must give some idea to persistene provider, one of the possible ways - make Address serializable (we don't know it from question, but based on option A we can assume that Employee and Address will be serializable) and annotate with @Lob. Option D is more realistic than option B, because option B clearly invalid without mentioning @Embedded.
My choice is options A and D.
1) I selected option A as correct. Although it's not clear if the Employee is detached and sent via network, it's fine.
2) I disagree with option B, which says if Address marked as Embeddable, then Employee valid entity. To be a valid entity, Employee also must mark addr with @Embedded. Otherwise application will fail.
3) I selected option D as correct, because Employee in current state is invalid - Address is not a basic type (persistence provider does not know how to process by default), so to make it persistable we must give some idea to persistene provider, one of the possible ways - make Address serializable (we don't know it from question, but based on option A we can assume that Employee and Address will be serializable) and annotate with @Lob. Option D is more realistic than option B, because option B clearly invalid without mentioning @Embedded.
My choice is options A and D.