Hi All,
I have the following entities:
Code:
public abstract class InformacaoFinanceira{...}
public class ContaBanco extends InformacaoFinanceira{...}
public class ContaCartao extends InformacaoFinanceira{...}
I'm using table-per-hierarchy mapping strategy.
So I have the following entity that has a relationship with InformacaoFinanceira:
Code:
public class Fatura {
...
@OneToOne(cascade={ CascadeType.PERSIST, CascadeType.MERGE }, fetch=FetchType.LAZY)
@JoinColumn(name="INFORMACAO_FINANCEIRA_ID")
private InformacaoFinanceira informacaoFinanceira;
...
}
Well, what I want is create a criteria on Fatura where the informacaoFinanceira is of ContaBanco type sorting by a field of ContaBanco.
Is there a way to do this using Criteria? How?
Thanx