Ok,
I found a way to do this, but it seems like a bit of a hack to me - I think Hibernate probably supports a more elegant mechanism, I just can't figure out what it is.
Basically, I make my custom user type return a non-standard, made-up value from it's "public int[] sqlTypes()" method.
Then in my custom Dialect subclass, in this constructor, I call the "registerColumnType()" method passing my special SQL code and the database column declaration I want used ("decimal 12, 2", for example);
This seems pretty dodgy, I'm binding my Dialect to my custom UserTypes pretty heavily.
It seems like Hibernate pretty much supports this kind of behaviour, I just seem to be missing the part where you hook up the custom user type to the dialect in a more robust way.
Is there something I've missed - or this pretty much the accepted way to do it?
_________________ Cheers,
Shorn.
|