I have a field ID
in PostgreSQL of type serial
, to be auto-incremental. But when I do the mapping with Hibernate the .xml
of the table is saved like this:
'<class name="Model.Persona" table="persona" schema="public" optimistic-lock="version">
<id name="id" type="int">
<column name="id" />
<generator class="assigned" />
</id></class>'
This means that when I want to send a record to the database it does not take into account the database autoincrementable and creates conflict.