XML coding questions

From: Kevin J. Menard, Jr. (nirvdru..egativetwenty.net)
Date: Wed Dec 01 2004 - 17:29:55 EST

  • Next message: wojingo: "Re: XML coding questions"

    Hi,

    As some of you know, I'm working on an implementation of the
    WOXMLCoder/Decoder system for Cayenne. Work has been progressing
    along fairly well as I have time. I am running into a bit of a
    logical issue with regards to the model file though that I'm hoping
    someone more familiar with the system might be able to answer.

    The first entity block is for the object being encoded, and each
    subsequent one for helper objects. Are the property items specified
    in these subsequent entities referring to the base object or the
    helper one?

    E.g., in the mapping file below:

    <model>
         <entity name="Test" xmlTag="Test">
             <property name="name" xmlTag="statusId"/>
             <property name="address" xmlTag="itemIdentifier"/>
             <property name="phone" xmlTag="PriorityId"/>
             <property name="map.key" xmlTag="embedded"/>
             <property name="user" xmlTag="ownedBy"/>
         </entity>
         <entity name="User" xmlTag="ownedBy">
                         <property name="user.name" xmlTag="ownerName"/>
                         <property name="user.password" xmlTag="clearance"/>
         </entity>
    </model>

    "user", a property of the Test object, is of type User, which has
    properties "name" and "password". Should the second entity be using
    properties "name" and "password" that reference a User object that
    links to the "user" property in the first entity block, or should they
    be written as they are, referencing the nested "user.name" and
    "user.password" properties of the Test object?

    And is it assumed that all properties are initialized in the
    constructor? E.g., with "map.key" above, which is a HashMap, if it is
    only valid after a "set" operation, I have to watch out for null
    values. If it can be assumed to be initialized, then it's not a
    problem.

    Thanks,
    Kevin



    This archive was generated by hypermail 2.0.0 : Wed Dec 01 2004 - 18:04:16 EST