II upgraded today to the latest versions of hibernate & annotations. This code worked with 3.1beta3 but now it complains about a missing @Enitity annotation that is already there. Any ideas. Is it because I have rc2 ?
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.1rc2 annotations beta6
Mapping documents:
package eiswind.paris.model;
import javax.persistence.Entity;
import javax.persistence.GeneratorType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.hibernate.annotations.Where;
import org.hibernate.validator.Length;
@Entity
@Where(clause="valid = "+BaseEntity.TRUE)
@NamedQuery(name = "Category.list", queryString = "select c from Category c where c.categoryGroup.systemId = :systemId")
@Table(uniqueConstraints = { @UniqueConstraint(columnNames = {"categoryGroup_id", "name","validUntil" }) })
public class Category extends BaseEntity {
....
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Caused by: org.hibernate.AnnotationException: Annotated class should have a @javax.persistence.Entity, @javax.persistence.Embeddable or @javax.persistence.EmbeddedSuperclass annotation: eiswind.paris.model.Category
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:334)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:256)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:191)
at org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:638)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:94)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:62)
at eiswind.paris.application.HibernateUtil$1.run(HibernateUtil.java:44)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: