Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (53 sloc) 1.44 KB
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="../xsl/model-data-dalc.xsl" output-file="../common/_generated_data-dalc.xml.config"?>
<model xmlns="urn:schemas-nreco:data:dalc:v2">
<db-dalc name="db">
<driver>
<sqlite>
<connection>
<ref name="dbConnectionString"/>
</connection>
</sqlite>
</driver>
<permissions>
<!--rule operation="select" table="users">
<match>
<view>users_view</view>
</match>
<condition>country_id="2":int32</condition>
</rule-->
</permissions>
<dataviews>
<view name="users_view">
<fields>
<select>u.*, c.name as country_name</select>
<mapping>
<field name="id">u.id</field>
<field name="country_name">c.name</field>
</mapping>
</fields>
<sql>
SELECT @SqlFields
FROM users u
LEFT JOIN lookup_countries c ON (c.id=u.country_id)
@SqlWhere[where {0}]
@SqlOrderBy[order by {0}]
</sql>
</view>
</dataviews>
<triggers>
<datarow action="any">
<handler name="dataSchemaDataRowTriggerHandler"/>
</datarow>
</triggers>
</db-dalc>
<datarow-mapper name="dbDataRowMapper" dalc="db" datasetfactory="dataSetFactory"/>
<provider name="getAllUsers" dalc="db" result="recordlist">
<relex>
users_view[*;country_name]
</relex>
</provider>
<provider name="getUsaUsersCount" dalc="db" result="value">
<relex>users(country_id="1":int32)[count(*)]</relex>
</provider>
</model>