2

In my @Entity class I have defined a boolean property named reservable:

    @Column(name="reservable", columnDefinition = "boolean default true")
    private boolean reservable;

It is always a column of type TINYINT(1) with default value 1 created. How can I tell Eclipselink to generate a table column of type BOOLEAN in MySql?

du-it
  • 2,561
  • 8
  • 42
  • 80

1 Answers1

4

MySQL (5.x) doesn't know about a BOOLEAN type.

See for example http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html

Quote:

BOOL, BOOLEAN

These types are synonyms for TINYINT(1). A value of zero is considered false. Nonzero values are considered true.

wdick
  • 99
  • 4