java.sql.SQLException: Primary or unique constraint required on main table: VOTERS in statement [-- creating foreign key constraint absentee_ballo_registrant_i_FK -- ALTER TABLE absentee_ballots ADD CONSTRAINT absentee_ballo_registrant_i_FK FOREIGN KEY (registrant_id) REFERENCES voters (id)]

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via empire-user by Joel Becker, 1 year ago
Primary or unique constraint required on main table: VOTERS in statement [-- creating foreign key constraint absentee_ballo_registrant_i_FK -- ALTER TABLE absentee_ballots ADD CONSTRAINT absentee_ballo_registrant_i_FK FOREIGN KEY (registrant_id) REFERENCES voters (id)]
via empire-user by Rainer Döbele, 1 year ago
Primary or unique constraint required on main table: VOTERS in statement [-- creating foreign key constraint absentee_ballo_registrant_i_FK -- ALTER TABLE absentee_ballots ADD CONSTRAINT absentee_ballo_registrant_i_FK FOREIGN KEY (registrant_id) REFERENCES voters (id)]
via empire-user by Joel Becker, 1 year ago
Primary or unique constraint required on main table: VOTERS in statement [-- creating foreign key constraint absentee_ballo_registrant_i_FK -- ALTER TABLE absentee_ballots ADD CONSTRAINT absentee_ballo_registrant_i_FK FOREIGN KEY (registrant_id) REFERENCES voters (id)]
via empire-user by Francis De Brabandere, 1 year ago
Primary or unique constraint required on main table: VOTERS in statement [-- creating foreign key constraint absentee_ballo_registrant_i_FK -- ALTER TABLE absentee_ballots ADD CONSTRAINT absentee_ballo_registrant_i_FK FOREIGN KEY (registrant_id) REFERENCES voters (id)]
via empire-user by Rainer Döbele, 1 year ago
Primary or unique constraint required on main table: VOTERS in statement [-- creating foreign key constraint absentee_ballo_registrant_i_FK -- ALTER TABLE absentee_ballots ADD CONSTRAINT absentee_ballo_registrant_i_FK FOREIGN KEY (registrant_id) REFERENCES voters (id)]
via empire-user by Francis De Brabandere, 1 year ago
Primary or unique constraint required on main table: VOTERS in statement [-- creating foreign key constraint absentee_ballo_registrant_i_FK -- ALTER TABLE absentee_ballots ADD CONSTRAINT absentee_ballo_registrant_i_FK FOREIGN KEY (registrant_id) REFERENCES voters (id)]
java.sql.SQLException: Primary or unique constraint required on main table: VOTERS in statement [-- creating foreign key constraint absentee_ballo_registrant_i_FK -- ALTER TABLE absentee_ballots ADD CONSTRAINT absentee_ballo_registrant_i_FK FOREIGN KEY (registrant_id) REFERENCES voters (id)]
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source)
at org.apache.empire.db.DBDatabaseDriver.executeSQL(DBDatabaseDriver.java:552)
at org.apache.empire.db.DBSQLScript.run(DBSQLScript.java:120)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.