I am fairly new to JPA and trying to get a basic entity setup.
I understand that table attributes are mapped 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;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With