Tag Archives: The database returned no natively generated identity value

The database returned no natively generated identity value [How to Solve]

Reason: in the configuration file of student table in Hibernate project:

<id name="studentno" column="studentno">
            <generator class="native"></generator>
        </id>

The primary key is set to the type of automatic growth, but the data type is set to the type of vchar when the database creates a table. How can the + + operation be realized

Set the student number (primary key) to int, and the problem is solved successfully