I know that using Hibernate Dynamic Instantiation I can instantiate an object according to a constructor.
The Problem: I need to optimize the system as much as I can, and I'm done creating 5+ constructors in the same class.
I want to know if it is possible to use the Factory standard together with Dynamic Instantiation.
Current HQL select new br.com.domain.dto.SolicitacaoDTO(s.id, s.beneficiario.nome, s.dataRegistro, s.statusSolicitacao) from Solicitacao s
If you could use the Factory default
select new br.com.factory.dto.SolicitacaoDTO.consulta(s.id, s.beneficiario.nome, s.dataRegistro, s.statusSolicitacao) from Solicitacao s
If you have any suggestions on how to solve this problem otherwise, I'm open to suggestions or corrections.