Fiber questions


hi all,

 

i have 2 questions regarding filters fiber data model:

 

is possible retrieve data other entities defined in data model? example, able retrieve average of property in datamodel. have tried create filter jpql query like:

 

        <filter name="getaverageprice">
            <query><![cdata[jpql:select avg(o.price) orders o]]></query>
        </filter>

 

 

but when try fill error:

 

the item of type, 'java.lang.double', passed assembler not match assembler's configured entity type, 'mypackage.package2.orders'.  convert 'flex.messaging.io.amf.asobject' strong type automatically, set item-class in destination.
null

 

does know how solve problem?

 

further, have 2 entities association :

 

    <entity name="customer" persistent="true">
        <annotation name="visualmodeler">
            <item name="x">957</item>
            <item name="y">298</item>
            <item name="width">115</item>
            <item name="height">78</item>
        </annotation>
        <annotation name="livecyclees">
            <item name="generate_type">true</item>
        </annotation>
        <annotation name="serverproperties">
            <item name="servertype">lcds</item>
        </annotation>
        <property name="name" type="string"/>
        <id name="id" type="integer" generated="false"/>
        <property name="orders" type="orders[]" mappedby="customer"/>
    </entity>
    <entity name="orders" persistent="true">
        <annotation name="visualmodeler">
            <item name="x">758</item>
            <item name="y">308</item>
            <item name="width">115</item>
            <item name="height">78</item>
        </annotation>
        <annotation name="livecyclees">
            <item name="generate_type">true</item>
        </annotation>
        <annotation name="serverproperties">
            <item name="servertype">lcds</item>
        </annotation>
        <property name="price" type="string"/>
        <id name="id" type="integer" generated="false"/>
        <property name="customer" type="customer"/>
    </entity>

 

when deploy server 2 table , foreign key orders customer expected. when customer service can access orders. however, because dataset rather large (> 1000000 records), able specify subset of order put in orders property. (in sql)

 

select c.*, o.* customer c join orders o on (o.customer_id = c.id) o.price > 1000;

 

is possible?

 

any appreciated...

 

best regards,

bas

hi bas,

 

no, cannot return other collection of entities filter.  however, can create remoting destination , use mx:remoteobject call function returns kind of data.

 

as limiting number of orders show in customer entity, can set "load-on-demand", feature of lcds not load associated data until referenced.  can combine paging limit number of orders brought on wire @ 1 time.

 

hope helps.



More discussions in LiveCycle Data Services


adobe

Comments

Popular posts from this blog

Joomla site hacked, cant see front and - Joomla! Forum - community, help and support

Christian Home School Programs - Joomla! Forum - community, help and support

Trouble with PF_OutFlag_I_USE_AUDIO and PF_CHECKOUT_LAYER_AUDIO