Hibernate version:
3.0 rc1
annotations-3.0-alpha3
Mapping documents:
Code:
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="hibernate.show_sql">true</property>
<mapping package="test"/>
<mapping class="test.Comment"/>
</session-factory>
</hibernate-configuration>
Code:
/**
* @Entity(access = AccessType.PROPERTY)
* @Table(name="comment")
*/
public class Comment
implements Serializable {
/**
* @return
* @Id(generate=GeneratorType.SEQUENCE, generator="comment_sequence")
*/
public Long getCommentId() {
return this.commentId;
}
}
Code between sessionFactory.openSession() and session.close():
NA
Full stack trace of any exception that occurs:
2005-03-09 09:58:58,062 [ hibernate.cfg.Environment] INFO - Hibernate 3.0rc1
2005-03-09 09:58:58,062 [ hibernate.cfg.Environment] INFO - hibernate.properties not found
2005-03-09 09:58:58,072 [ hibernate.cfg.Environment] INFO - using CGLIB reflection optimizer
2005-03-09 09:58:58,072 [ hibernate.cfg.Environment] INFO - using JDK 1.4 java.sql.Timestamp handling
2005-03-09 09:58:58,072 [ hibernate.cfg.Configuration] INFO - configuring from url: file:/D:/Development/Projects/min
d/src/webapp/WEB-INF/classes/hibernate.cfg.xml
2005-03-09 09:58:58,182 [te.cfg.AnnotationConfiguration] INFO - Mapping package test
2005-03-09 09:58:58,262 [hibernate.cfg.AnnotationBinder] WARN - Package not found or wo package-info.java: test
2005-03-09 09:58:58,262 [te.cfg.AnnotationConfiguration] INFO - Mapping class using metadata: test.Comment
2005-03-09 09:58:58,272 [te.cfg.AnnotationConfiguration] ERROR - Could not compile the mapping annotations
org.hibernate.AnnotationException: Annotated class should have an @Entity annotation: test.Comment
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:210)
at org.hibernate.cfg.AnnotationConfiguration.addAnnotatedClass(AnnotationConfiguration.java:44)
at org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(AnnotationConfiguration.java:182)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1353)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1335)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1302)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1245)
...
Name and version of the database you are using:
PostgreSQL 8
The generated SQL (show_sql=true):
na
I've compiled with both -srouce 1.5 and -target 1.5 using maven. Given how simple the instructions on the hibernate annotations page make it sound, I presume I havn't cimpiled with annotations (or something)...
I'm also curious about the message: "Package not found or wo package-info.java: test"...
Does anyone have any ideas?