Olá drsmachado,
Desculpa a amolação.
Eu tentei fazer assim:
public List<Empresa> getList() throws Exception {
Criteria criteria = this.getSessao().createCriteria(Empresa.class);
ProjectionList projList = Projections.projectionList();
projList.add(Projections.property("codigo"));
projList.add(Projections.property("nomeRazaoSocial"));
projList.add(Projections.property("cca"));
projList.add(Projections.property("dataCadastro"));
projList.add(Projections.property("tipoPessoa"));
projList.add(Projections.property("cpfCnpj"));
projList.add(Projections.property("rgInscricaoEstadual"));
projList.add(Projections.property("telefone"));
projList.add(Projections.property("telefoneCelular"));
projList.add(Projections.property("fax"));
projList.add(Projections.property("email"));
projList.add(Projections.property("website"));
projList.add(Projections.property("logoEmpresa"));
projList.add(Projections.property("endereco"));
criteria.setProjection(projList);
criteria.setResultTransformer(new AliasToBeanResultTransformer(Empresa.class));
return criteria.list();
}
Só que o sql gerado pelo hibernate logo após o retorno é este:
Hibernate:
select
this_.codigo as y0_,
this_.nome_razao_social as y1_,
this_.cca as y2_,
this_.data_cadastro as y3_,
this_.tipo_pessoa as y4_,
this_.cpf_cnpj as y5_,
this_.rg_inscricao_estadual as y6_,
this_.telefone as y7_,
this_.telefone_celular as y8_,
this_.fax as y9_,
this_.email as y10_,
this_.website as y11_,
this_.logo_empresa as y12_,
this_.endereco as y13_
from
empresa this_
Hibernate:
select
endereco0_.codigo as codigo9_22_,
endereco0_.bairro as bairro9_22_,
endereco0_.cep as cep9_22_,
endereco0_.complemento as compleme4_9_22_,
endereco0_.municipio as municipio9_22_,
endereco0_.numero as numero9_22_,
endereco0_.rua as rua9_22_,
endereco0_.tipo_da_residencia as tipo8_9_22_,
endereco0_.uf as uf9_22_,
comprador1_.codigo as codigo2_0_,
comprador1_.conjuge as conjuge2_0_,
comprador1_.conta as conta2_0_,
comprador1_.cpf as cpf2_0_,
comprador1_.data_nascimento as data3_2_0_,
comprador1_.email as email2_0_,
comprador1_.endereco as endereco2_0_,
comprador1_.estado_civil as estado5_2_0_,
comprador1_.grau_instrucao as grau6_2_0_,
comprador1_.nacionalidade as nacional7_2_0_,
comprador1_.naturalidade as naturali8_2_0_,
comprador1_.nome as nome2_0_,
comprador1_.nome_mae as nome10_2_0_,
comprador1_.nome_pai as nome11_2_0_,
comprador1_.renda_nao_comprovada as renda21_2_0_,
comprador1_.rg as rg2_0_,
comprador1_.sexo as sexo2_0_,
comprador1_.situacao_menor_idade as situacao13_2_0_,
comprador1_.telefone_celular as telefone14_2_0_,
comprador1_.telefone_para_recados as telefone15_2_0_,
comprador1_.telefone_residencial as telefone16_2_0_,
comprador1_.uf_naturalidade as uf17_2_0_,
comprador1_.usuario as usuario2_0_,
conjuge2_.codigo as codigo3_1_,
conjuge2_.cpf as cpf3_1_,
conjuge2_.data_casamento as data3_3_1_,
conjuge2_.data_nascimento as data4_3_1_,
conjuge2_.email as email3_1_,
conjuge2_.nacionalidade as nacional6_3_1_,
conjuge2_.nome as nome3_1_,
conjuge2_.nome_mae as nome8_3_1_,
conjuge2_.nome_pai as nome9_3_1_,
conjuge2_.profissao as profissao3_1_,
conjuge2_.regime_casamento as regime11_3_1_,
conjuge2_.rg as rg3_1_,
conjuge2_.telefone_celular as telefone12_3_1_,
conjuge2_.telefone_comercial as telefone13_3_1_,
conjuge2_.telefone_residencial as telefone14_3_1_,
rg3_.codigo as codigo18_2_,
rg3_.data_emissao as data2_18_2_,
rg3_.numero as numero18_2_,
rg3_.orgao_emissor as orgao4_18_2_,
rg3_.uf_rg as uf5_18_2_,
comprador4_.codigo as codigo2_3_,
comprador4_.conjuge as conjuge2_3_,
comprador4_.conta as conta2_3_,
comprador4_.cpf as cpf2_3_,
comprador4_.data_nascimento as data3_2_3_,
comprador4_.email as email2_3_,
comprador4_.endereco as endereco2_3_,
comprador4_.estado_civil as estado5_2_3_,
comprador4_.grau_instrucao as grau6_2_3_,
comprador4_.nacionalidade as nacional7_2_3_,
comprador4_.naturalidade as naturali8_2_3_,
comprador4_.nome as nome2_3_,
comprador4_.nome_mae as nome10_2_3_,
comprador4_.nome_pai as nome11_2_3_,
comprador4_.renda_nao_comprovada as renda21_2_3_,
comprador4_.rg as rg2_3_,
comprador4_.sexo as sexo2_3_,
comprador4_.situacao_menor_idade as situacao13_2_3_,
comprador4_.telefone_celular as telefone14_2_3_,
comprador4_.telefone_para_recados as telefone15_2_3_,
comprador4_.telefone_residencial as telefone16_2_3_,
comprador4_.uf_naturalidade as uf17_2_3_,
comprador4_.usuario as usuario2_3_,
conta5_.codigo as codigo4_4_,
conta5_.agencia as agencia4_4_,
conta5_.numero as numero4_4_,
conta5_.observacoes as observac4_4_4_,
conta5_.operacao as operacao4_4_,
conta5_.tipo as tipo4_4_,
vendedor6_.codigo as codigo21_5_,
vendedor6_.conjuge as conjuge21_5_,
vendedor6_.conta as conta21_5_,
vendedor6_.cpf as cpf21_5_,
vendedor6_.data_nascimento as data3_21_5_,
vendedor6_.email as email21_5_,
vendedor6_.endereco as endereco21_5_,
vendedor6_.estado_civil as estado5_21_5_,
vendedor6_.nacionalidade as nacional6_21_5_,
vendedor6_.nome as nome21_5_,
vendedor6_.nome_mae as nome8_21_5_,
vendedor6_.nome_pai as nome9_21_5_,
vendedor6_.profissao as profissao21_5_,
vendedor6_.rg as rg21_5_,
vendedor6_.sexo_vendedor as sexo11_21_5_,
vendedor6_.telefone_celular as telefone12_21_5_,
vendedor6_.telefone_comercial as telefone13_21_5_,
vendedor6_.telefone_residencial as telefone14_21_5_,
vendedor6_.usuario as usuario21_5_,
conjuge7_.codigo as codigo3_6_,
conjuge7_.cpf as cpf3_6_,
conjuge7_.data_casamento as data3_3_6_,
conjuge7_.data_nascimento as data4_3_6_,
conjuge7_.email as email3_6_,
conjuge7_.nacionalidade as nacional6_3_6_,
conjuge7_.nome as nome3_6_,
conjuge7_.nome_mae as nome8_3_6_,
conjuge7_.nome_pai as nome9_3_6_,
conjuge7_.profissao as profissao3_6_,
conjuge7_.regime_casamento as regime11_3_6_,
conjuge7_.rg as rg3_6_,
conjuge7_.telefone_celular as telefone12_3_6_,
conjuge7_.telefone_comercial as telefone13_3_6_,
conjuge7_.telefone_residencial as telefone14_3_6_,
endereco8_.codigo as codigo9_7_,
endereco8_.bairro as bairro9_7_,
endereco8_.cep as cep9_7_,
endereco8_.complemento as compleme4_9_7_,
endereco8_.municipio as municipio9_7_,
endereco8_.numero as numero9_7_,
endereco8_.rua as rua9_7_,
endereco8_.tipo_da_residencia as tipo8_9_7_,
endereco8_.uf as uf9_7_,
empresa9_.codigo as codigo8_8_,
empresa9_.cca as cca8_8_,
empresa9_.cpf_cnpj as cpf3_8_8_,
empresa9_.data_cadastro as data4_8_8_,
empresa9_.email as email8_8_,
empresa9_.endereco as endereco8_8_,
empresa9_.fax as fax8_8_,
empresa9_.logo_empresa as logo7_8_8_,
empresa9_.nome_razao_social as nome8_8_8_,
empresa9_.rg_inscricao_estadual as rg9_8_8_,
empresa9_.telefone as telefone8_8_,
empresa9_.telefone_celular as telefone11_8_8_,
empresa9_.tipo_pessoa as tipo12_8_8_,
empresa9_.usuario as usuario8_8_,
empresa9_.website as website8_8_,
usuario10_.codigo as codigo20_9_,
usuario10_.nome as nome20_9_,
usuario10_.perfil as perfil20_9_,
usuario10_.senha as senha20_9_,
usuario10_.status as status20_9_,
usuario10_.usuario as usuario20_9_,
perfil11_.codigo as codigo10_10_,
perfil11_.nome as nome10_10_,
procurador12_.codigo as codigo13_11_,
procurador12_.cartorio_procuracao as cartorio2_13_11_,
procurador12_.cpf as cpf13_11_,
procurador12_.data_procuracao as data4_13_11_,
procurador12_.email as email13_11_,
procurador12_.endereco as endereco13_11_,
procurador12_.estado_civil as estado6_13_11_,
procurador12_.folhas_procuracao as folhas7_13_11_,
procurador12_.livro_procuracao as livro8_13_11_,
procurador12_.nacionalidade as nacional9_13_11_,
procurador12_.nome as nome13_11_,
procurador12_.observacoes as observa11_13_11_,
procurador12_.profissao as profissao13_11_,
procurador12_.rg as rg13_11_,
procurador12_.telefone_celular as telefone13_13_11_,
procurador12_.telefone_comercial as telefone14_13_11_,
procurador12_.telefone_residencial as telefone15_13_11_,
procurador12_.vendedor as vendedor13_11_,
rg13_.codigo as codigo18_12_,
rg13_.data_emissao as data2_18_12_,
rg13_.numero as numero18_12_,
rg13_.orgao_emissor as orgao4_18_12_,
rg13_.uf_rg as uf5_18_12_,
vendedor14_.codigo as codigo21_13_,
vendedor14_.conjuge as conjuge21_13_,
vendedor14_.conta as conta21_13_,
vendedor14_.cpf as cpf21_13_,
vendedor14_.data_nascimento as data3_21_13_,
vendedor14_.email as email21_13_,
vendedor14_.endereco as endereco21_13_,
vendedor14_.estado_civil as estado5_21_13_,
vendedor14_.nacionalidade as nacional6_21_13_,
vendedor14_.nome as nome21_13_,
vendedor14_.nome_mae as nome8_21_13_,
vendedor14_.nome_pai as nome9_21_13_,
vendedor14_.profissao as profissao21_13_,
vendedor14_.rg as rg21_13_,
vendedor14_.sexo_vendedor as sexo11_21_13_,
vendedor14_.telefone_celular as telefone12_21_13_,
vendedor14_.telefone_comercial as telefone13_21_13_,
vendedor14_.telefone_residencial as telefone14_21_13_,
vendedor14_.usuario as usuario21_13_,
usuario15_.codigo as codigo20_14_,
usuario15_.nome as nome20_14_,
usuario15_.perfil as perfil20_14_,
usuario15_.senha as senha20_14_,
usuario15_.status as status20_14_,
usuario15_.usuario as usuario20_14_,
vendedor16_.codigo as codigo21_15_,
vendedor16_.conjuge as conjuge21_15_,
vendedor16_.conta as conta21_15_,
vendedor16_.cpf as cpf21_15_,
vendedor16_.data_nascimento as data3_21_15_,
vendedor16_.email as email21_15_,
vendedor16_.endereco as endereco21_15_,
vendedor16_.estado_civil as estado5_21_15_,
vendedor16_.nacionalidade as nacional6_21_15_,
vendedor16_.nome as nome21_15_,
vendedor16_.nome_mae as nome8_21_15_,
vendedor16_.nome_pai as nome9_21_15_,
vendedor16_.profissao as profissao21_15_,
vendedor16_.rg as rg21_15_,
vendedor16_.sexo_vendedor as sexo11_21_15_,
vendedor16_.telefone_celular as telefone12_21_15_,
vendedor16_.telefone_comercial as telefone13_21_15_,
vendedor16_.telefone_residencial as telefone14_21_15_,
vendedor16_.usuario as usuario21_15_,
rendacompr17_.codigo as codigo15_16_,
rendacompr17_.ano_desligamento_emprego_anterior as ano2_15_16_,
rendacompr17_.cargo as cargo15_16_,
rendacompr17_.cod_ir as cod4_15_16_,
rendacompr17_.comprador as comprador15_16_,
rendacompr17_.comprovante_renda as comprova5_15_16_,
rendacompr17_.data_inicio_renda as data6_15_16_,
rendacompr17_.data_ref_comprovante_renda as data7_15_16_,
rendacompr17_.descricao_ocupacao as descricao8_15_16_,
rendacompr17_.documento_fonte_pagadora as documento9_15_16_,
rendacompr17_.endereco as endereco15_16_,
rendacompr17_.fax as fax15_16_,
rendacompr17_.nome_fonte_pagadora as nome11_15_16_,
rendacompr17_.qtd_anos_emprego_anterior as qtd12_15_16_,
rendacompr17_.qtd_meses_emprego_anterior as qtd13_15_16_,
rendacompr17_.renda_bruta_mes as renda14_15_16_,
rendacompr17_.renda_liquida_mes as renda15_15_16_,
rendacompr17_.telefone_comercial as telefone16_15_16_,
rendacompr17_.tipo_fonte_pagadora as tipo17_15_16_,
rendacompr17_.valor_imposto_renda_retido as valor18_15_16_,
comprador18_.codigo as codigo2_17_,
comprador18_.conjuge as conjuge2_17_,
comprador18_.conta as conta2_17_,
comprador18_.cpf as cpf2_17_,
comprador18_.data_nascimento as data3_2_17_,
comprador18_.email as email2_17_,
comprador18_.endereco as endereco2_17_,
comprador18_.estado_civil as estado5_2_17_,
comprador18_.grau_instrucao as grau6_2_17_,
comprador18_.nacionalidade as nacional7_2_17_,
comprador18_.naturalidade as naturali8_2_17_,
comprador18_.nome as nome2_17_,
comprador18_.nome_mae as nome10_2_17_,
comprador18_.nome_pai as nome11_2_17_,
comprador18_.renda_nao_comprovada as renda21_2_17_,
comprador18_.rg as rg2_17_,
comprador18_.sexo as sexo2_17_,
comprador18_.situacao_menor_idade as situacao13_2_17_,
comprador18_.telefone_celular as telefone14_2_17_,
comprador18_.telefone_para_recados as telefone15_2_17_,
comprador18_.telefone_residencial as telefone16_2_17_,
comprador18_.uf_naturalidade as uf17_2_17_,
comprador18_.usuario as usuario2_17_,
rendanaoco19_.codigo as codigo17_18_,
rendanaoco19_.data_inicio_trabalho as data2_17_18_,
rendanaoco19_.local_trabalho as local3_17_18_,
rendanaoco19_.nome_atividade as nome4_17_18_,
rendanaoco19_.renda_liquida_mes as renda5_17_18_,
usuario20_.codigo as codigo20_19_,
usuario20_.nome as nome20_19_,
usuario20_.perfil as perfil20_19_,
usuario20_.senha as senha20_19_,
usuario20_.status as status20_19_,
usuario20_.usuario as usuario20_19_,
cestadeser21_.codigo as codigo22_20_,
cestadeser21_.comprador as comprador22_20_,
cestadeser21_.dia_do_debito as dia2_22_20_,
cestadeser21_.modalidade as modalidade22_20_,
solicitaca22_.codigo as codigo19_21_,
solicitaca22_.bandeira as bandeira19_21_,
solicitaca22_.comprador as comprador19_21_,
solicitaca22_.modalidade as modalidade19_21_,
solicitaca22_.tipo_cartao as tipo4_19_21_
from
endereco endereco0_
left outer join
comprador comprador1_
on endereco0_.codigo=comprador1_.endereco
left outer join
conjuge conjuge2_
on comprador1_.conjuge=conjuge2_.codigo
left outer join
rg rg3_
on conjuge2_.rg=rg3_.codigo
left outer join
comprador comprador4_
on rg3_.codigo=comprador4_.rg
left outer join
conta conta5_
on comprador4_.conta=conta5_.codigo
left outer join
vendedor vendedor6_
on conta5_.codigo=vendedor6_.conta
left outer join
conjuge conjuge7_
on vendedor6_.conjuge=conjuge7_.codigo
left outer join
endereco endereco8_
on vendedor6_.endereco=endereco8_.codigo
left outer join
empresa empresa9_
on endereco8_.codigo=empresa9_.endereco
left outer join
usuario usuario10_
on empresa9_.usuario=usuario10_.codigo
left outer join
perfil perfil11_
on usuario10_.perfil=perfil11_.codigo
left outer join
procurador procurador12_
on endereco8_.codigo=procurador12_.endereco
left outer join
rg rg13_
on procurador12_.rg=rg13_.codigo
left outer join
vendedor vendedor14_
on rg13_.codigo=vendedor14_.rg
left outer join
usuario usuario15_
on vendedor14_.usuario=usuario15_.codigo
left outer join
vendedor vendedor16_
on procurador12_.vendedor=vendedor16_.codigo
left outer join
renda_comprovada rendacompr17_
on endereco8_.codigo=rendacompr17_.endereco
left outer join
comprador comprador18_
on rendacompr17_.comprador=comprador18_.codigo
left outer join
renda_nao_comprovada rendanaoco19_
on comprador18_.renda_nao_comprovada=rendanaoco19_.codigo
left outer join
usuario usuario20_
on comprador18_.usuario=usuario20_.codigo
left outer join
cesta_de_servicos cestadeser21_
on comprador18_.codigo=cestadeser21_.comprador
left outer join
solicitacao_emissao_cartao solicitaca22_
on comprador18_.codigo=solicitaca22_.comprador
where
endereco0_.codigo=?
Hibernate:
select
empresa0_.codigo as codigo8_22_,
empresa0_.cca as cca8_22_,
empresa0_.cpf_cnpj as cpf3_8_22_,
empresa0_.data_cadastro as data4_8_22_,
empresa0_.email as email8_22_,
empresa0_.endereco as endereco8_22_,
empresa0_.fax as fax8_22_,
empresa0_.logo_empresa as logo7_8_22_,
empresa0_.nome_razao_social as nome8_8_22_,
empresa0_.rg_inscricao_estadual as rg9_8_22_,
empresa0_.telefone as telefone8_22_,
empresa0_.telefone_celular as telefone11_8_22_,
empresa0_.tipo_pessoa as tipo12_8_22_,
empresa0_.usuario as usuario8_22_,
empresa0_.website as website8_22_,
endereco1_.codigo as codigo9_0_,
endereco1_.bairro as bairro9_0_,
endereco1_.cep as cep9_0_,
endereco1_.complemento as compleme4_9_0_,
endereco1_.municipio as municipio9_0_,
endereco1_.numero as numero9_0_,
endereco1_.rua as rua9_0_,
endereco1_.tipo_da_residencia as tipo8_9_0_,
endereco1_.uf as uf9_0_,
comprador2_.codigo as codigo2_1_,
comprador2_.conjuge as conjuge2_1_,
comprador2_.conta as conta2_1_,
comprador2_.cpf as cpf2_1_,
comprador2_.data_nascimento as data3_2_1_,
comprador2_.email as email2_1_,
comprador2_.endereco as endereco2_1_,
comprador2_.estado_civil as estado5_2_1_,
comprador2_.grau_instrucao as grau6_2_1_,
comprador2_.nacionalidade as nacional7_2_1_,
comprador2_.naturalidade as naturali8_2_1_,
comprador2_.nome as nome2_1_,
comprador2_.nome_mae as nome10_2_1_,
comprador2_.nome_pai as nome11_2_1_,
comprador2_.renda_nao_comprovada as renda21_2_1_,
comprador2_.rg as rg2_1_,
comprador2_.sexo as sexo2_1_,
comprador2_.situacao_menor_idade as situacao13_2_1_,
comprador2_.telefone_celular as telefone14_2_1_,
comprador2_.telefone_para_recados as telefone15_2_1_,
comprador2_.telefone_residencial as telefone16_2_1_,
comprador2_.uf_naturalidade as uf17_2_1_,
comprador2_.usuario as usuario2_1_,
conjuge3_.codigo as codigo3_2_,
conjuge3_.cpf as cpf3_2_,
conjuge3_.data_casamento as data3_3_2_,
conjuge3_.data_nascimento as data4_3_2_,
conjuge3_.email as email3_2_,
conjuge3_.nacionalidade as nacional6_3_2_,
conjuge3_.nome as nome3_2_,
conjuge3_.nome_mae as nome8_3_2_,
conjuge3_.nome_pai as nome9_3_2_,
conjuge3_.profissao as profissao3_2_,
conjuge3_.regime_casamento as regime11_3_2_,
conjuge3_.rg as rg3_2_,
conjuge3_.telefone_celular as telefone12_3_2_,
conjuge3_.telefone_comercial as telefone13_3_2_,
conjuge3_.telefone_residencial as telefone14_3_2_,
rg4_.codigo as codigo18_3_,
rg4_.data_emissao as data2_18_3_,
rg4_.numero as numero18_3_,
rg4_.orgao_emissor as orgao4_18_3_,
rg4_.uf_rg as uf5_18_3_,
comprador5_.codigo as codigo2_4_,
comprador5_.conjuge as conjuge2_4_,
comprador5_.conta as conta2_4_,
comprador5_.cpf as cpf2_4_,
comprador5_.data_nascimento as data3_2_4_,
comprador5_.email as email2_4_,
comprador5_.endereco as endereco2_4_,
comprador5_.estado_civil as estado5_2_4_,
comprador5_.grau_instrucao as grau6_2_4_,
comprador5_.nacionalidade as nacional7_2_4_,
comprador5_.naturalidade as naturali8_2_4_,
comprador5_.nome as nome2_4_,
comprador5_.nome_mae as nome10_2_4_,
comprador5_.nome_pai as nome11_2_4_,
comprador5_.renda_nao_comprovada as renda21_2_4_,
comprador5_.rg as rg2_4_,
comprador5_.sexo as sexo2_4_,
comprador5_.situacao_menor_idade as situacao13_2_4_,
comprador5_.telefone_celular as telefone14_2_4_,
comprador5_.telefone_para_recados as telefone15_2_4_,
comprador5_.telefone_residencial as telefone16_2_4_,
comprador5_.uf_naturalidade as uf17_2_4_,
comprador5_.usuario as usuario2_4_,
conta6_.codigo as codigo4_5_,
conta6_.agencia as agencia4_5_,
conta6_.numero as numero4_5_,
conta6_.observacoes as observac4_4_5_,
conta6_.operacao as operacao4_5_,
conta6_.tipo as tipo4_5_,
vendedor7_.codigo as codigo21_6_,
vendedor7_.conjuge as conjuge21_6_,
vendedor7_.conta as conta21_6_,
vendedor7_.cpf as cpf21_6_,
vendedor7_.data_nascimento as data3_21_6_,
vendedor7_.email as email21_6_,
vendedor7_.endereco as endereco21_6_,
vendedor7_.estado_civil as estado5_21_6_,
vendedor7_.nacionalidade as nacional6_21_6_,
vendedor7_.nome as nome21_6_,
vendedor7_.nome_mae as nome8_21_6_,
vendedor7_.nome_pai as nome9_21_6_,
vendedor7_.profissao as profissao21_6_,
vendedor7_.rg as rg21_6_,
vendedor7_.sexo_vendedor as sexo11_21_6_,
vendedor7_.telefone_celular as telefone12_21_6_,
vendedor7_.telefone_comercial as telefone13_21_6_,
vendedor7_.telefone_residencial as telefone14_21_6_,
vendedor7_.usuario as usuario21_6_,
conjuge8_.codigo as codigo3_7_,
conjuge8_.cpf as cpf3_7_,
conjuge8_.data_casamento as data3_3_7_,
conjuge8_.data_nascimento as data4_3_7_,
conjuge8_.email as email3_7_,
conjuge8_.nacionalidade as nacional6_3_7_,
conjuge8_.nome as nome3_7_,
conjuge8_.nome_mae as nome8_3_7_,
conjuge8_.nome_pai as nome9_3_7_,
conjuge8_.profissao as profissao3_7_,
conjuge8_.regime_casamento as regime11_3_7_,
conjuge8_.rg as rg3_7_,
conjuge8_.telefone_celular as telefone12_3_7_,
conjuge8_.telefone_comercial as telefone13_3_7_,
conjuge8_.telefone_residencial as telefone14_3_7_,
endereco9_.codigo as codigo9_8_,
endereco9_.bairro as bairro9_8_,
endereco9_.cep as cep9_8_,
endereco9_.complemento as compleme4_9_8_,
endereco9_.municipio as municipio9_8_,
endereco9_.numero as numero9_8_,
endereco9_.rua as rua9_8_,
endereco9_.tipo_da_residencia as tipo8_9_8_,
endereco9_.uf as uf9_8_,
procurador10_.codigo as codigo13_9_,
procurador10_.cartorio_procuracao as cartorio2_13_9_,
procurador10_.cpf as cpf13_9_,
procurador10_.data_procuracao as data4_13_9_,
procurador10_.email as email13_9_,
procurador10_.endereco as endereco13_9_,
procurador10_.estado_civil as estado6_13_9_,
procurador10_.folhas_procuracao as folhas7_13_9_,
procurador10_.livro_procuracao as livro8_13_9_,
procurador10_.nacionalidade as nacional9_13_9_,
procurador10_.nome as nome13_9_,
procurador10_.observacoes as observa11_13_9_,
procurador10_.profissao as profissao13_9_,
procurador10_.rg as rg13_9_,
procurador10_.telefone_celular as telefone13_13_9_,
procurador10_.telefone_comercial as telefone14_13_9_,
procurador10_.telefone_residencial as telefone15_13_9_,
procurador10_.vendedor as vendedor13_9_,
rg11_.codigo as codigo18_10_,
rg11_.data_emissao as data2_18_10_,
rg11_.numero as numero18_10_,
rg11_.orgao_emissor as orgao4_18_10_,
rg11_.uf_rg as uf5_18_10_,
vendedor12_.codigo as codigo21_11_,
vendedor12_.conjuge as conjuge21_11_,
vendedor12_.conta as conta21_11_,
vendedor12_.cpf as cpf21_11_,
vendedor12_.data_nascimento as data3_21_11_,
vendedor12_.email as email21_11_,
vendedor12_.endereco as endereco21_11_,
vendedor12_.estado_civil as estado5_21_11_,
vendedor12_.nacionalidade as nacional6_21_11_,
vendedor12_.nome as nome21_11_,
vendedor12_.nome_mae as nome8_21_11_,
vendedor12_.nome_pai as nome9_21_11_,
vendedor12_.profissao as profissao21_11_,
vendedor12_.rg as rg21_11_,
vendedor12_.sexo_vendedor as sexo11_21_11_,
vendedor12_.telefone_celular as telefone12_21_11_,
vendedor12_.telefone_comercial as telefone13_21_11_,
vendedor12_.telefone_residencial as telefone14_21_11_,
vendedor12_.usuario as usuario21_11_,
usuario13_.codigo as codigo20_12_,
usuario13_.nome as nome20_12_,
usuario13_.perfil as perfil20_12_,
usuario13_.senha as senha20_12_,
usuario13_.status as status20_12_,
usuario13_.usuario as usuario20_12_,
perfil14_.codigo as codigo10_13_,
perfil14_.nome as nome10_13_,
vendedor15_.codigo as codigo21_14_,
vendedor15_.conjuge as conjuge21_14_,
vendedor15_.conta as conta21_14_,
vendedor15_.cpf as cpf21_14_,
vendedor15_.data_nascimento as data3_21_14_,
vendedor15_.email as email21_14_,
vendedor15_.endereco as endereco21_14_,
vendedor15_.estado_civil as estado5_21_14_,
vendedor15_.nacionalidade as nacional6_21_14_,
vendedor15_.nome as nome21_14_,
vendedor15_.nome_mae as nome8_21_14_,
vendedor15_.nome_pai as nome9_21_14_,
vendedor15_.profissao as profissao21_14_,
vendedor15_.rg as rg21_14_,
vendedor15_.sexo_vendedor as sexo11_21_14_,
vendedor15_.telefone_celular as telefone12_21_14_,
vendedor15_.telefone_comercial as telefone13_21_14_,
vendedor15_.telefone_residencial as telefone14_21_14_,
vendedor15_.usuario as usuario21_14_,
rendacompr16_.codigo as codigo15_15_,
rendacompr16_.ano_desligamento_emprego_anterior as ano2_15_15_,
rendacompr16_.cargo as cargo15_15_,
rendacompr16_.cod_ir as cod4_15_15_,
rendacompr16_.comprador as comprador15_15_,
rendacompr16_.comprovante_renda as comprova5_15_15_,
rendacompr16_.data_inicio_renda as data6_15_15_,
rendacompr16_.data_ref_comprovante_renda as data7_15_15_,
rendacompr16_.descricao_ocupacao as descricao8_15_15_,
rendacompr16_.documento_fonte_pagadora as documento9_15_15_,
rendacompr16_.endereco as endereco15_15_,
rendacompr16_.fax as fax15_15_,
rendacompr16_.nome_fonte_pagadora as nome11_15_15_,
rendacompr16_.qtd_anos_emprego_anterior as qtd12_15_15_,
rendacompr16_.qtd_meses_emprego_anterior as qtd13_15_15_,
rendacompr16_.renda_bruta_mes as renda14_15_15_,
rendacompr16_.renda_liquida_mes as renda15_15_15_,
rendacompr16_.telefone_comercial as telefone16_15_15_,
rendacompr16_.tipo_fonte_pagadora as tipo17_15_15_,
rendacompr16_.valor_imposto_renda_retido as valor18_15_15_,
comprador17_.codigo as codigo2_16_,
comprador17_.conjuge as conjuge2_16_,
comprador17_.conta as conta2_16_,
comprador17_.cpf as cpf2_16_,
comprador17_.data_nascimento as data3_2_16_,
comprador17_.email as email2_16_,
comprador17_.endereco as endereco2_16_,
comprador17_.estado_civil as estado5_2_16_,
comprador17_.grau_instrucao as grau6_2_16_,
comprador17_.nacionalidade as nacional7_2_16_,
comprador17_.naturalidade as naturali8_2_16_,
comprador17_.nome as nome2_16_,
comprador17_.nome_mae as nome10_2_16_,
comprador17_.nome_pai as nome11_2_16_,
comprador17_.renda_nao_comprovada as renda21_2_16_,
comprador17_.rg as rg2_16_,
comprador17_.sexo as sexo2_16_,
comprador17_.situacao_menor_idade as situacao13_2_16_,
comprador17_.telefone_celular as telefone14_2_16_,
comprador17_.telefone_para_recados as telefone15_2_16_,
comprador17_.telefone_residencial as telefone16_2_16_,
comprador17_.uf_naturalidade as uf17_2_16_,
comprador17_.usuario as usuario2_16_,
rendanaoco18_.codigo as codigo17_17_,
rendanaoco18_.data_inicio_trabalho as data2_17_17_,
rendanaoco18_.local_trabalho as local3_17_17_,
rendanaoco18_.nome_atividade as nome4_17_17_,
rendanaoco18_.renda_liquida_mes as renda5_17_17_,
usuario19_.codigo as codigo20_18_,
usuario19_.nome as nome20_18_,
usuario19_.perfil as perfil20_18_,
usuario19_.senha as senha20_18_,
usuario19_.status as status20_18_,
usuario19_.usuario as usuario20_18_,
cestadeser20_.codigo as codigo22_19_,
cestadeser20_.comprador as comprador22_19_,
cestadeser20_.dia_do_debito as dia2_22_19_,
cestadeser20_.modalidade as modalidade22_19_,
solicitaca21_.codigo as codigo19_20_,
solicitaca21_.bandeira as bandeira19_20_,
solicitaca21_.comprador as comprador19_20_,
solicitaca21_.modalidade as modalidade19_20_,
solicitaca21_.tipo_cartao as tipo4_19_20_,
usuario22_.codigo as codigo20_21_,
usuario22_.nome as nome20_21_,
usuario22_.perfil as perfil20_21_,
usuario22_.senha as senha20_21_,
usuario22_.status as status20_21_,
usuario22_.usuario as usuario20_21_
from
empresa empresa0_
inner join
endereco endereco1_
on empresa0_.endereco=endereco1_.codigo
left outer join
comprador comprador2_
on endereco1_.codigo=comprador2_.endereco
left outer join
conjuge conjuge3_
on comprador2_.conjuge=conjuge3_.codigo
left outer join
rg rg4_
on conjuge3_.rg=rg4_.codigo
left outer join
comprador comprador5_
on rg4_.codigo=comprador5_.rg
left outer join
conta conta6_
on comprador5_.conta=conta6_.codigo
left outer join
vendedor vendedor7_
on conta6_.codigo=vendedor7_.conta
left outer join
conjuge conjuge8_
on vendedor7_.conjuge=conjuge8_.codigo
left outer join
endereco endereco9_
on vendedor7_.endereco=endereco9_.codigo
left outer join
procurador procurador10_
on endereco9_.codigo=procurador10_.endereco
left outer join
rg rg11_
on procurador10_.rg=rg11_.codigo
left outer join
vendedor vendedor12_
on rg11_.codigo=vendedor12_.rg
left outer join
usuario usuario13_
on vendedor12_.usuario=usuario13_.codigo
left outer join
perfil perfil14_
on usuario13_.perfil=perfil14_.codigo
left outer join
vendedor vendedor15_
on procurador10_.vendedor=vendedor15_.codigo
left outer join
renda_comprovada rendacompr16_
on endereco9_.codigo=rendacompr16_.endereco
left outer join
comprador comprador17_
on rendacompr16_.comprador=comprador17_.codigo
left outer join
renda_nao_comprovada rendanaoco18_
on comprador17_.renda_nao_comprovada=rendanaoco18_.codigo
left outer join
usuario usuario19_
on comprador17_.usuario=usuario19_.codigo
left outer join
cesta_de_servicos cestadeser20_
on comprador17_.codigo=cestadeser20_.comprador
left outer join
solicitacao_emissao_cartao solicitaca21_
on comprador17_.codigo=solicitaca21_.comprador
inner join
usuario usuario22_
on empresa0_.usuario=usuario22_.codigo
where
empresa0_.endereco=?
.
.
.
//No total foi mais de 1700 linhas de código gerado.
Não preciso de tanta coisa assim. E ele me retorna uma lista de empresas só que com os atributos nulos.
Fico grato se puder me ajudar.