The IDs in my postgresql database are auto-incremental (sequences are defined in the database). When creating hibernate mapping files, I install a class generator to increase:
<class name="model.Names" schema="public" table="names"> <id name="id" type="int"> <column name="id"/> <generator class="increment"/> </id>
However, I keep getting all kinds of errors (null pointer exception, org.hibernate.TransactionException: transaction did not start successfully), so I first wanted to make sure that this is the correct generator class before debugging and finding errors elsewhere. I tried the sequence (does not work at all, the increment works in some cases). The application is written in JSF 2.0.
Thanks in advance for any suggestions.
Best regards, Insolence.
source share