Hi,

my use case is the following:

In a sub-entity I request rows from a database for an input list of
strings:
<entity name="prog" ...>
        <field name="vip" ...> /* multivalued, not required */
        <entity name="ssc_entry" dataSource="ssc" onError="continue"
                query="select SSC_VALUE from SSC_VALUE
                        where SSC_ATTRIBUTE_ID=1
                          and SSC_VALUE in (${prog.vip})">
                <field column="SSC_VALUE" name="vip_ssc" />
        </entity>
</entity>

The root entity is "prog" and it has an optional multivalued field
called "vip". When the list of "vip" values is empty, the SQL for the
sub-entity above throws an SQLException. (Working with Oracle which does
not allow an empty expression in the "in"-clause.)

Two things:
(A) best would be not to run the query whenever ${prog.vip} is null or
empty.
(B) From the documentation, it is not clear that onError is only checked
in the transformer runs but not checked when the SQL for the entity
throws an exception. (Trunk version JdbcDataSource lines 250pp).

IMHO, (A) is the better fix, and if so, (B) is the right decision. (If
(A) is not easily fixable, making (B) work would be helpful.)

Looking through the code, I've realized that the replacement of the
variables is done in a very generic way. I've not yet seen an
appropriate way to check on those variables in order to stop the
processing of the entity if the variable is empty.
Is there a way to do this? Or maybe there is a completely different way
to get my use case working. Any help most appreciated!

Thanks,
Chantal

Reply via email to