Last active
April 6, 2021 12:12
-
-
Save kauanmocelin/d0f4ce102d7ee5b1c7c0c07353113bb5 to your computer and use it in GitHub Desktop.
[Retornar campos específicos HQL] Como retornar somente alguns campos em consultas HQL #hibernate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sbQuery.append(" SELECT DISTINCT referenciaPagamento as referenciaPagamento, "); | |
sbQuery.append(" contrato as contrato, orgao as orgao, fornecedor as fornecedorObj, SUM(pagamentoDocFiscal.valorDocumento) as valorTotalDocumentosPrevisaoPagamento "); | |
sbQuery.append(" FROM ReferenciaPagamento referenciaPagamento "); | |
query = session.createQuery(sbQuery.toString()); | |
query.setResultTransformer(new AliasToBeanResultTransformer(ReferenciaPagamentoDTO.class)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment