<config for="DbProxyDemo">
<!-- Connection data for class DbProxyDemo -->
<param>
<name>connection</name>
<type>array</type>
<value>
<item key="dbName" type="string">DbProxyDemo</item>
<item key="dbHost" type="string">localhost</item>
<item key="dbUser" type="string">test</item>
<item key="dbPassword" type="string">1234</item>
</value>
</param>
<!-- Create the 'employees' demo table: -->
<param>
<name>createDemoTable</name>
<type>array</type>
<value>
<item key="queryParams" type="string">
MALE, FEMALE
</item>
<item key="queryTemplate">
<![CDATA[
create table if not exists `employees` (
`uid` int not null auto_increment,
`firstName` varchar(255) not null,
`middleName` varchar(255) default null,
`lastName` varchar(255) not null,
`age` int not null,
`sex` enum('%MALE%','%FEMALE%') not null,
`job` varchar(255) not null,
`salary` int not null,
primary key (`uid`)
);
]]>
</item>
<item key="queryResultType" type="string">null</item>
</value>
</param>
<!-- List all entries: -->
<param>
<name>getEmployees</name>
<type>array</type>
<value>
<item key="queryParams" type="null" />
<item key="queryTemplate">
<![CDATA[
select * from `employees`;
]]>
</item>
<item key="queryResultType" type="string">array</item>
</value>
</param>
<!-- Add a new entry: -->
<param>
<name>addEmployee</name>
<type>array</type>
<value>
<item key="queryParams" type="string">
FIRST_NAME, MIDDLE_NAME, LAST_NAME, AGE, SEX, JOB, SALARY
</item>
<item key="queryTemplate">
<![CDATA[
insert into `employees` (
`firstName`,
`middleName`,
`lastName`,
`age`,
`sex`,
`job`,
`salary`
) values (
"%FIRST_NAME%",
"%MIDDLE_NAME%",
"%LAST_NAME%",
%AGE%,
"%SEX%",
"%JOB%",
%SALARY%
);
]]>
</item>
<item key="queryResultType" type="string">null</item>
</value>
</param>
</config> |