-->
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.  [ 1 post ] 
Author Message
 Post subject: Exception and deadlock using backticks in column names
PostPosted: Thu Aug 13, 2009 4:40 am 
Newbie

Joined: Thu Aug 13, 2009 4:18 am
Posts: 1
Hi, i got 2 problems using backticks in column names, like this:

Table "Customers":
Code:
       @Id
   @Column(nullable=false, name="`Customer_ID`")
   private String customerId;

with

Other table:
Code:
   @ManyToOne(cascade={CascadeType.ALL})
   @JoinColumn(name="`Customer_ID`", referencedColumnName="`Customer_ID`", nullable=false)
   private Customer customer;


As you see, i use backticks enclosing the column names. if i dont use them, hsqldb will create the names in upper case.
All runs fine without these backticks. But with these backticks i get the following exception on init:

Code:
   ... 11 more
Caused by: org.hibernate.AnnotationException: Column name Customer_ID of foo.bar.entities.Customer not found in JoinColumns.referencedColumnName
   at org.hibernate.cfg.annotations.TableBinder.bindFk(TableBinder.java:319)
   at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:89)
   at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(AnnotationConfiguration.java:499)
   at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:304)
   at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1121)
   at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1225)
   at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:159)
   at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:854)
   at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:191)
   at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:253)
   ... 14 more


If i remove the backticks only in the "referencedColumnName" attribute, hibernate will hang forever on finding foreign keys.
I'm using latest stable Hibernate packages (core, annotations, entity-manager)

Did i miss something or is there a bug?


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

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.