Using UUID with EclipseLink and PostgreSQL
问题 I want to use the PostgreSQL uuid type for objects' primary keys. For that I've created a converter (implementing the Converter interface). Bellow is the relevant code: @Override public void initialize(DatabaseMapping mapping, Session session) { final DatabaseField field; if (mapping instanceof DirectCollectionMapping) { field = ((DirectCollectionMapping) mapping).getDirectField(); } else { field = mapping.getField(); } field.setSqlType(Types.OTHER); field.setTypeName("uuid"); field