These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: @Column name with Capital and lower case letters ignored
PostPosted: Tue Sep 08, 2009 5:14 am 
Newbie

Joined: Tue Sep 08, 2009 5:04 am
Posts: 4
I'm trying to map an existing table to a Class. The table has only three columns: ID, content, lastUpdateAt.

I created a JPA Annotated class with three fields like:
Code:
@Entity
@Table(name = "keyvaluetable")
public class Property {
  @Id
  @Column(name = "ID", length = 50, nullable = false)
  private String key;

  @Lob
  @Column(name = "content", nullable = false)
  private String value;

  @Column(name = "lastUpdateAt", nullable = false)
  private Date lastUpdateDate;

  //Getter and setters...
}


When I tried to validate the schema hibernate was looking for column with name last_update_at. Changing the jpa annotation to @Column(name = "lastupdateat", nullable = false) the validation took place just fine.

I'm using Hibernate entity manager version 3.2.1.ga


Top
 Profile  
 
 Post subject: Re: @Column name with Capital and lower case letters ignored
PostPosted: Tue Sep 08, 2009 5:33 am 
Beginner
Beginner

Joined: Fri Jun 26, 2009 6:59 am
Posts: 23
what database are you using, include version please.


Top
 Profile  
 
 Post subject: Re: @Column name with Capital and lower case letters ignored
PostPosted: Tue Sep 08, 2009 7:54 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Can you see the SQL/DDL for table creation in the logs if you do a SchemaExport?

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject: Re: @Column name with Capital and lower case letters ignored
PostPosted: Wed Sep 09, 2009 10:42 am 
Newbie

Joined: Tue Sep 08, 2009 5:04 am
Posts: 4
Masterplan79th wrote:
what database are you using, include version please.

I'm using mssql 2008 express edition.


Top
 Profile  
 
 Post subject: Re: @Column name with Capital and lower case letters ignored
PostPosted: Thu Sep 10, 2009 10:54 am 
Newbie

Joined: Tue Sep 08, 2009 5:04 am
Posts: 4
Actually as I found an easy work around, the only reason to post here is to be sure that there isn't something wrong that I'm doing. If not, should I report a bug?


Top
 Profile  
 
 Post subject: Re: @Column name with Capital and lower case letters ignored
PostPosted: Thu Sep 10, 2009 11:24 am 
Beginner
Beginner

Joined: Fri Jun 26, 2009 6:59 am
Posts: 23
post your workaround first, people will be browsing ehre for solutions to their problems, these posts are monitored by google. so the more solutions there are the better.


Top
 Profile  
 
 Post subject: Re: @Column name with Capital and lower case letters ignored
PostPosted: Fri Sep 11, 2009 11:09 am 
Newbie

Joined: Tue Sep 08, 2009 5:04 am
Posts: 4
I think that it is clear at my first post. Instead of using the table's real (ex: xxYzzLkk) name at the column definition, I use the name in lowercase (ex: xxyzzlkk).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.