Hello.
I am getting this error
Code:
org.hibernate.MappingException: persistent class not known: long
at org.hibernate.cfg.Configuration$1.getIdentifierType(Configuration.java:2109)
at org.hibernate.type.EntityType.getIdentifierType(EntityType.java:487)
at org.hibernate.type.EntityType.getIdentifierOrUniqueKeyType(EntityType.java:512)
at org.hibernate.persister.entity.AbstractPropertyMapping.initIdentifierPropertyPaths(AbstractPropertyMapping.java:169)
at org.hibernate.persister.entity.AbstractPropertyMapping.initPropertyPaths(AbstractPropertyMapping.java:159)
at org.hibernate.persister.entity.AbstractEntityPersister.initOrdinaryPropertyPaths(AbstractEntityPersister.java:1712)
at org.hibernate.persister.entity.AbstractEntityPersister.initPropertyPaths(AbstractEntityPersister.java:1742)
at org.hibernate.persister.entity.AbstractEntityPersister.postConstruct(AbstractEntityPersister.java:2919)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:409)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
...
I am using annotations on the getters like this
Code:
@Id
@GeneratedValue
public Long getId() {
return id_;
}
and have the class mapped in cfg.
Code:
<mapping class="entity.Application"></mapping>
I don't know if I have missed anything that is needed?
I initially had the id as
long when I got the error and then changed it to
Long but the message stayed the same after
mvn clean.
Thanks.