Hello Everyone,

I have some questions about the technologies mentioned above.  Let's
say I had a relational database, I know this is a stretch :)  Or at
least it would seem so based on all the documentation and examples. 
If I had the following structure...

Company has many Employees. Each Employee has one Company.
Each Employee has many WorkOrders, a WorkOrder belongs to an Employee.
A WorkOrder has many Proposals, each Proposal beolongs to a WorkOrder.
Each Proposal has many LineItems, etc.....

I'll provide some example configs at the bottom of my post.

Here are my questions.

1. Do I need a corresponding <mx:DataService/> for each destination?
If I do a fill on getWorkOrdersForEmployee, I get the whole data model
for that employee (which is what I want)

2. If I set a CacheID for the DataService, I get an error saying that
nested Destinations are not supported.  Does this mean that If I used
relationships and complex data models, I can't use client side cacheing?

3. In Christophe's blog he mentions that "the dataService first tries
to connect to the server before loading the data from the local
cache", But in the documentation it says the opposite is true
"DataService instance always attempts to load any local data before
attempting to establish a connection and satisfy a fill() or getItem()
request".
Which one is it?

Thanks in advance, any clarification would be greatly appreciated. If
I'm completely off base it would be great if someone would let me
know, maybe i'm just approaching this all wrong :)

Here is an example Destination in my data-management-config.xml (I
included only the metadata section to keep example as short as possible)

<destination id="hibernate-work-order">
<metadata>
  <identity property="id"/>
  <one-to-many property="proposals" destination="hibernate-proposal"/>
  <many-to-one property="employee" destination="hibernate-employee"/>
</metadata>
</destination>

I have the following hibernate mapping files.

WorkOrder.hbm.xml
Employee.hbm.xml
Proposal.hbm.xml
LineItem.hbm.xml
Company.hbm.xml

Here is an example of how they are mapped. (leaving out the columns)

<hibernate-mapping>
<class name="WorkOrderVO" table="work_orders" catalog="somedb">
<many-to-one name="employee" class="EmployeeVO" fetch="select">
   <column name="employee_id" />
</many-to-one>
<set name="proposals" inverse="true">
    <key>
      <column name="work_order_id" not-null="true" />
    </key>
    <one-to-many class="ProposalVO" />
</set>
    <query name="getAll">From WorkOrderVO j</query>
    <query name="getWorkOrdersForEmployee">From WorkOrderVO wo where
wo.employee.id = :employee</query>
</class>
</hibernate-mapping>
 


Reply via email to