Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public class GenderConverter implements AttributeConverter<Gender, String> {
public String convertToDatabaseColumn(Gender gender) {
return gender.getCode();
public Gender convertToEntityAttribute(String code) {
return -> gender.getCode().equals(code))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment