0
I have a form inside the modal to record registration, when I insert the data it is as if it were recorded in the Eclipse console, but the same does not happen in the database
Message on console as Ok from recording.
Hibernate:
select
empresa0_.id as id1_0_,
empresa0_.cnpj as cnpj2_0_,
empresa0_.data_fundacao as data_fun3_0_,
empresa0_.nome_fantasia as nome_fan4_0_,
empresa0_.razao_social as razao_so5_0_,
empresa0_.tipo as tipo6_0_
from
Empresa empresa0_
<p:commandButton id="salvar-button" value="Salvar"
action="#{gestaoEmpresasBean.salvar}"
process="empresa-dialog" update="empresa-table"
oncomplete="PF('edicaoEmpresaDialog').hide()" />
@Inject
private Empresas empresas;
@Inject
private CadastroEmpresaService cadastroEmpresa;
@Inject
private FacesMessages messages;
private List<Empresa> todasEmpresas;
private Empresa empresaEdicao = new Empresa();
public void prepararNovoCadastro() {
empresaEdicao = new Empresa();
}
public void salvar() {
cadastroEmpresa.salvar(empresaEdicao);
consultar();
messages.info("Empresa salva com sucesso!");
}
public void consultar() {
todasEmpresas = empresas.todas();
}
public List<Empresa> getTodasEmpresas() {
return todasEmpresas;
}
public TipoEmpresa[] getTiposEmpresas() {
return TipoEmpresa.values();
}
public Empresa getEmpresaEdicao() {
return empresaEdicao;
}
public void setEmpresaEdicao(Empresa empresaEdicao) {
this.empresaEdicao = empresaEdicao;
}
Service
@Transactional
public void salvar(Empresa empresa) {
empresas.guardar(empresa);
}
Is giving commit after entering, changing and deleting your bank information? How far do I know auto commit is
false
.– Renan Gomes
This log only shows that the record was retrieved from the database, it does not show that it was persisted. How about you show the bean code (gestationBean companies.save.)?
– Caffé
Would this error below be from messages.properties in the wrong place? Caused by: java.util.Missingresourceexception: Can’t find Bundle for base name com.algaworks.Erp.Messages, locale pt_BR
– Frederico Queiroz