[hibernate-dev] Adding features to Dialect class
Steve Ebersole
steve at hibernate.org
Mon Apr 23 08:47:01 EDT 2012
Their better option is to apply a Type for String that handles this.
http://docs.jboss.org/hibernate/orm/4.1/manual/en-US/html_single/#types-registry
This is the type of thing we will be able to handle automatically in 5.0
But as for the forum user's exact question, personally I think him
expecting null and empty string *in the java model* to be handled
equally is just plain wrong.
P.S., these kinds of questions should be directed at the dev list so we
can get everyone's input.
On Mon 23 Apr 2012 07:39:19 AM CDT, Łukasz Antoniak wrote:
> If you are sure that only Oracle threads empty strings this way, then
> I will check if Oracle dialect is currently utilized.
> Issue: https://hibernate.onjira.com/browse/HHH-7246
>
> Regards,
> Lukasz
>
> W dniu 23 kwietnia 2012 14:00 użytkownik Steve Ebersole
> <steve at hibernate.org> napisał:
>> First, why do you need this?
>>
>> Second, they all distinguish between NULL and empty string. What Oracle
>> does that is odd is to instead write empty strings as NULL when inserting or
>> updating values.
>>
>>
>> On Mon 23 Apr 2012 01:59:25 AM CDT, Łukasz Antoniak wrote:
>>>
>>> Hello team,
>>>
>>> I would like to add the following method to abstract Dialect class:
>>>
>>> /**
>>> * Does this dialect distinguish between empty string and {@code NULL}
>>> value?
>>> *
>>> * @return {@code true} if the database does not thread {@code NULL}
>>> as an empty string; {@code false} otherwise.
>>> */
>>> public boolean supportsEmptyString() {
>>> return true;
>>> }
>>>
>>> I know that in Oracle dialect, it has to return false.
>>>
>>> Am I supposed to override it appropriately for other dialects before
>>> committing my changes?
>>> Any comments about naming? I couldn't come up with a better one.
>>>
>>> Regards,
>>> Lukasz
>>
>>
>> --
>> steve at hibernate.org
>> http://hibernate.org
--
steve at hibernate.org
http://hibernate.org
More information about the hibernate-dev
mailing list