I don't have a lot to say, but this is my little bit.

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