FAQ

Andrey Razumovsky commented on CAY-400:
---------------------------------------

Well, I think I could work on this one, but my choice is SQL
comments in DBobjects, not exactly the idea Andrus originally
proposed. Any objections?
I have no problem with the reduced scope. But can we still make it a
generic property map initialized lazily and attached to DbAtrtribute
or DbEntity, with comments being just one of the possible fields in
it? I.e. the idea to group any properties not relevant to Cayenne
runtime functioning in an untyped Map<String, Object>, instead of
declaring them as ivars.

Andrus

Search Discussions

  • Andrus Adamchik at Apr 14, 2009 at 8:19 am
    Map<String, Object>

    One correction... Reading Ari's comment attached to CAY-400, I
    realized that I forgot that we also need to store it in XML, so the
    Map will be Map<String, String>

    Andrus

    On Apr 14, 2009, at 11:13 AM, Andrus Adamchik wrote:

    Andrey Razumovsky commented on CAY-400:
    ---------------------------------------

    Well, I think I could work on this one, but my choice is SQL
    comments in DBobjects, not exactly the idea Andrus originally
    proposed. Any objections?
    I have no problem with the reduced scope. But can we still make it a
    generic property map initialized lazily and attached to DbAtrtribute
    or DbEntity, with comments being just one of the possible fields in
    it? I.e. the idea to group any properties not relevant to Cayenne
    runtime functioning in an untyped Map<String, Object>, instead of
    declaring them as ivars.

    Andrus

  • Aristedes Maniatis at Apr 14, 2009 at 8:32 am

    On 14/04/2009, at 6:19 PM, Andrus Adamchik wrote:

    One correction... Reading Ari's comment attached to CAY-400, I
    realized that I forgot that we also need to store it in XML, so the
    Map will be Map<String, String>
    Ah, read this after I pressed send on my email. This leads me to think
    I'd like to get the XML schema [1] linked to the output of Cayenne
    Modeler, but I can't find anywhere in the modeler which writes out the
    XML. I assume it is buried into Cayenne core somewhere (although why?).

    I want this to go into the top of the output file:

    <?xml version="1.0"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://cayenne.apache.org/schema/3.0/modelMap.xsd"
    xmlns="http://cayenne.apache.org/schema/3.0/modelMap.xsd"
    elementFormDefault="qualified">


    We can then get the modeler to validate the XML with something like
    this where the SAX parser is initialised:

    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(true);
    factory.setValidating(true);




    Ari


    [1] http://cayenne.apache.org/schema/3.0/modelMap.xsd

    -------------------------->
    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
  • Aristedes Maniatis at Apr 14, 2009 at 8:22 am

    On 14/04/2009, at 6:13 PM, Andrus Adamchik wrote:

    I have no problem with the reduced scope. But can we still make it a
    generic property map initialized lazily and attached to DbAtrtribute
    or DbEntity, with comments being just one of the possible fields in
    it? I.e. the idea to group any properties not relevant to Cayenne
    runtime functioning in an untyped Map<String, Object>, instead of
    declaring them as ivars
    Map<String, String> might be easier unless we want to go to the
    trouble of typing these objects in both Cayenne modeler with another
    popup option and also in the XML. Mostly the user can cast them into
    some other data type if needed.

    Ari



    -------------------------->
    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
  • Andrey Razumovsky at Apr 14, 2009 at 8:30 am
    I'm afraid I don't actually catch the point. This sounds like two separate
    tasks.
    Comments that are (re) engineered to SQL comments cannot be generic, because
    as far as I know, SQL specifies only one string per column, table etc.
    Generic properties are more flexible, but they cannot be saved in DB. And I
    don't like the idea of having generic property map this one "specific"
    comment key, because it makes the design blurry. So possibly we could open
    both tasks (?)

    Andrey

    2009/4/14 Aristedes Maniatis <ari@ish.com.au>
    On 14/04/2009, at 6:13 PM, Andrus Adamchik wrote:

    I have no problem with the reduced scope. But can we still make it a
    generic property map initialized lazily and attached to DbAtrtribute or
    DbEntity, with comments being just one of the possible fields in it? I.e.
    the idea to group any properties not relevant to Cayenne runtime functioning
    in an untyped Map<String, Object>, instead of declaring them as ivars
    Map<String, String> might be easier unless we want to go to the trouble of
    typing these objects in both Cayenne modeler with another popup option and
    also in the XML. Mostly the user can cast them into some other data type if
    needed.

    Ari



    -------------------------->
    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

  • Aristedes Maniatis at Apr 14, 2009 at 8:42 am

    On 14/04/2009, at 6:30 PM, Andrey Razumovsky wrote:

    I'm afraid I don't actually catch the point. This sounds like two
    separate
    tasks.
    Comments that are (re) engineered to SQL comments cannot be generic,
    because
    as far as I know, SQL specifies only one string per column, table etc.
    Generic properties are more flexible, but they cannot be saved in
    DB. And I
    don't like the idea of having generic property map this one "specific"
    comment key, because it makes the design blurry. So possibly we
    could open
    both tasks (?)
    Do you mean comments which will actually be passed to the database
    engine? Is this for auditing or logging? If so, I'd suggest that maybe
    they are a completely different feature to CAY-400 since the core of
    Cayenne will have to understand how to apply them.

    Although we could reserve certain keys (eg. cay-javadoc, cay-
    SQLcomment) generic key-values is going against the XML paradigm and
    it might be better to just have special GUI elements for special
    things like these.

    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
  • Andrus Adamchik at Apr 14, 2009 at 8:43 am
    Yes, this is a question of classification of "comment" property -
    whether we think it is "generic" or not...

    I don't have strong feelings either ways. My criteria for a generic
    property as "being irrelevant to Cayenne runtime" may not apply to
    comments if you use comments in DB schema generation. (BTW, is there a
    plan to do that?).

    So I am +0 on making comment an ivar. But please (re)open a separate
    Jira for that.

    Andrus



    On Apr 14, 2009, at 11:30 AM, Andrey Razumovsky wrote:

    I'm afraid I don't actually catch the point. This sounds like two
    separate
    tasks.
    Comments that are (re) engineered to SQL comments cannot be generic,
    because
    as far as I know, SQL specifies only one string per column, table etc.
    Generic properties are more flexible, but they cannot be saved in
    DB. And I
    don't like the idea of having generic property map this one "specific"
    comment key, because it makes the design blurry. So possibly we
    could open
    both tasks (?)

    Andrey

    2009/4/14 Aristedes Maniatis <ari@ish.com.au>
    On 14/04/2009, at 6:13 PM, Andrus Adamchik wrote:

    I have no problem with the reduced scope. But can we still make it a
    generic property map initialized lazily and attached to
    DbAtrtribute or
    DbEntity, with comments being just one of the possible fields in
    it? I.e.
    the idea to group any properties not relevant to Cayenne runtime
    functioning
    in an untyped Map<String, Object>, instead of declaring them as
    ivars
    Map<String, String> might be easier unless we want to go to the
    trouble of
    typing these objects in both Cayenne modeler with another popup
    option and
    also in the XML. Mostly the user can cast them into some other data
    type if
    needed.

    Ari



    -------------------------->
    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

  • Andrey Razumovsky at Apr 14, 2009 at 8:56 am
    Yeah, this is a different task, something like CAY-659. I find the feauture
    quite useful.

    (BTW, is there a plan to do that?).
    What do you mean by plan? This seems quite straightforward. It's all about
    adding comments in API and modeler for DbEntities and DbAttributes (I'm not
    so sure about DbRels) and then seal them in schema generating, reverse
    engineering and migrating processes. I have no information whether comments
    are supported by all DBMS, but I sincerelly hope so it is.
  • Andrus Adamchik at Apr 14, 2009 at 9:00 am

    On Apr 14, 2009, at 11:56 AM, Andrey Razumovsky wrote:

    What do you mean by plan?
    I mean intention. Well, clearly there is :-)

    Andrus
  • Adrian A. at Apr 14, 2009 at 9:17 am

    Yeah, this is a different task, something like CAY-659. I find the feauture
    quite useful.

    (BTW, is there a plan to do that?).
    What do you mean by plan? This seems quite straightforward. It's all about
    adding comments in API and modeler for DbEntities and DbAttributes (I'm not
    so sure about DbRels) and then seal them in schema generating, reverse
    engineering and migrating processes. I have no information whether comments
    are supported by all DBMS, but I sincerelly hope so it is.
    Please read again Malcolm's comment from that issue(or other of his posts
    about this subject). I think he is right there.
    Also that what most users ask are comments as in vertical propagation of the
    DB comments to the upper levers (or in the opposite direction if the forward
    DB engineering approach is used, as opposed to the more widely used reverse
    engineering) .
    For this "comment" support there's also a partial implementation that is
    pretty advanced (i.e. UI in the Cayenne Modeler support is implemented),
    just that it was made quite a while ago:
    http://click.sourceforge.net/click-maven-bundle/cayenne-1.2.2.b.zip

    Thank you,
    A.
  • Tore Halset at Apr 15, 2009 at 11:29 am
    Hello.

    I just want to bring another example on the table. Hope I am not
    messing things up too much.

    What about multi-column information? I want to store information about
    db indexes that have a name, can span multiple columns and be of
    different types. I know this is probably out of scope for cayenne as a
    ORM, but very useful for us since we already store all other schema-
    related information in the model.

    If we go with a generic property map with string values, such
    information could be encoded into the String, but it will not be very
    pretty..

    dbEntity.setProperty("DB-INDEX", "name: myindex, type: unique,
    columns: col1, col2");

    Regards,
    - Tore.
    On Apr 14, 2009, at 10:43 , Andrus Adamchik wrote:

    Yes, this is a question of classification of "comment" property -
    whether we think it is "generic" or not...

    I don't have strong feelings either ways. My criteria for a generic
    property as "being irrelevant to Cayenne runtime" may not apply to
    comments if you use comments in DB schema generation. (BTW, is there
    a plan to do that?).

    So I am +0 on making comment an ivar. But please (re)open a separate
    Jira for that.

    Andrus



    On Apr 14, 2009, at 11:30 AM, Andrey Razumovsky wrote:

    I'm afraid I don't actually catch the point. This sounds like two
    separate
    tasks.
    Comments that are (re) engineered to SQL comments cannot be
    generic, because
    as far as I know, SQL specifies only one string per column, table
    etc.
    Generic properties are more flexible, but they cannot be saved in
    DB. And I
    don't like the idea of having generic property map this one
    "specific"
    comment key, because it makes the design blurry. So possibly we
    could open
    both tasks (?)

    Andrey

    2009/4/14 Aristedes Maniatis <ari@ish.com.au>
    On 14/04/2009, at 6:13 PM, Andrus Adamchik wrote:

    I have no problem with the reduced scope. But can we still make it a
    generic property map initialized lazily and attached to
    DbAtrtribute or
    DbEntity, with comments being just one of the possible fields in
    it? I.e.
    the idea to group any properties not relevant to Cayenne runtime
    functioning
    in an untyped Map<String, Object>, instead of declaring them as
    ivars
    Map<String, String> might be easier unless we want to go to the
    trouble of
    typing these objects in both Cayenne modeler with another popup
    option and
    also in the XML. Mostly the user can cast them into some other
    data type if
    needed.

    Ari



    -------------------------->
    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

  • Aristedes Maniatis at Apr 15, 2009 at 12:24 pm

    On 15/04/2009, at 9:28 PM, Tore Halset wrote:

    What about multi-column information? I want to store information
    about db indexes that have a name, can span multiple columns and be
    of different types. I know this is probably out of scope for cayenne
    as a ORM, but very useful for us since we already store all other
    schema-related information in the model.

    If we go with a generic property map with string values, such
    information could be encoded into the String, but it will not be
    very pretty..

    dbEntity.setProperty("DB-INDEX", "name: myindex, type: unique,
    columns: col1, col2");
    In my opinion indexes are a very useful thing to store in the model,
    can tie into reverse engineering, be part of a database migration and
    might even be used by Cayenne to produce warnings that unindexed
    columns are being used for a query. I think they should be stored as
    their own first class items in the map and not as a generic string key-
    value.

    Hey, there's a GSoC project... modify Cayenne modeler to store these
    indexes.

    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
  • Andrus Adamchik at Apr 15, 2009 at 4:00 pm

    On Apr 15, 2009, at 3:24 PM, Aristedes Maniatis wrote:

    Hey, there's a GSoC project... modify Cayenne modeler to store these
    indexes.
    Heh, we missed that boat already for this year.

    Andrus

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescayenne
postedApr 14, '09 at 8:14a
activeApr 15, '09 at 4:00p
posts13
users5
websitecayenne.apache.org

People

Translate

site design / logo © 2022 Grokbase