Problem setting value of a mysql BIT field

0

Using Java + Hibernate on my systems, I created a boolean attribute to determine if a user is an administrator: private boolean isAdmin;

The Hibernate generates tables and fields, and this isAdm field becomes type BIT in MySQL . In the version I have installed on my machine I can enter WorkBench and set values manually, eg:

On the local machine where I have the 5.6.23 version of MySQL it works, however on the server where I have the 5.7.10 version I get the following error when trying to assign the value 1 in the isAdm field:

  

Operation failed: There was an error while applying the SQL script to   the database. Executing: UPDATE auditoriabd . usuario SET    isAdm = '1' WHERE id = '2';

     

ERROR 1406: 1406: Data too long for column 'isAdm' at row 1 SQL   Statement: UPDATE auditoriabd . usuario SET isAdm = '1' WHERE    id = '2'

How can I solve this problem? Does the problem occur because the MySQL versions are different?

    
asked by anonymous 16.03.2016 / 20:42

0 answers