-->
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: Hibernate annotations
PostPosted: Sat Jul 16, 2005 10:23 pm 
Beginner
Beginner

Joined: Tue Dec 21, 2004 11:53 am
Posts: 42
Hibernate version:
3.0.5


I'm using annotations for the first time and I've followed the instructions on:
http://www.hibernate.org/hib_docs/annot ... figuration

I have an hibernate.cfg.xml:
<hibernate-configuration>
<session-factory>
<property name="connection.datasource">java:comp/env/jdbc/tcrud</property>
<property name="useOuterJoin">true</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">true</property>
<mapping package="com.cs.persistence"></mapping>
</session-factory>
</hibernate-configuration>

but when building the session factory I get this warning:
WARN main org.hibernate.cfg.AnnotationBinder - Package not found or wo package-info.java: com.cs.persistence

but the package with all the persistent classes are there, believe me ;)

the classes lies inside subpackages, does it matter??

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 17, 2005 3:52 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
package does not mean that all classes inside this package will be discovered.
It means that the package annotations will be read. Package annotations are in a class named package-info.java

You have to add your classes manually using
<mapping class="org.hibernate.test.annotations.Plane"/>

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 20, 2005 5:38 pm 
Beginner
Beginner

Joined: Sat Sep 17, 2005 10:41 am
Posts: 49
I ran into the same problem, misunderstanding what <mapping package=""/> meant.

That said, is there a way to avoid specifying each hibernate-annotated class by hand in the hibernate.cfg.xml file?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 21, 2005 5:41 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
use Hibernate Entity Manager and a par archive

_________________
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.