JPA Container and Table

I am using a simple contacts bean, and for data layer JPA container, and ContactsM… se below


JPAContainer<Contact> containerContact = new JPAContainer<Contact>(Contact.class);

containerContact.setEntityProvider(app.getManager_Contact());    //getManager_Contact returs ContactManagerMutableBean...
containerContact.setWriteThrough(true);

//attaching to a table
Table contactsTable = new Table("Contacts", containerContact);
contactsTable.setContainerDataSource(containerContact);
contactsTable.setWidth(100, UNITS_PERCENTAGE);
contactsTable.setVisibleColumns(new String[]{"longName", "phone" , "description", "email" } );
contactsTable.setColumnHeaders(new String[]{"Name", "Phone" ,"Description", "Email"});

The problem is that it displays data correctly, but when saving to a db (only first column gets saved), even if I input all the data ). So if I input longName, phone, description - on save - only field longName gets saved to DB, and the other values are set back to null ?

In the next step, when I click edit again, and I input the missing parameters (longName (was saved from before) so I input phone, description and email) - it again saves only one value, but this time the next null value, in this case the column after longName, so field phone gets saved… other input values are again set to null…

I also set writethrought to true, and immediate to true ?

Am I missing anything else? Any ideas… If I understand correct JPA container should handle this behaviour automatically? So what are my options…

Vaadin and Jpa Container are at the latest versions…

Kristjan
11980.java (1.82 KB)
11981.java (1.26 KB)
11982.java (16.7 KB)
11983.java (6.71 KB)

Hi,

didn’t look at your code examples in detail, but from your description the problem sounds very similar to this issue I encountered while using
JPAContainer
and a
Table
in editable mode.


http://dev.vaadin.com/ticket/7809

Tnx for the heads up, and yes exactly the same issue. I checked the ticket u made, and also made some comments - would like to se the changed code that was made on JPAContainer…

with br
Kristjan

Help me …

How to generate jasper reports from jpacontainer.

Urgent for my project…

Thanks in advance.