I am fairly new to JPA and trying to get a basic entity setup.
I understand that table attributes are m开发者_StackOverflow社区apped to java types, such as varchar being mapped to a String.
In my table I have a column code which is a char(2)
, and stores a two letter code.
How would I use this within the entity? I tried using a String, but it seems that this isn't the correct mapping to use.
String is the correct type:
@Column(length=2)
private String code;
精彩评论