[hibernate-dev] database names and identifier length

Steve Ebersole steve at hibernate.org
Sat Jul 25 15:18:04 EDT 2015


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