Hello,
I'm working with SmartGWT 3.0p with HibernateDataSource (using schemabean).
I have a problem with related entities when I try to add an owned entity (detail), foreign keys that are described in the datasource are not filled. When I save I get a constraint violation exception. I have to set these FKs as not required in the database in order to not receive this exception, but the fields stay NULL. The only way I've found to fix this is to switch the related fields to plain Long fields.
Client side code to reproduce the problem (datasources included in attachments)
I'm working with SmartGWT 3.0p with HibernateDataSource (using schemabean).
I have a problem with related entities when I try to add an owned entity (detail), foreign keys that are described in the datasource are not filled. When I save I get a constraint violation exception. I have to set these FKs as not required in the database in order to not receive this exception, but the fields stay NULL. The only way I've found to fix this is to switch the related fields to plain Long fields.
Client side code to reproduce the problem (datasources included in attachments)
Code:
Record venda = new Record(); venda.setAttribute("descricao", "Venda X"); RecordList itensVenda = new RecordList(); Record itemVenda = new Record(); itemVenda.setAttribute("produto", 1); itensVenda.add(itemVenda); venda.setAttribute("itens", itensVenda); // Tested in informix and mysql FK has DataSource.get("venda").addData(venda);
Comment