<object xmlns="http://www.cmobilecom.com/af/objects" type="entity">
<entityType>HR.EMP</entityType>
<mode>VIEW</mode>
<criteriaElements>
<function name="EQ" property="nid">100</function>
</criteriaElements>
<viewConfig>
<viewType>ENTITY</viewType>
</viewConfig>
</object>
<object xmlns="http://www.cmobilecom.com/af/objects"
id="queryEmployees" type="entity">
<entityType>HR.EMP</entityType>
<criteriaElements>
<function name="EQ" property="type">FULL_TIME</function>
</criteriaElements>
<viewConfig>
<viewType>QUERY</viewType>
<propertiesToHide>type</propertiesToHide>
</viewConfig>
</object>
Query supports search options such as group by and order by properties. For example,
retrieve sum(order.total) group by customer, and order by customer(ascending)
and sum(order.total) (descending).
<object xmlns="http://www.cmobilecom.com/af/objects"
id="queryOrders" type="entity">
<entityType>Sales.SO</entityType>
<criteriaElements>
<function name="IS_NOT_NULL" property="payment"></function>
</criteriaElements>
<searchOptions>
<groupBy>customer</groupBy>
<asc property="customer"/>
<desc property="total"/>
</searchOptions>
<viewConfig>
<viewType>QUERY</viewType>
<showSearchOptions>false</showSearchOptions>
<viewConfig name="queryResults">
<viewType>ENTITY_LIST_WIDE</viewType>
</viewConfig>
</viewConfig>
</object>
Order.total is a statistics property(SUM), and "order by total" is actually order by
sum(order.total) for group-by query. Refer to
Entity Backing Bean on Statistics Properties.
<object xmlns="http://www.cmobilecom.com/af/objects"
id="createExpenseClaim" type="entity">
<entityType>HR.EC</entityType>
<mode>CREATE</mode>
<criteriaElements>
<function name="EQ" property="expenseClaimItems">
<expenseClaimItem>
<code>00</code>
<expense>200.00</expense>
</expenseClaimItem>
<expenseClaimItem>
<code>01</code>
<expense>300.00</expense>
</expenseClaimItem>
</function>
</criteriaElements>
<viewConfig>
<viewType>ENTITY</viewType>
</viewConfig>
</object>
<viewConfig>
<viewType>ENTITY</viewType>
<param name="entity.not.found" value="ignore" />
</viewConfig>
Parameter: entity.not.found. (default: error)
If present, show the specified message instead of the default message if the entity is not found. The message will be shown even if the value of the parameter entity.not.found is ignore.
Page: /createExpenseClaim.xpg
<object xmlns="http://www.cmobilecom.com/af/objects"
id="checkEmployee" type="entity">
<entityType>HR.EMP</entityType>
<mode>VIEW</mode>
<criteriaElements>
<function name="EQ" property="user">#{current_user}</function>
</criteriaElements>
<viewConfig>
<viewType>ENTITY</viewType>
<!-- entity not found: redirect to a URL -->
<param name="entity.not.found" value="redirect:EntityNotFound" />
<redirect action="EntityNotFound" toURL="/createEmployee.xpg">
<add name="redirectAfterCreate" value="#{containerBean.viewInfo.bookmarkableURL}" />
</redirect>
</viewConfig>
<hidden>true</hidden>
</object>
<object xmlns="http://www.cmobilecom.com/af/objects"
id="createExpenseClaim" type="entity">
<entityType>HR.EC</entityType>
<mode>CREATE</mode>
<viewConfig>
<viewType>ENTITY</viewType>
</viewConfig>
</object>
Page: /createEmployee.xpg
<object xmlns="http://www.cmobilecom.com/af/objects"
id="createEmployee" type="entity">
<entityType>HR.EMP</entityType>
<mode>CREATE</mode>
<criteriaElements>
<function name="EQ" property="user">#{current_user}</function>
</criteriaElements>
<viewConfig>
<viewType>ENTITY</viewType>
<redirect action="cmd.Create"
enabled="#{!empty param.redirectAfterCreate}"
toURL="#{param.redirectAfterCreate}">
</redirect>
</viewConfig>
</object>
<object xmlns="http://www.cmobilecom.com/af/objects"
id="userSignUp" type="entity">
<entityType>System.USR</entityType>
<mode>CREATE</mode>
<viewConfig>
<viewType>ENTITY</viewType>
<param name="countries" value="US,CN" />
</viewConfig>
</object>
Parameter: countries