hi gavin,
i don't doubt that i'm mistaken but have no idea where???? ;-(
i'm using the latest hibernate (2.1.4) and mysql (4.0.15)
my java code is as follows :
**snip **
Code:
private boolean rpSettable = false;
public boolean isRpSettable() {
return this.rpSettable;
}
public void setRpSettable(boolean rpSettable) {
this.rpSettable = rpSettable;
}
i've also tried using java.lang.Boolean for the type.
i'm using xdoclet to generate the hibernate mapping file and it produces :
Code:
<property
name="rpSettable"
type="boolean"
update="true"
insert="true"
column="rpSettable"
/>
with hibernate logging turned on i get :
Code:
2004-07-06 10:38:16,462 INFO [STDOUT] Hibernate: insert into hbm_ratecategory (categoryName, billType, rpSettable, operatorID, currencyRateID, creditRateID, replyPathID, id) values (?, ?, ?, ?, ?, ?, ?, ?)
2004-07-06 10:38:16,466 DEBUG [net.sf.hibernate.impl.BatcherImpl] preparing statement
2004-07-06 10:38:16,466 DEBUG [net.sf.hibernate.persister.EntityPersister] Dehydrating entity: [com.yahoo.gmmh.hibernate.RateCategory#ff808081fd9404d200fd9408478b0003]
2004-07-06 10:38:16,466 DEBUG [net.sf.hibernate.type.StringType] binding '40' to parameter: 1
2004-07-06 10:38:16,466 DEBUG [net.sf.hibernate.type.StringType] binding 'MT' to parameter: 2
2004-07-06 10:38:16,466 DEBUG [net.sf.hibernate.type.BooleanType] binding 'true' to parameter: 3
2004-07-06 10:38:16,467 DEBUG [net.sf.hibernate.type.StringType] binding 'ff808081fd9404d200fd9407db960002' to parameter: 4
2004-07-06 10:38:16,467 DEBUG [net.sf.hibernate.type.StringType] binding null to parameter: 5
2004-07-06 10:38:16,467 DEBUG [net.sf.hibernate.type.StringType] binding null to parameter: 6
2004-07-06 10:38:16,467 DEBUG [net.sf.hibernate.type.StringType] binding null to parameter: 7
2004-07-06 10:38:16,467 DEBUG [net.sf.hibernate.type.StringType] binding 'ff808081fd9404d200fd9408478b0003' to parameter: 8
2004-07-06 10:38:16,467 DEBUG [net.sf.hibernate.impl.BatcherImpl] Adding to batch
2004-07-06 10:38:16,467 DEBUG [net.sf.hibernate.impl.BatcherImpl] Executing batch size: 1
2004-07-06 10:38:16,539 DEBUG [net.sf.hibernate.impl.BatcherImpl] done closing: 0 open PreparedStatements, 0 open ResultSets
2004-07-06 10:38:16,539 DEBUG [net.sf.hibernate.impl.BatcherImpl] closing statement
parameter 3 is the problem one, is the mapping correct here???
it all looks ok to me as i'm expecting a 'true' but it seems to go wrong from here on.
i've turned on logging in mysql to see the sql that it receives and it gets :
Code:
insert into hbm_ratecategory (categoryName, billType, rpSettable, operatorID, currencyRateID, creditRateID, replyPathID, id) values ('40', 'MT', 't', 'ff808081fd9404d200fd9407db960002', null, null, null, 'ff808081fd9404d200fd9408478b0003')
as you can see the 't' is the problem. ;-(
the definition of the table in mysql has a tinyint(1) for the column 'rpSettable'.
if you can see where i'm going wrong i'd greatly appreciate some help.
cheers,
colum.