Joined: Wed Dec 14, 2011 11:00 pm Posts: 2
|
A typical JPA entity looks like:
@Entity public class Person { @Id private int id; private String name; private int age; private Calendar anniversary; ... } Note that the data type is not annotated on any of the member attributes.
I just read a note around Hibernate being not so usable with Scala's data types and wondered if we could write some adaptors. I know we can write UserTypes for Scala types and UserCollectionTypes for Scala's collections so adaptors may be possible.
The question I have is can I configure these data types somehow so JPA will automatically associate them with corresponding Scala types (e.g. BigDecimal's user type with BigDecimal attributes), without having to annotate each attribute with @Type?
or is there an out-of-the-box solution available for scala types anyways?
|
|