I get an exception when trying to startup Hibernate 4.1.3
What can be the problem? I do not want map PK as Integer ids because i do not want to manually assign them after creating PK objects.
Code:
Code:
@Entity
@Data
public class Key1 {
@Id
private int id;
private String dataKey1;
}
@Entity
@Inheritance(strategy=InheritanceType.JOINED)
@Data
public class Base implements Serializable {
private static final long serialVersionUID = -687728638968459923L;
@Id
@ManyToOne
private Key1 key1;
private String dataBase;
}
@Entity
public class Child extends Base {
private static final long serialVersionUID = 1289037166773988611L;
}
Exception:
Code:
Caused by: java.util.NoSuchElementException
at java.util.AbstractList$Itr.next(Unknown Source)
at org.hibernate.internal.util.collections.JoinedIterator.next(JoinedIterator.java:76)
at org.hibernate.cfg.Ejb3JoinColumn.buildJoinColumn(Ejb3JoinColumn.java:323)
at org.hibernate.cfg.AnnotationBinder.makeInheritanceJoinColumns(AnnotationBinder.java:1126)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:565)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3435)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3389)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1341)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1731)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1782)
at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:189)
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:350)
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:335)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 38 more