-->
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: org.hibernate.annotations.* OR javax.persistence.*
PostPosted: Fri Feb 10, 2006 1:15 am 
Newbie

Joined: Thu Mar 17, 2005 4:57 am
Posts: 4
Hi, whenever i import annotations from org.hibernate.annotations.* my application throws Unknown Entitiy exception.

Code:
import javax.persistence.Id;
import org.hibernate.annotations.Entity;
import org.hibernate.annotations.Table;

@Entity()
@Table(name="company")
public class Company {


And the exception thrown is:
Code:
2006-02-10 10:58:07,843 [http-8080-Processor25] ERROR com.yamanyar.manager.buss.cm.CompanyOperationsLibrary - org.hibernate.MappingException: Unknown entity: com.yamanyar.manager.entities.Company


But if I import from javax.persistence.* everything works fine:

Code:
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity()
@Table(name="company")
public class Company {


What is the difference? Which one should be used when? In tutorial of hibernate, import statements are not shown...

_________________
Kaan Yamanyar


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2006 7:17 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
always import javax.persistence.Entity
org.hibernate.annotations.Entity complements javax.persistence.Entity but is not a replacement

_________________
Emmanuel


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.