Re: entities with calculated fields

From: Aristedes Maniatis (ar..sh.com.au)
Date: Mon Feb 19 2007 - 03:56:47 EST

  • Next message: Malcolm Edgar: "Re: entities with calculated fields"

    On 15/02/2007, at 10:48 PM, Juergen Saar wrote:

    > For solving such kind of problem,
    > we created views in the database.

    Thanks for this note. In our case we want to avoid that mainly
    because we want to maintain compatibility with different databases
    I'd rather do this in Cayenne. Now I understand we can create an
    SQLTemplate and work with raw data rows, but that comes with a few
    inconveniences.

    Today I stumbled on 'derived dbentities'. I could find nothing in the
    documentation about them and not a lot in Javadocs. My questions
    about them are:

    * are they a fully support Cayenne feature which is sticking around
    in the long term?
    * what does ".. mean in the spec column and what else can I put
    there? Can I put "COUNT(SELECT some other table)" there?
    * if I add extra fields to the derived entity are they then simply
    ignored for the purpose of committing data back to the database?
    * can I now point my objEntity to this derived dbEntity instead of
    the original 'real' dbEntity? Will everything continue to work as
    before except I get to use a couple of new virtual fields? If that is
    the case, why do we even need derived dbEntities and why can't we
    just add additional virtual fields to the 'real' dbEntity?

    Sorry for lots of questions, but I'd like to understand these thing
    better since they look like they might be really useful.

    Ari Maniatis

    -------------------------->
    ish
    http://www.ish.com.au
    Level 1, 30 Wilson Street Newtown 2042 Australia
    phone +61 2 9550 5001 fax +61 2 9550 4001
    GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A





    This archive was generated by hypermail 2.0.0 : Mon Feb 19 2007 - 03:57:46 EST