If there are always exactly two values, you can play with getter / setter and an instance variable. You can really choose whether you map a variable or instance property with @Column.
@Column
String s1;
@Column
String s2;
public String[] getProp()
{
return new String[]{ s1, s2 };
}
public String setProp(String[] s )
{
s1 = s[0];
s2 = s[1];
}
@Embedded. -
@Entity
public class MyEntity {
@Embedded
public StringTuple tuple;
}
public class StringTuple {
public String s1;
public String s2;
}