-->
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.  [ 2 posts ] 
Author Message
 Post subject: mappedBy and quotes ("") in the @ManyToMany
PostPosted: Wed Apr 12, 2006 2:42 am 
Newbie

Joined: Tue Apr 11, 2006 7:27 am
Posts: 3
Hello...

I'm sorry for my English... =))

Have a problem. Possible it's a Hibernate 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\""):
Code:
@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;
}


Code:
@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.

Have any ideas?
What I need to do for "Hibernate developer" correct this mistake (error)?


Top
 Profile  
 
 Post subject: Double...
PostPosted: Wed Apr 12, 2006 7:26 am 
Newbie

Joined: Tue Apr 11, 2006 7:27 am
Posts: 3
Any body can help me?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.