Hibernate version:
3.2.5GA
Mapping documents:
Code:
@Entity
@Table(appliesTo="SessionInst",
indexes = {@Index(name="year_idx", columnNames="extract(year from dateChargement)")})
public class SessionInst {
...
}
Full stack trace of any exception that occurs:Code:
org.hibernate.MappingException: Unable to find column with logical name: SessionInst.extract(year from datechargement)
at org.hibernate.cfg.Mappings.getPhysicalColumnName(Mappings.java:493)
at org.hibernate.cfg.IndexSecondPass.addIndexToColumn(IndexSecondPass.java:49)
at org.hibernate.cfg.IndexSecondPass.doSecondPass(IndexSecondPass.java:39)
Name and version of the database you are using:Oracle 10g
QuestionIs it possible to declare an index built with an sql function ?
This declaration is valid in Oracle :
Code:
create index year_idx on SessionInst (extract(year from dateChargement));
How to declare it in hbm mapping ?