{"action":"opened","issue":{"url":"https://api.github.com/repos/viritin/viritin/issues/94","labels_url":"https://api.github.com/repos/viritin/viritin/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/viritin/viritin/issues/94/comments","events_url":"https://api.github.com/repos/viritin/viritin/issues/94/events","html_url":"https://github.com/viritin/viritin/issues/94","id":99870623,"number":94,"title":"process of Saving data but sending null value.","user":{"login":"mortoza","id":10647439,"avatar_url":"https://avatars.githubusercontent.com/u/10647439?v=3","gravatar_id":"","url":"https://api.github.com/users/mortoza","html_url":"https://github.com/mortoza","followers_url":"https://api.github.com/users/mortoza/followers","following_url":"https://api.github.com/users/mortoza/following{/other_user}","gists_url":"https://api.github.com/users/mortoza/gists{/gist_id}","starred_url":"https://api.github.com/users/mortoza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mortoza/subscriptions","organizations_url":"https://api.github.com/users/mortoza/orgs","repos_url":"https://api.github.com/users/mortoza/repos","events_url":"https://api.github.com/users/mortoza/events{/privacy}","received_events_url":"https://api.github.com/users/mortoza/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-09T06:36:22Z","updated_at":"2015-08-09T06:36:22Z","closed_at":null,"body":"Hi\r\nI am user viritin, it had been working well but recently i have been encountering error in saving the data in table Country:\r\n\r\nIn this example, the error i see is as follows:\r\n\r\nInternal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert the value NULL into column 'ID', table 'inteaccGms.dbo.COUNTRY'; column does not allow nulls. INSERT fails.\r\nError Code: 515\r\nCall: INSERT INTO COUNTRY (ID, NAME) VALUES (?, ?)\r\n\tbind => [2 parameters bound]\r\nQuery: InsertObjectQuery(com.inteacc.entity.Country@143adb5d)\r\n\tat org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:331)\r\n\r\n\r\nThe entity file Country is as follows: \r\n@Entity\r\npublic class Country implements Serializable {\r\n    @Id\r\n    private String Id;\r\n    private String Name;\r\n    public Country() {\r\n    }\r\n\r\n\r\nThe form contains both ID and Name fields, even i enter ID and name, it returns the error, as being the field is empty. Thanks for your help:\r\n\r\n\r\npublic class CountryV2Form extends AbstractForm<Country> {\r\n\r\n    @Inject\r\n    CountryService service;\r\n    \r\n    TextField Id = new MTextField(\"Id\");\r\n\r\n    TextField Name = new MTextField(\"Name\");\r\n\r\n    @Override\r\n    protected Component createContent() {\r\n\r\n        setStyleName(ValoTheme.LAYOUT_CARD);\r\n\r\n        return new MVerticalLayout(\r\n                new Header(\"Edit Country\").setHeaderLevel(3),\r\n                new MFormLayout(\r\n                        Id,\r\n                        Name\r\n                ).withFullWidth(),\r\n                getToolbar()\r\n        ).withStyleName(ValoTheme.LAYOUT_CARD);\r\n    }\r\n\r\n    @PostConstruct\r\n    void init() {\r\n        setEagerValidation(true);\r\n        setSavedHandler(new SavedHandler<Country>() {\r\n\r\n            @Override\r\n            public void onSave(Country entity) {\r\n                try {\r\n                    service.saveOrPersist(entity);\r\n                    saveEvent.fire(entity);\r\n                } catch (EJBException e) {\r\n                    /*\r\n                     * The Entity object uses optimitic locking with the \r\n                     * version field. Notify user the editing didn't succeed.\r\n                     */\r\n                    Notification.show(\"The record was concurrently edited \"\r\n                            + \"by someone else. Your changes were discarded.\",\r\n                            Notification.Type.ERROR_MESSAGE);\r\n                    refrehsEvent.fire(entity);\r\n                }\r\n            }\r\n        });\r\n        setResetHandler(new ResetHandler<Country>() {\r\n\r\n            @Override\r\n            public void onReset(Country entity) {\r\n                refrehsEvent.fire(entity);\r\n            }\r\n        });\r\n        setDeleteHandler(new DeleteHandler<Country>() {\r\n            @Override\r\n            public void onDelete(Country entity) {\r\n                service.deleteEntity(getEntity());\r\n                deleteEvent.fire(getEntity());\r\n            }\r\n        });\r\n    }\r\n\r\n    @Override\r\n    protected void adjustResetButtonState() {\r\n        getResetButton().setEnabled(true);\r\n        getDeleteButton().setEnabled(getEntity() != null);\r\n    }\r\n\r\n    /* \"CDI interface\" to notify decoupled components. Using traditional API to\r\n     * other componets would probably be easier in small apps, but just\r\n     * demonstrating here how all CDI stuff is available for Vaadin apps.\r\n     */\r\n    @Inject\r\n    @CountryEvent(CountryEvent.Type.SAVE)\r\n    javax.enterprise.event.Event<Country> saveEvent;\r\n\r\n    @Inject\r\n    @CountryEvent(CountryEvent.Type.REFRESH)\r\n    javax.enterprise.event.Event<Country> refrehsEvent;\r\n\r\n    @Inject\r\n    @CountryEvent(CountryEvent.Type.DELETE)\r\n    javax.enterprise.event.Event<Country> deleteEvent;\r\n}\r\n\r\n"}}