You should assume a running Cayenne stack. In other words, you need to
obtain a DataContext as you would in any Cayenne application, and then
do DataContext.getEntityResolver(). Resolver maps all entities loaded
from one or more DataMaps.
> Also, ObjEntitiy has a default encodeAsXML() already provided. What's
> that used for?
It is used in the Modeler to write ObjEntity itself into an XML stream.
Andrus
On Dec 13, 2004, at 8:08 PM, Kevin J. Menard, Jr. wrote:
> On Dec 13, 2004, at 12:06 AM, Andrus Adamchik wrote:
>
>>
>> On Dec 12, 2004, at 9:22 PM, Kevin Menard wrote:
>>> Now, I have a question about the code generation stuff. I've been
>>> playing with the superclass template, and it'll set up an
>>> encodeAsXML() that works pretty.
>>
>> Hmm, I thought you were planning a dynamic encoder/decoder for
>> DataObjects based on Cayenne mapping? I guess adding this as a
>> generated code has its benefits (i.e. no need for a DataContext). But
>> a DataContext (or maybe EntityResolver which is probably a cleaner
>> solution) can be passed around in encoder/decoder (or in a subclass
>> of coder)... So any other reason we might need a generated method
>> instead of a generic one in CayenneDataObject?
>
> What's the easiest way to locate a map file? The API for loading a
> map and working with the object entities is straightforward, but I'm
> not sure how to find the map file in the first place. I assume
> Cayenne reads it out of cayenne.xml, but I'm not sure how it finds
> that either.
>
> Also, ObjEntitiy has a default encodeAsXML() already provided. What's
> that used for?
>
> Thanks,
> Kevin
>
>
This archive was generated by hypermail 2.0.0 : Mon Dec 13 2004 - 20:26:17 EST