dbTalk Databases Forums  

Relation names with capital letters in Hibernate?

comp.databases.postgresql comp.databases.postgresql


Discuss Relation names with capital letters in Hibernate? in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jaroslav Záruba
 
Posts: n/a

Default Relation names with capital letters in Hibernate? - 11-30-2009 , 11:26 PM






When I use capital letter(s) in table or view name Hibernate complains
it can't find the relation.
Is this known issue or am I doing something wrong?

JZ

Reply With Quote
  #2  
Old   
Marco Mariani
 
Posts: n/a

Default Re: Relation names with capital letters in Hibernate? - 12-01-2009 , 04:41 AM






Jaroslav Záruba wrote:

Quote:
When I use capital letter(s) in table or view name Hibernate complains
it can't find the relation.
Is this known issue or am I doing something wrong?
Yes, using capital letters in table or view, or column or whatever
identifiers is sinful and wrong.

Reply With Quote
  #3  
Old   
Laurenz Albe
 
Posts: n/a

Default Re: Relation names with capital letters in Hibernate? - 12-01-2009 , 05:20 AM



Marco Mariani wrote:
Quote:
Jaroslav Záruba wrote:
When I use capital letter(s) in table or view name Hibernate complains
it can't find the relation.
Is this known issue or am I doing something wrong?

Yes, using capital letters in table or view, or column or whatever identifiers is sinful and wrong.
You are saying that the SQL standard is sinful and wrong.
That's not PostgreSQL's position.

To the original question:
PostgreSQL folds all names to lower case unless you surround them
with double quotes. I don't know how this can be done in Hibernate,
but it would be the solution.

Yours,
Laurenz Albe

Reply With Quote
  #4  
Old   
Marco Mariani
 
Posts: n/a

Default Re: Relation names with capital letters in Hibernate? - 12-01-2009 , 05:36 AM



Laurenz Albe wrote:

Quote:
Yes, using capital letters in table or view, or column or whatever identifiers is sinful and wrong.

You are saying that the SQL standard is sinful and wrong.
Would that be blasphemous? :-)

Actually, I was meaning that using upper/mixed case as identifiers is
bad practice.

Reply With Quote
  #5  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: Relation names with capital letters in Hibernate? - 12-01-2009 , 12:01 PM



On Tue, 01 Dec 2009 12:20:59 +0100, Laurenz Albe wrote:

Quote:
Marco Mariani wrote:
Jaroslav Záruba wrote:
When I use capital letter(s) in table or view name Hibernate complains
it can't find the relation.
Is this known issue or am I doing something wrong?

Yes, using capital letters in table or view, or column or whatever
identifiers is sinful and wrong.

You are saying that the SQL standard is sinful and wrong. That's not
PostgreSQL's position.
But it can condemn your immortal soul to MySQL for all eternity.



--
http://mgogala.byethost5.com

Reply With Quote
  #6  
Old   
Jaroslav Záruba
 
Posts: n/a

Default Re: Relation names with capital letters in Hibernate? - 12-09-2009 , 10:49 AM



On Dec 1, 12:20*pm, "Laurenz Albe" <inv... (AT) spam (DOT) to.invalid> wrote:
Quote:
Marco Mariani wrote:
Jaroslav Záruba wrote:
When I use capital letter(s) in table or view name Hibernate complains
it can't find the relation.
Is this known issue or am I doing something wrong?

Yes, using capital letters in table or view, or column or whatever identifiers is sinful and wrong.

You are saying that the SQL standard is sinful and wrong.
That's not PostgreSQL's position.

To the original question:
PostgreSQL folds all names to lower case unless you surround them
with double quotes. I don't know how this can be done in Hibernate,
but it would be the solution.
Yes, I'm aware of that PostgresSQL's behaviour.
I hoped someone with Hibernate experience would shed some light on
this. Like whether this is known bug, and who is the one blame -
Hibernate or the PostgreSQL driver?

Quote:
Yours,
Laurenz Albe
Cheers
Jarda

Reply With Quote
  #7  
Old   
Jaroslav Záruba
 
Posts: n/a

Default Re: Relation names with capital letters in Hibernate? - 12-09-2009 , 10:51 AM



On Dec 1, 11:41*am, Marco Mariani <ma... (AT) sferacarta (DOT) com> wrote:
Quote:
Jaroslav Z ruba wrote:
When I use capital letter(s) in table or view name Hibernate complains
it can't find the relation.
Is this known issue or am I doing something wrong?

Yes, using capital letters in table or view, or column or whatever
identifiers is sinful and wrong.
In my opinion "sinful and wrong" is case-insensitivity.

Reply With Quote
  #8  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: Relation names with capital letters in Hibernate? - 12-09-2009 , 12:48 PM



On Wed, 09 Dec 2009 08:49:46 -0800, Jaroslav Záruba wrote:


Quote:
Yes, I'm aware of that PostgresSQL's behaviour. I hoped someone with
Hibernate experience would shed some light on this.
Like whether this is known bug,
Nope, it's an expected behavior. PostgreSQL can use tables with capital
letters, only enclosed in double quotes.

Quote:
and who is the one blame - Hibernate or the PostgreSQLdriver?
Why, Hibernate of course! This is a PostgreSQL forum, after all. There is
no blame in this case, though. You'll just have to rewrite your queries.




--
http://mgogala.byethost5.com

Reply With Quote
  #9  
Old   
Jaroslav Záruba
 
Posts: n/a

Default Re: Relation names with capital letters in Hibernate? - 12-10-2009 , 01:28 AM



On Dec 9, 7:48*pm, Mladen Gogala <n... (AT) email (DOT) here.invalid> wrote:
Quote:
On Wed, 09 Dec 2009 08:49:46 -0800, Jaroslav Záruba wrote:
Yes, I'm aware of that PostgresSQL's behaviour. I hoped someone with
Hibernate experience would shed some light on this.
Like whether this is known bug,

Nope, it's an expected behavior. PostgreSQL can use tables with capital
letters, only enclosed in double quotes.

and who is the one blame - Hibernate or the PostgreSQLdriver?

Why, Hibernate of course! This is a PostgreSQL forum, after all. There is
no blame in this case, though. *You'll just have to rewrite your queries.

--http://mgogala.byethost5.com
How can Irewrite my queries when I do not write any at all?

Reply With Quote
  #10  
Old   
Jaroslav Záruba
 
Posts: n/a

Default Re: Relation names with capital letters in Hibernate? - 12-10-2009 , 02:12 AM



On Dec 9, 7:48*pm, Mladen Gogala <n... (AT) email (DOT) here.invalid> wrote:
Quote:
On Wed, 09 Dec 2009 08:49:46 -0800, Jaroslav Záruba wrote:
Yes, I'm aware of that PostgresSQL's behaviour. I hoped someone with
Hibernate experience would shed some light on this.
Like whether this is known bug,

Nope, it's an expected behavior. PostgreSQL can use tables with capital
letters, only enclosed in double quotes.
I don't think it is expected behaviour to get an error message when
you write the relation name properly. One would expect things to work
- i.e. to to enclose relation name within quotes if needed for a
particular db-system.

When speaking about bug I mean bug somewhere in the communication
between Hibernate and PostgreSQL - which also involves the driver. So
either Hibernate or the driver can be blamed for omitting the
enclosing chars.

Purpose of my post was to ask users experienced with Hibernate
+PostgreSQL whether this is known bug (yes, bug) or whether there is
some ?hidden? switch/option that would force Hibernate or the driver
to use the enclosing chars.

Quote:
and who is the one blame - Hibernate or the PostgreSQLdriver?

Why, Hibernate of course! This is a PostgreSQL forum, after all. There is
no blame in this case, though. *You'll just have to rewrite your queries.
How can I rewrite my queries when I do not write any at all?

> --http://mgogala.byethost5.com

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.