Maybe someone will know why when I do an update my boolean fields are getting mapped as "true" and "false" and not 1 and 0 when doing inserts or updates.
I'm using Hibernate 2.1.2
I have configured hibernate as so:
hibernate.dialect net.sf.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class org.postgresql.Driver
hibernate.connection.url jdbc:postgresql://localhost:5432/acms
hibernate.connection.username acms
hibernate.connection.password acms
hibernate.query.substitutions true 1, false 0
I even tried
hibernate.query.substitutions true=1, false=0,1=true,0=false
and
hibernate.query.substitutions true=1, false=0
My boolean fields look like so:
<property
name="useBot"
type="boolean"
update="true"
insert="true"
column="use_bot"
/>
The columns are numeric(1), values 0 or 1
Debug shows the following...
11:52:26,322 DEBUG BooleanType:46 - binding 'false' to parameter: 2
11:52:26,322 DEBUG BooleanType:46 - binding 'false' to parameter: 3
11:52:26,322 DEBUG BooleanType:46 - binding 'false' to parameter: 4
Which gives me the following error:
java.sql.SQLException: ERROR: Bad numeric input format 'f'
I do not have any error getting the fields from the db, only on insert and update.
If an answer to this is in a post or a doc, simply post the link. Thanks for any help.
|