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.
|