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.  [ 2 posts ] 
Author Message
 Post subject: formula propriété calculée
PostPosted: Mon Jul 30, 2007 3:30 am 
Newbie

Joined: Sat May 27, 2006 4:39 am
Posts: 2
Bonjour,

Je cherche a calculer une propriété (non persistante) "rank" en fonction d'une propriété (persistante) "score".

J'utilise donc formula, voici mon fichier de mapping:

Code:
<property name="score" column="score" type="int" not-null="true" /> <property name="rank" type="int" >
    <formula>
        (SELECT rank() OVER (ORDER BY score DESC) FROM team       
        link where link.id = id)
    </formula>
</property>



J'obtiens l'erreur suivante à l'initialisation d'Hibernate :

Quote:
ORA-30484: missing window specification for this function


J'ai également essayé avec le mapping suivant mais ça ne fonctionne pas mieux :

Code:
<property name="rank" type="int" formula="row_number() OVER (ORDER BY score DESC)" />


Quelqu'un a-t-il une idée ?
Merci d'avance.


Top
 Profile  
 
 Post subject: formula
PostPosted: Fri Aug 03, 2007 3:43 am 
Beginner
Beginner

Joined: Wed Oct 25, 2006 9:05 am
Posts: 40
Location: France, Lieusaint
Attention , si votre base est ORACLE
de bien mettre l'identifiant du schéma devant le nom de la table:

si par exemple le nom du schéma est MYSCHEMA :
Code:
select rank() from MYSCHEMA.TEAM


HTH
nb: n'oubliez pas de créditer


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

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.