Hi Users,
I've configured the following List in my Entity:
Code:
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinTable(name="KW_TARGET_OPERATION_TEMPLATE_XREF", joinColumns={ @JoinColumn(name = "TARGET_OPERATION_ID") }, inverseJoinColumns={ @JoinColumn(name="TEMPLATE_ID", referencedColumnName="TARGETING_TEMPLATE_ID") })
@GenericGenerator(name="TARGET_OPERATION_TEMPLATE_XREF_GENERATOR", strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator", parameters = {@Parameter(name = "sequence_name", value = "KOBE_MART_TBLS.KW_TARGET_OPERATION_TEMPLATE__TARGET_OPERATION_TEMPLATE_XRE_SEQ")})
@CollectionId(columns = @Column(name = "TARGET_OPERATION_TEMPLATE_XREF_ID"), type = @Type(type = "long"), generator = "TARGET_OPERATION_TEMPLATE_XREF_GENERATOR")
private List<TargetingTemplateVO> templates = new ArrayList<TargetingTemplateVO>();
Now, when implementing a simple equals (with special care for the id) I fail on the templates List as the List
returns as a PersistentIdentiferBag which does not override equals..
This looks very common to me but I did not find any blog posting on this.
What am I missing?
Thanks a lot,
David