Hello,
In my application I have to use some tables of a legacy database (MySQL 5). My strategy was to write Entities with JPA annotations for these tables and use a diffent persistent-unit for them. Now, in one of these tables (which I use just in readonly mode) there is a column which is defined in MySQL as
Code:
Binary(2).
In fact it represents a bitfield.
I thought I could map this just with
Code:
Byte[] or byte[]
and it should work. But the Hibernate validation process (on server startup) complains. It expects that the database column would be a "TinyBlob".
I tried some other mappings but with no success.
Then I thought: do it the other way, let Hibernate generate the entity from the database. Now, guess what is the result?
Code:
@Column(name="kind")
public byte[] getKind()
Ok, besides this
mismatch between the Hibernate validator and the Hibernate source generator tool, does anybody has a hot tip what I can do in this situation? Are there any undocumented annotation options which I can use?
Carlo