To expand on what Mike just said, right now a class generation /
compilation step is needed. Functionality similar to EOF
EOGenericRecord was requested before, but the main stumbling block
was the requirement that two different entities had to be of two
different classes. In other words a single Java class couldn't be
mapped to multiple entities.
This is about to change. In yet unreleased 1.2M9 we moved away from
that (for an unrelated reason) and now ObjectId and the rest of the
access stack uses String entity name as the entity type indicator. So
we may actually get EOGenericRecord functionality for free as a
result of this change, though extra testing is required to be
entirely sure.
Andrus
On Dec 8, 2005, at 10:45 PM, Mike Kienenberger wrote:
> Yes, I would think it'd be possible to do this, but you're actually
> talking about doing two different and unrelated things.
>
> As for creating new data maps and entity representations, it is a
> matter of creating DataDomain/DataMap/ObjEntity/DbEntity instances
> with code rather than loading them from an xml file.
>
> The generated entity classes are just convenience classes to make
> working with your data easier and typesafe. If you look at the code
> of the generated classes, it just delegates those calls back to
> CayenneDataObject, passing the attributes as strings. It works like
> EOGenericRecord if you're familiar with EOF.
>
> On 12/8/05, Jonathan Carlson <Jonathan.Carlso..atun.com> wrote:
>> Just curious,
>>
>> Is it possible to define a database mapping using generic DataObjects
>> instead of a subclass? I'm just curious how dynamic Cayenne is,
>> or if
>> some class compilation is necessary to add support for a new table.
>>
>> Thanks,
>>
>> - Jonathan
This archive was generated by hypermail 2.0.0 : Thu Dec 08 2005 - 15:31:26 EST