Tuesday, March 16, 2010

Drizzle Hibernate Dialect

I just built a hibernate dialect for drizzle:

bzr branch lp:~krummas/+junk/drizzledialect

Drop the file in your project and set;

hibernate.dialect=org.drizzle.hibernate.dialect.DrizzleDialect
hibernate.connection.url=jdbc:drizzle://10.100.100.50:3307/somedb
hibernate.connection.driver_class=org.drizzle.jdbc.DrizzleDriver

And you are ready to go. Preferably use it with the latest drizzle-jdbc snapshot. Please try it out and let me know how it works.

2 comments:

Rahul said...

Hi the boolean mapping is failing with this dialect , any suggestion ?

Rahul said...

i started drizzled like while in sbin ./drizzled --no-defaults --basedir=/opt/drizzle7/ --mysql-protocol.port=4455​ --datadir=/tmp/drizzle7/da​ta
i started drizzle like while in bin ./drizzle
i fired statements as below
drizzle> use somedb;
Readi...ng table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Schema changed
drizzle> create table tt(value boolean);
Query OK, 0 rows affected (0.002353 sec)
drizzle> desc tt;
+-------+---------+------+​---------+----------------​-+-----------+
| Field | Type | Null | Default | Default_is_NULL | On_Update |
+-------+---------+------+​---------+----------------​-+-----------+
| value | VARCHAR | YES | | YES | |
+-------+---------+------+​---------+----------------​-+-----------+
1 row in set (0.000679 sec)
drizzle>

WHY TYPE IS VARCHAR THOUGH DEFINED AS BOOLEAN

PS-> this is a major bug