У меня есть сущность с 2 идентификаторами, а одна имеет аннотацию @JoinColumnsOrFormulas
@AccessType("property")
@Id
@NotFound(action=NotFoundAction.IGNORE)
@ManyToOne(optional = false, fetch = FetchType.LAZY)
@JoinColumnsOrFormulas({
@JoinColumnOrFormula( column=@JoinColumn(name="RE", referencedColumnName="ret")),
@JoinColumnOrFormula( formula=@JoinFormula(value="ret2", referencedColumnName="rete"))
})
@Fetch(FetchMode.SELECT)
private rete ret;
но выдает исключение:
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource... Invocation of init method failed; nested exception is java.lang.ClassCastException: org.hibernate.mapping.Formula cannot be cast to org.hibernate.mapping.Column
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:502)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:282)
Невозможно @id аннотации с @JoinColumnsOrFormulas ???