-->
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.  [ 4 posts ] 
Author Message
 Post subject: Unable to find column with logical name:
PostPosted: Wed Jan 31, 2007 6:08 pm 
Newbie

Joined: Wed Jan 31, 2007 5:58 pm
Posts: 2
Location: New Zealand
Ok hear is the situation, I think this issue has been dealt with before but I couldn't find a satisfactory answer.

I have two entities both entities use a composite primary key (MyPK.class)

entity B inherits from A

Code:
  //pk->MyPK.class
  //discriminator = 'A'
  class A {
    private id1;
    private id2;
  }
 
  //discriminator='B'
  //pk->MyPK.class
  //primary key join columns( joinCol id1 references id1, joinCol id2 references id2);
  class B extends A{
  }


This is where my problem is:
Code:
org.hibernate.MappingException:
Unable to find column with logical name: id2 in A


from what i can see i have the column its even there in the database table, anyone?, please??

_________________
"For the time will come when they will not endure sound doctrine; but wanting their ears tickled, they will accumulate for themselves teachers in accordance to their own desires" 2 Timothy 4:3


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 31, 2007 6:15 pm 
Regular
Regular

Joined: Mon Nov 14, 2005 7:33 pm
Posts: 73
I've hit this snag several times but you have not provided enough code for me to point out what you're doing wrong, so I can only guess.

See if this has anything to do w/ it:

http://opensource.atlassian.com/project ... se/ANN-548

You'll notice at the bottom there's a link to the thread that lead to the JIRA issue.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 01, 2007 1:13 am 
Newbie

Joined: Wed Jan 31, 2007 5:58 pm
Posts: 2
Location: New Zealand
Ok in my effort to go down to the bottom of this problem i made two discoveries:

1. The problem is not only with @PrimaryKeyColumns annotations or at least from what i found out.
I removed all the classes in my persistence unit and started adding them one by one startiing with simple ones, and before I only added two classes and i got the same error, the problem was this:
Code:
uniqueConstraints={@UniqueConstraint(columnNames={"RealmID","EntityName"})

for some reasons beyond my understanding hibernate doesn't like that annotation or at least if there are more than one columns, this was working fine with toplink + glassfish, please tell it got to be a bug.

2. second problem is this:

Code:
@GeneratedValue(strategy=GenerationType.IDENTITY,generator="RealmTypeSequence")
  @javax.persistence.SequenceGenerator(name="RealmTypeSequence",sequenceName="realmtypeseq", allocationSize=5)
  @Column(name="RealmTypeID",nullable=false,insertable=true,updatable=false)


these annotations are somewhat ignored, hibernate looks for the following sequence realmtype_realmtypeid_seq i'm on PostgreSQL 8.1 i dont want it to dictate what sequence name i should use, i want to to follow my instruction and use the sequence here in the annotation.

are these bugs or iam just missing something...

_________________
"For the time will come when they will not endure sound doctrine; but wanting their ears tickled, they will accumulate for themselves teachers in accordance to their own desires" 2 Timothy 4:3


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 03, 2007 7:28 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
For 1. please show your domain model.
for 2, aren't you using a different naming strategy? This could also explain 1 BTW

_________________
Emmanuel


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