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: Problem with a Formula definition
PostPosted: Tue Oct 30, 2007 10:47 am 
Newbie

Joined: Tue Oct 30, 2007 10:16 am
Posts: 1
We are working on Oracle9i and our mapping is made with annotations.

We want create a new attribute in our mapping which is defined by this formula

@Formula(value="(select "+
" concat(concat(concat('CONTRATADAS:',cont.CONTRATADAS),concat(',PLANIFICADAS:', cont.PLANIFICADAS)),concat(concat(',EJECUTADAS:', cont.EJECUTADAS),concat(',DISPONIBLES:', cont.DISPONIBLES)))" +
" from table(cast(gnomo.gn_prevencion.horas_contrato(18642,1,1,null) AS GNOMO.GN_TAB_HORAS_CONTRATO_PRV)) as cont " +
" )")

When we request for an object, hibernate translating from hql to sql inserts an alias before "cont",generating an invalid query and throwing this error: "missing right parentesis".
We have tried to solve this issue, overwriting Oracle9iDialect class, coding this :

public OracleDialectCustom() {
super();
registerFunction("cast", new StandardSQLFunction("cast") );
registerFunction("table", new StandardSQLFunction("table") );
}

But the error remains.


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.