-->
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: org.hibernate.HibernateException: Missing column:
PostPosted: Thu Oct 07, 2010 1:57 am 
Newbie

Joined: Tue Sep 21, 2010 1:09 am
Posts: 2
Hello,

I have a table with two columns. the columns are fk for another tables.

I annotated @ManytoOne to both tables, hibernate says the column is missing for only one column (USER_DEPT_ID). but both columns exist.

If I annotate just one table (PRIVILEGE_ID), no error is thrown.

Thanks for any help.


Code:

private Long id;
   private UserDeptMap userDept;
   private Privilege privilege;
   
   
    @Id @GeneratedValue(strategy = GenerationType.AUTO)
   @Column(name="ID")
   public Long getId() {
      return id;
   }
   
        public void setId(Long id){
        this.id = id;
     }
     
   @ManyToOne()
   @JoinColumn(name="USER_DEPT_ID")
   public UserDeptMap getUserDept() {
      return userDept;
   }

   
   public void setUserDept(UserDeptMap userDept) {
      this.userDept = userDept;
   }

   @ManyToOne()
   @JoinColumn(name="PRIVILEGE_ID")
   public Privilege getPrivilege() {
      return privilege;
   }

   public void setPrivilege(Privilege privilege) {
      this.privilege = privilege;
   }



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.