-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: How to declare an index with an sql function
PostPosted: Wed Mar 19, 2008 11:35 am 
Newbie

Joined: Wed Mar 19, 2008 11:19 am
Posts: 1
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

Question
Is 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 ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.