Specification of table @Table name with quotes using backticks fails with @OneToMany mapping
--------------------------------------------------------------------------------------------
Key: ANN-362
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-362
Project: Hibernate Annotations
Type: Bug
Versions: 3.2.0.cr1
Environment: Tomcat 5.5
JDK 1.5.0_05-b05 (Win32)
PostgreSQL 8.1
Reporter: Niko Horn
Priority: Blocker
Scenario:
Simple one-to-many mapping (1 User has n Roles)
User-Class:
@Entity()
@Table(name = "`Users`")
public class User
[...]
@OneToMany
@JoinTable
(
name = "UserRoles",
joinColumns = { @JoinColumn( name="userId") },
inverseJoinColumns = @JoinColumn( name="roleId")
)
private Set<Role> roles;
[...]
Role-Class:
@Entity
@Table(name = "`Roles`")
public class Role
[...]
If the User-Table name is given with backticks (for neccessary quotes in PostgreSQL if capitals are used), Tomcat starts with exception
org.hibernate.MappingException: Unable to find physical table: Users
The problem is in Class org.cfg.hibernate.mappings in the Method getLogicalTableName(). The generated key variable
String key = buildTableNameKey( schema, catalog, physicalName );
does not contain the neccessary backticks to determine the value from the tableNameBinding HashMap.
A fast fix would be nice :-)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
|