How do you store a Java Boolean type variable in a PostgreSQL table with corresponding column data type defined as "bit"? -
now, data type of variable in java class "boolean". want store in postgresql table. column in want store data has data type defined "bit". when try save object has boolean variable, error:
error: column "isdeleted" of type bit expression of type boolean
i'm using hibernate store data. code snippet defining , mapping variable:
@column(name = "isdeleted") private boolean isdeleted;
how save object? thank you!
please use proper boolean
type in postgres. although possible store boolean values in bit streams, makes later usage complicated.
with usual boolean
can this:
select * table isdeleted;
whereas bit
type have bitwise operations:
select * table isdeleted > b'0'
Comments
Post a Comment