[hibernate-dev] database names and identifier length

Sanne Grinovero sanne at hibernate.org
Sun Jul 26 03:19:27 EDT 2015


Thanks, got it now. Yes I think that would have value; my impression
is that taking care of such things is a general expectations among
users.
In case it had to truncate[shorten?] identifier names we'd also need
to make sure that doesn't introduce ambiguities with other column
names, and - as a user - I'd expect a warning to be logged.

Thanks,
Sanne


On 25 July 2015 at 22:18, Steve Ebersole <steve at hibernate.org> wrote:
> He is talking about native (sql) queries.  If a user defines a native query
> using his example column name
> MY_SUPER_AWESOME_COLUMN_NAME_CANT_ALWAYS_BE_USED, then when we replace that
> because they deploy on to "database product X" which limits identifier
> lengths to 10... he worries that the users query now fails.  But of course
> he glosses over the fact that the app would not work on "database product X"
> with or without this change because "database product X" simply would not
> support a column named MY_SUPER_AWESOME_COLUMN_NAME_CANT_ALWAYS_BE_USED
> (from say a mapping).
>
> I think in general the idea of trying to combine native sql queries and
> database portability is just asking for trouble.
>
> On Sat, Jul 25, 2015 at 1:23 PM Sanne Grinovero <sanne at hibernate.org> wrote:
>>
>> Hi Max, could you make an example please?
>> Looks like you are interpreting Steve's email in a different way than me.
>>
>> On 24 Jul 2015 21:43, "Max Rydahl Andersen" <manderse at redhat.com> wrote:
>>>
>>> On 24 Jul 2015, at 16:48, Steve Ebersole wrote:
>>>
>>> > Do we want to consider automatically applying known database limits on
>>> > various identifier lengths?  This is trickier to implement than it
>>> > might
>>> > sound.  And it would definitely need to wait for the reworking of
>>> > annotation binding.  But in general I wonder if y'all see this as a
>>> > desirable feature.  And if so, should that be just for implicit names?
>>> >  Or
>>> > explicit names as well?
>>>
>>> I could see it be valuable for easier cross db testing, but all users
>>> custom queries
>>> would be easily broken unless you have something very deterministic.
>>>
>>> If we do it think I as a user would prefer at least get a warning or be
>>> able to turn on "strict" mode
>>> to catch issues where  I did not realise
>>> "MY_SUPER_AWESOME_COLUMN_NAME_CANT_ALWAYS_BE_USED".
>>>
>>> /max
>>> http://about.me/maxandersen
>>>
>>> _______________________________________________
>>> hibernate-dev mailing list
>>> hibernate-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/hibernate-dev


More information about the hibernate-dev mailing list