Download and view my resume (PDF)

Friday, January 3, 2014

How To Use JPA XML Mappings For Enum Values

The annotation for mapping an Enum value looks like this:

@Enumerated(EnumType.STRING)
private Type type;

The XML for mapping an Enum value looks like this:

<basic name="type">
    <enumerated>EnumType.STRING</enumerated>
</basic>

No comments:

Post a Comment