开发者

JPA Character mappings

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜