Bug 323 : bug in mapping Booleans to java.sql.Types.BIT support (mysql)
Priority 
High
Reported Version 
 
Logged By 
anton0xf
Status 
Fixed
Fixed Version 
2.7.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
19/09/2010
Updated 
19/09/2010
Type 
Bug
 
Attachments 
No attachments

mysql Ver 14.12 Distrib 5.0.90, for pc-linux-gnu (i686) using readline 6.1

code:
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.List;
import com.avaje.ebean.Ebean;

class Test{
public static void main(String args[]){
List ents = Ebean.find(Ent.class).where().eq("b", true).findList();
}
}

@Entity
public class Ent{

@Id
private int id;
private boolean b;

public int getId(){
return id;
}

public void setId(int id){
this.id = id;
}

public boolean isB(){
return b;
}

public void setB(boolean b){
this.b = b;
}

}

stack trace:
Exception in thread "main" javax.persistence.PersistenceException: Error with property[0] dt[-7]data[true][java.lang.Boolean]
at com.avaje.ebeaninternal.server.persist.Binder.bindSimpleData(Binder.java:340)
at com.avaje.ebeaninternal.server.persist.Binder.bindObject(Binder.java:234)
at com.avaje.ebeaninternal.server.persist.Binder.bindObject(Binder.java:191)
at com.avaje.ebeaninternal.server.query.CQueryPredicates.bind(CQueryPredicates.java:152)
at com.avaje.ebeaninternal.server.query.CQuery.prepareBindExecuteQuery(CQuery.java:410)
at com.avaje.ebeaninternal.server.query.CQueryEngine.findMany(CQueryEngine.java:162)
at com.avaje.ebeaninternal.server.query.DefaultOrmQueryEngine.findMany(DefaultOrmQueryEngine.java:89)
at com.avaje.ebeaninternal.server.core.OrmQueryRequest.findList(OrmQueryRequest.java:298)
at com.avaje.ebeaninternal.server.core.DefaultServer.findList(DefaultServer.java:1369)
at com.avaje.ebeaninternal.server.querydefn.DefaultOrmQuery.findList(DefaultOrmQuery.java:880)
at com.avaje.ebeaninternal.util.DefaultExpressionList.findList(DefaultExpressionList.java:146)
at Test.main(Ent.java:8)
Caused by: java.sql.SQLException: Unhandled data type [-7] bind number[0]
at com.avaje.ebeaninternal.server.persist.Binder.bindSimpleData(Binder.java:330)
... 11 more

 
Rob 22 Sep 10:46
Ok, I have reproduced.

I have create a simple test case and reproduced.

Rob 22 Sep 10:52
Fixed in HEAD

Fixed in HEAD.

Thanks for the Bug report.

woResponse

Upload a file