Hi,
I have a simple model as follow :
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@Table(name = "cfs_document", uniqueConstraints = @UniqueConstraint(columnNames = { "uuid" }))
@SecondaryTable(name = "cfs_doc_access", pkJoinColumns = @PrimaryKeyJoinColumn(name = "doc_id", referencedColumnName = "id"))
@XmlRootElement
@ClassExtractor(value = DocumentClassExtractor.class)
// @Customizer(DocumentCustomizer.class)
public class Document extends DocumentVO
{
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "parent_id", table = "cfs_doc_access")
@JoinFetch(JoinFetchType.OUTER)
private Document parent;
}
after I run this query
select d from Document d where d.id in :ids and d.parent is not null
it produces this sql with 4 INNER JOIN of same tables how eclipselink do that?! which I assume is not correct
SELECT * FROM cfs_doc_access t3,
cfs_document t2, cfs_doc_access t1, cfs_document t0 WHERE ((((t2.id IN (?)) AND NOT ((t3.parent_id IS NULL)))
AND (t3.doc_id = t2.id)) AND ((t0.id = t3.parent_id) AND (t1.doc_id = t0.id)))
is this a bug ?