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?