I wanna design an Entity Class which has a String[] property. This String Array always has two values and I dont want Hibernate (or rather JPA) create an extra table for this but embed this two String values directly into the table.
Is this possible and if so how?
I wanna design an Entity Class which has a String[] property. This String Array
Share
If there is always exactly two values, you can play with getter/setter and instance variable. You can indeed choose whether you map instance variable or property with
@Column.Otherwise look at
@Embeddedentity. Something in the spirit of