-->
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.  [ 3 posts ] 
Author Message
 Post subject: Unable to find physical table: File
PostPosted: Tue Aug 22, 2006 8:48 am 
Newbie

Joined: Wed Dec 07, 2005 6:31 am
Posts: 9
Hello!

I'm converting a kind of complicated application to use hibernate+annotations for persistence. I'm stuck with the old classnames like "File" which creates some problems for me.

I can annotate it like this, avoiding reserved words conflicts :

Code:
@Entity
@Table(name = "`File`")
public class File ...


and it works nicely until I try to make a manytomany relation like this :

Code:
@ManyToMany(targetEntity=FileFolder.class )
@JoinTable(
   name="File_FileFolder",
   joinColumns={@JoinColumn(name="File_id")},
   inverseJoinColumns={@JoinColumn(name="FileFolder_id")}
)
private List virtualFolders;


What happens is I get an exception when creating my session factory :
Code:
org.hibernate.MappingException: Unable to find physical table: File
   at org.hibernate.cfg.Mappings.getLogicalTableName(Mappings.java:473)
   at org.hibernate.cfg.Mappings.getLogicalTableName(Mappings.java:520)
   at org.hibernate.cfg.annotations.CollectionBinder.bindManyToManySecondPass(CollectionBinder.java:866)
   at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:527)
   at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:468)
   at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:35)
   at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1049)
   at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:302)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1205)


It seems the relation somehow makes Hibernate forget that my File-class is mapped to `File`...

Any suggestions?

I'm using Hibernate version: 3.2.0cr3 + annotations 3.2.0cr1

_________________
OJ


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 24, 2006 12:53 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Please open a JIRA issue and add a rummable test case, that'll help me to spped up the fix

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Unable to find physical table: File
PostPosted: Thu Aug 24, 2006 5:22 am 
Newbie

Joined: Wed Dec 07, 2005 6:31 am
Posts: 9
Actually, on closer examination I see I'm using Hibernate 3.2.0 CR2, as that is the version supported by Annotations 3.2.0 CR1.

I realize this might be a duplicate of http://opensource.atlassian.com/projects/hibernate/browse/ANN-362 , but that is issue specified for One-To-many-relations only and PostgreSQL.

Anyway - JIRA-issue posted at
http://opensource.atlassian.com/projects/hibernate/browse/ANN-420

Cheers :)

_________________
OJ


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