[hibernate-issues] [Hibernate-JIRA] Commented: (EJB-161) mappedBy and quotes ("") in the @ManyToMany

Emmanuel Bernard (JIRA) noreply at atlassian.com
Mon Aug 28 21:36:24 EDT 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/EJB-161?page=comments#action_24193 ] 

Emmanuel Bernard commented on EJB-161:
--------------------------------------

` backticks is the way to go BTW

> mappedBy and quotes ("") in the @ManyToMany
> -------------------------------------------
>
>          Key: EJB-161
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-161
>      Project: Hibernate Entity Manager
>         Type: Bug

>   Components: EntityManager
>     Versions: 3.1beta3
>  Environment: DataBase FireBird 2.0 (JayBird-2.0.1JDK_1.5)
>     Reporter: Vladimir Bronnikov

>
>
> Have a problem. Possible it's a Hibernate bug (error): 
> ... I'm using DataBase FireBird (Dialect 3). I'm using a lowcase latters for naming columns... Name of column put (enclose) into quotes ( for example "role_id"). 
> In Java I'm writing: (for example "\"atn_rule\""): 
> @Entity (access = AccessType.FIELD) 
> @Table (name = "\"atn_rule\"") 
> @SequenceGenerator (name = "rule.id", sequenceName = "\"rule_id_g\"") 
> public class Rule implements Serializable { 
>     private static final long serialVersionUID = 7418346480207570210L; 
>     
>     @Id (generate = GeneratorType.SEQUENCE, generator = "rule.id") 
>     @Column (name = "\"id\"") 
>     private Integer id; 
>     
>     @ManyToMany (fetch = FetchType.LAZY) 
>     @JoinTable ( 
>             table = @Table (name = "\"atn_principal_permission\""), 
>             joinColumns = @JoinColumn ( 
>                     name = "\"rule_id\"", 
>                     referencedColumnName = "id" 
>             ), 
>             inverseJoinColumns = @JoinColumn ( 
>                     name = "\"principal_id\"", 
>                     referencedColumnName = "id" 
>             ) 
>     ) 
>     private List<Role> roles; 
> }	
> @Entity (access = AccessType.FIELD) 
> @Table (name ="\"atn_principal\"") 
> @SequenceGenerator (name = "principal.id", sequenceName = "\"principal_id_g\"") 
> public class Role extends AbstractEntity implements Serializable { 
>     private static final long serialVersionUID = -8655514511640110474L; 
>     @Id (generate = GeneratorType.SEQUENCE, generator = "principal.id") 
>     @Column (name = "\"id\"") 
>     private Integer id; 
>     
>     @ManyToMany (mappedBy = "roles") 
>     private List<Rule> rules; 
> }	
> After execution this: role.rules FireBird send error: 
> SQL error code = -206 
> Column unknown 
> RULES0_.RULE_ID 
> i.e. instead of RULES0_."rule_id" name of column change to upper case. However rule.roles have no errors.
> P.S. I'm also use back quote `atn_rule` with the same result.

-- 
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




More information about the hibernate-issues mailing list