Hello, if i understand,
1 - you added a new user in admin table by a changeset that ran.
2 - After this, you tried to add a new user via your web application in the same table.
At my first read, it seems to be an error in your code.
The error is explicit : You tried to insert a user with a unique id already existing in your table.
- Verify that the PRIMARY_KEY (admin.ID or admin.ADMIN_ID or the column name you chose) has AUTO_INCREMENT setted.
- Verify that you didn't set an ID explicitly in your DAO query which inserts a new user and your changeset that creates the default user. Normally it is automatically generated by mysql.
With AUTO_INCREMENT you don't need to specify explicitly this column and value in your insert query.
- Verify the annotation or strategy generation of your id attribute in your entity Admin :
1 - you added a new user in admin table by a changeset that ran.
2 - After this, you tried to add a new user via your web application in the same table.
At my first read, it seems to be an error in your code.
The error is explicit : You tried to insert a user with a unique id already existing in your table.
- Verify that the PRIMARY_KEY (admin.ID or admin.ADMIN_ID or the column name you chose) has AUTO_INCREMENT setted.
- Verify that you didn't set an ID explicitly in your DAO query which inserts a new user and your changeset that creates the default user. Normally it is automatically generated by mysql.
With AUTO_INCREMENT you don't need to specify explicitly this column and value in your insert query.
- Verify the annotation or strategy generation of your id attribute in your entity Admin :
Regards@Id @GeneratedValue(strategy=GenerationType.AUTO)
or@Id @GeneratedValue(strategy=GenerationType.IDENTITY)
Hoping that it helped you.