Using a PreparedStatement to persist an array of Java Enums to an array of Postgres Enums
- by McGin
I have a Java Enum:
public enum Equipment { Hood, Blinkers, ToungTie, CheekPieces, Visor, EyeShield, None;}
and a corresponding Postgres enum:
CREATE TYPE equipment AS ENUM ('Hood', 'Blinkers', 'ToungTie', 'CheekPieces', 'Visor', 'EyeShield', 'None');
Within my database I have a table which has a column containing an array of "equipment"…