-->
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: Annotation for auto-import="false"
PostPosted: Mon Sep 01, 2008 8:12 am 
Newbie

Joined: Tue Jul 29, 2008 10:09 am
Posts: 3
Hi,

In a mapping file it is possible to have:
[code]<hibernate-mapping auto-import="false">[/code]

Is there a way to have this as annotation?

Thanks, Michiel.


Top
 Profile  
 
 Post subject: name attribute of annotation @Entity is enough
PostPosted: Thu Nov 13, 2008 4:26 am 
Newbie

Joined: Thu Nov 13, 2008 3:57 am
Posts: 3
the auto-import="false" means that hibernate will use the full qualified name as the signature. So, you can add the name attribute to annotation Entity to achieve the same effect. For example:

for class in example.one.Sample, you config it as
Code:
@Entity(name="example.one.Sample")
...
public class Sample {
....
}


for class in example.two.sample, you config it as
Code:
@Entity(name="example.two.Sample")
...
public class Sample {
....
}


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 18, 2009 9:03 am 
Newbie

Joined: Thu Nov 06, 2008 10:42 am
Posts: 5
I am sure this would solve the issue, but I was wondering what if 3rd party jars are involved, where I cannot change the code.

I had an understanding two entities with same name may exists in different persistent-units. But this is not working in my case. Is my understanding incorrect or its a bug?

Please help. I have entity name "DomainValue" which I have and one more in a jar. The jar entity belongs to a different persistent unit, but still I am getting hibernate exception

duplicate import: DomainValue....

-Thanks and Regards


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.