I have ds like
And i want to use this DS in other DS with fields:
But then SQL is incorrect, i must to add table alias to customSelectExpression, like "case when t1.f = 1 then 5 else 6 end" How I can now table alias in customSelectExpression with velocity? I try to use
${dataSources.test.getTableName()} but it give me real table name 'test', not it alias in query. How I can do this? Thanks
Code:
<DataSource schema="public" serverType="sql" dbName="DemoDatabase" ID="test" tableName="test" > <fields> <field name="id" type="integer" hidden="true" primaryKey="true"></field> <field name="f" type="integer" hidden="true"></field> <field name="name" customSelectExpression="case when f = 1 then 5 else 6 end" length="2147483647" type="text"></field> </fields> </DataSource>
Code:
<field name="test1_id" foreignKey="test.id"></field> <field name="test2_id" foreignKey="test.id"></field> <field name="test1_name" includeFrom="test.name" includeVia="test1_id"></field> <field name="test2_name" includeFrom="test.name" includeVia="test2_id"></field>
${dataSources.test.getTableName()} but it give me real table name 'test', not it alias in query. How I can do this? Thanks
Comment