tags:

views:

15

answers:

1

In JPA is there an annotation to specify that boolean fields should be persisted as an integer. I'm using OpenJPA and it's currently persisting boolean fields as bits. I'd rather use integer 1 or 0.

+1  A: 

You can specify the column definition:

@Column(name="boolColumn",
     columnDefinition="INT(1)")
Bozho
great, thanks Bozho
Joel