How to Tell JPA the prefered DataType

Marcel Menz :

If I use JPA (EclipseLink) to create tables a String type results in a varchar2(255). How could I tell JPA (via Annotation) to create a varchar2(20) attribute.

If I have a List JPA creates a BLOB(4000) but I would like a varchar2 (my serialized object's string is short)

How is this possible? Do I have to do it by hand?

William :

You need to use the columnDefinition property of the @Column annotation. i.e.

@Column(columnDefinition="varchar2(20)")

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related