Nothing happens when I click the button, I can only edit existing data.
Hibernate: select e1_0.id,e1_0.bairro,e1_0.cidade,e1_0.logradouro,e1_0.nome,e1_0.uf,e1_0.version from escola e1_0 where e1_0.id=?
Hibernate: update escola set bairro=?,cidade=?,logradouro=?,nome=?,uf=?,version=? where id=? and version=?
Hibernate: select e1_0.id,e1_0.bairro,e1_0.cidade,e1_0.logradouro,e1_0.nome,e1_0.uf,e1_0.version from escola e1_0 order by e1_0.nome offset ? rows fetch first ? rows only
Hibernate: select count(e1_0.id) from escola e1_0
Could you share your code in a public GitHub repo or could you create an example project to reproduce the issue and share this example project as a public GitHub repo?
Hi, i’m courious too, as i’m facing the same problem. I recently started looking into Hilla and tried a simple example app. The submit button of autcrud (and autform) does nothing when clicked.
I tried it in two different environments (work and home) with H2 an Postgres.
The problem in the provided repo is that all properties on all entities are marked as not nullable (via package-info.java), which tells Hilla (the Hilla form specifically) that all properties must have a value in order to successfully submit a form. However that’s not the case for id and version as these values are generated only on the server after saving an entity. The other problem is that Hilla validates these properties already on the client, but the error is never shown because AutoCrud / AutoForm hide fields for id and version automatically. So there are client-side validation errors, but they are not visible.
Not sure what the proper way to deal with this should be. What works is marking both the id and version properties as nullable by adding @com.vaadin.hilla.Nullable to each property. Maybe there is some other mechanism for making the Hilla form ignore certain properties that are not meant to be edited.