Hello. Try to add this annotation @PrimaryKey(validation = IdValidation.NONE) to the entity with integer primary key.
https://eclipse.dev/eclipselink/documentation/2.4/jpa/extensions/a_primarykey.htm
By default, EclipseLink interprets zero as null for primitive types that cannot be null (such as int and long), causing zero to be an invalid value for primary keys.