FAQ
Hi!

Although I CAN send you the complete set of files and an SQL script to
create MySQL database, I have decided to extract the relevant part only:

<?xml version="1.0" encoding="utf-8"?>
<data-map project-version="2.0">
<property name="defaultPackage" value="com.ray.database"/>
<property name="defaultSchema" value="ray"/>

<db-entity name="boolean_value" catalog="ray">
<db-attribute name="BOOLEAN_VALUE_ID" type="INTEGER"
isPrimaryKey="true" isMandatory="true" length="11"/>
<db-attribute name="NAME" type="VARCHAR"
isMandatory="true" length="200"/>
<db-attribute name="PRIORITY" type="INTEGER"
isMandatory="true" length="11"/>
</db-entity>
<db-entity name="company" catalog="ray">
<db-attribute name="COMPANY_ID" type="INTEGER"
isPrimaryKey="true" isMandatory="true" length="11"/>
<db-attribute name="ELEMENTS_USED_ID" type="INTEGER"
isMandatory="true" length="11"/>
<db-attribute name="MODELS_USED_ID" type="INTEGER"
isMandatory="true" length="11"/>
</db-entity>

<obj-entity name="BooleanValue"
className="com.ray.database.BooleanValue" dbEntityName="boolean_value">
<obj-attribute name="name" type="java.lang.String"
db-attribute-path="NAME"/>
<obj-attribute name="priority" type="java.lang.Integer"
db-attribute-path="PRIORITY"/>
</obj-entity>
<obj-entity name="Company" className="com.ray.database.Company"
dbEntityName="company">
</obj-entity>

<db-relationship name="companyArray" source="boolean_value"
target="company" toMany="true">
<db-attribute-pair source="BOOLEAN_VALUE_ID"
target="ELEMENTS_USED_ID"/>
</db-relationship>
<db-relationship name="companyArray1" source="boolean_value"
target="company" toMany="true">
<db-attribute-pair source="BOOLEAN_VALUE_ID"
target="MODELS_USED_ID"/>
</db-relationship>

<db-relationship name="toBooleanValue" source="company"
target="boolean_value" toMany="false">
<db-attribute-pair source="ELEMENTS_USED_ID"
target="BOOLEAN_VALUE_ID"/>
</db-relationship>
<db-relationship name="toBooleanValue1" source="company"
target="boolean_value" toMany="false">
<db-attribute-pair source="MODELS_USED_ID"
target="BOOLEAN_VALUE_ID"/>
</db-relationship>

<obj-relationship name="companyArray" source="BooleanValue"
target="Company" db-relationship-path="companyArray"/>
<obj-relationship name="companyArray1" source="BooleanValue"
target="Company" db-relationship-path="companyArray1"/>
<obj-relationship name="toBooleanValue" source="Company"
target="BooleanValue" db-relationship-path="toBooleanValue"/>
<obj-relationship name="toBooleanValue1" source="Company"
target="BooleanValue" db-relationship-path="toBooleanValue1"/>
</data-map>

Notice, ELEMENTS_USED_ID became toBooleanValue and MODELS_USED_ID became
toBooleanValue1.

I am sorry to say, that this is a showstopper for me: for a Company
table, I simply do not know, whether to use toBooleanValue or
toBooleanValue1.

If you need the complete files, I will be happy to send them.

Thanks!!!


-----Original Message-----
From: Andrus Adamchik (JIRA)
Sent: Monday, April 16, 2007 6:47 PM
To: Yegor
Subject: [JIRA] Commented: (CAY-777) Still incorrect: CLONE -Import
EOModel - Incorrect Join src/target names are created


[
https://issues.apache.org/cayenne/browse/CAY-777?page=com.atlassian.jira
.plugin.system.issuetabpanels:comment-tabpanel#action_12289 ]

Andrus Adamchik commented on CAY-777:
-------------------------------------

Yegor,

could you possibly attach an EOModel (or a relevant part of it) to this
issue? This will significantly speed up the fix. Or if it contains
sensitive company data, could you create a neutral EOModel from scratch
that reproduces the problem.

Thanks
Andrus
Still incorrect: CLONE -Import EOModel - Incorrect Join src/target
names are created
----------------------------------------------------------------------
--------------

Key: CAY-777
URL: https://issues.apache.org/cayenne/browse/CAY-777
Project: Cayenne
Issue Type: Bug
Components: Cayenne Core Library
Affects Versions: 1.1 [LEGACY]
Environment: EOModels created for WO5.2, Cayenne 1.1B1
Reporter: Kurbachev Yegor
Assigned To: Andrus Adamchik
Priority: Critical
Fix For: 1.1 [LEGACY]


Join source amd target are all created using ObjAttribute names,
instead of column names. This may still work for EOModels where the
two are the same, but it is a nasty bug that completely prevents
import from working in a general case. Looks like a fresh one (after
we switched from DBAttributePair to DBJoin, ca. M6)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.






************************************************************************
************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals &
computer viruses.
************************************************************************
************

Search Discussions

  • Mike Kienenberger at Apr 16, 2007 at 4:49 pm
    Yegor,

    You posted the Cayenne data map, which is probably helpful.

    But what's needed (What Andrus asked for) is the EOModel files,
    probably at minimal the Company and BooleanValue.plist files.

    On 4/16/07, Yegor wrote:
    Hi!

    Although I CAN send you the complete set of files and an SQL script to
    create MySQL database, I have decided to extract the relevant part only:

    <?xml version="1.0" encoding="utf-8"?>
    <data-map project-version="2.0">
    <property name="defaultPackage" value="com.ray.database"/>
    <property name="defaultSchema" value="ray"/>

    <db-entity name="boolean_value" catalog="ray">
    <db-attribute name="BOOLEAN_VALUE_ID" type="INTEGER"
    isPrimaryKey="true" isMandatory="true" length="11"/>
    <db-attribute name="NAME" type="VARCHAR"
    isMandatory="true" length="200"/>
    <db-attribute name="PRIORITY" type="INTEGER"
    isMandatory="true" length="11"/>
    </db-entity>
    <db-entity name="company" catalog="ray">
    <db-attribute name="COMPANY_ID" type="INTEGER"
    isPrimaryKey="true" isMandatory="true" length="11"/>
    <db-attribute name="ELEMENTS_USED_ID" type="INTEGER"
    isMandatory="true" length="11"/>
    <db-attribute name="MODELS_USED_ID" type="INTEGER"
    isMandatory="true" length="11"/>
    </db-entity>

    <obj-entity name="BooleanValue"
    className="com.ray.database.BooleanValue" dbEntityName="boolean_value">
    <obj-attribute name="name" type="java.lang.String"
    db-attribute-path="NAME"/>
    <obj-attribute name="priority" type="java.lang.Integer"
    db-attribute-path="PRIORITY"/>
    </obj-entity>
    <obj-entity name="Company" className="com.ray.database.Company"
    dbEntityName="company">
    </obj-entity>

    <db-relationship name="companyArray" source="boolean_value"
    target="company" toMany="true">
    <db-attribute-pair source="BOOLEAN_VALUE_ID"
    target="ELEMENTS_USED_ID"/>
    </db-relationship>
    <db-relationship name="companyArray1" source="boolean_value"
    target="company" toMany="true">
    <db-attribute-pair source="BOOLEAN_VALUE_ID"
    target="MODELS_USED_ID"/>
    </db-relationship>

    <db-relationship name="toBooleanValue" source="company"
    target="boolean_value" toMany="false">
    <db-attribute-pair source="ELEMENTS_USED_ID"
    target="BOOLEAN_VALUE_ID"/>
    </db-relationship>
    <db-relationship name="toBooleanValue1" source="company"
    target="boolean_value" toMany="false">
    <db-attribute-pair source="MODELS_USED_ID"
    target="BOOLEAN_VALUE_ID"/>
    </db-relationship>

    <obj-relationship name="companyArray" source="BooleanValue"
    target="Company" db-relationship-path="companyArray"/>
    <obj-relationship name="companyArray1" source="BooleanValue"
    target="Company" db-relationship-path="companyArray1"/>
    <obj-relationship name="toBooleanValue" source="Company"
    target="BooleanValue" db-relationship-path="toBooleanValue"/>
    <obj-relationship name="toBooleanValue1" source="Company"
    target="BooleanValue" db-relationship-path="toBooleanValue1"/>
    </data-map>

    Notice, ELEMENTS_USED_ID became toBooleanValue and MODELS_USED_ID became
    toBooleanValue1.

    I am sorry to say, that this is a showstopper for me: for a Company
    table, I simply do not know, whether to use toBooleanValue or
    toBooleanValue1.

    If you need the complete files, I will be happy to send them.

    Thanks!!!


    -----Original Message-----
    From: Andrus Adamchik (JIRA)
    Sent: Monday, April 16, 2007 6:47 PM
    To: Yegor
    Subject: [JIRA] Commented: (CAY-777) Still incorrect: CLONE -Import
    EOModel - Incorrect Join src/target names are created


    [
    https://issues.apache.org/cayenne/browse/CAY-777?page=com.atlassian.jira
    .plugin.system.issuetabpanels:comment-tabpanel#action_12289 ]

    Andrus Adamchik commented on CAY-777:
    -------------------------------------

    Yegor,

    could you possibly attach an EOModel (or a relevant part of it) to this
    issue? This will significantly speed up the fix. Or if it contains
    sensitive company data, could you create a neutral EOModel from scratch
    that reproduces the problem.

    Thanks
    Andrus
    Still incorrect: CLONE -Import EOModel - Incorrect Join src/target
    names are created
    ----------------------------------------------------------------------
    --------------

    Key: CAY-777
    URL: https://issues.apache.org/cayenne/browse/CAY-777
    Project: Cayenne
    Issue Type: Bug
    Components: Cayenne Core Library
    Affects Versions: 1.1 [LEGACY]
    Environment: EOModels created for WO5.2, Cayenne 1.1B1
    Reporter: Kurbachev Yegor
    Assigned To: Andrus Adamchik
    Priority: Critical
    Fix For: 1.1 [LEGACY]


    Join source amd target are all created using ObjAttribute names,
    instead of column names. This may still work for EOModels where the
    two are the same, but it is a nasty bug that completely prevents
    import from working in a general case. Looks like a fresh one (after
    we switched from DBAttributePair to DBJoin, ca. M6)
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.






    ************************************************************************
    ************
    This footnote confirms that this email message has been scanned by
    PineApp Mail-SeCure for the presence of malicious code, vandals &
    computer viruses.
    ************************************************************************
    ************




  • Andrus Adamchik at Apr 16, 2007 at 5:01 pm
    Hmmm... Looking at the issue some more - it was cloned from another
    issue... So Yegor, are you importing an EOModel, or are you reverse
    engineering the DB? Somehow I have a feeling there's no WebObjects
    EOModel involved at all.

    Andrus


    On Apr 16, 2007, at 7:49 PM, Mike Kienenberger wrote:
    Yegor,

    You posted the Cayenne data map, which is probably helpful.

    But what's needed (What Andrus asked for) is the EOModel files,
    probably at minimal the Company and BooleanValue.plist files.

    On 4/16/07, Yegor wrote:
    Hi!

    Although I CAN send you the complete set of files and an SQL
    script to
    create MySQL database, I have decided to extract the relevant part
    only:

    <?xml version="1.0" encoding="utf-8"?>
    <data-map project-version="2.0">
    <property name="defaultPackage" value="com.ray.database"/>
    <property name="defaultSchema" value="ray"/>

    <db-entity name="boolean_value" catalog="ray">
    <db-attribute name="BOOLEAN_VALUE_ID" type="INTEGER"
    isPrimaryKey="true" isMandatory="true" length="11"/>
    <db-attribute name="NAME" type="VARCHAR"
    isMandatory="true" length="200"/>
    <db-attribute name="PRIORITY" type="INTEGER"
    isMandatory="true" length="11"/>
    </db-entity>
    <db-entity name="company" catalog="ray">
    <db-attribute name="COMPANY_ID" type="INTEGER"
    isPrimaryKey="true" isMandatory="true" length="11"/>
    <db-attribute name="ELEMENTS_USED_ID" type="INTEGER"
    isMandatory="true" length="11"/>
    <db-attribute name="MODELS_USED_ID" type="INTEGER"
    isMandatory="true" length="11"/>
    </db-entity>

    <obj-entity name="BooleanValue"
    className="com.ray.database.BooleanValue"
    dbEntityName="boolean_value">
    <obj-attribute name="name" type="java.lang.String"
    db-attribute-path="NAME"/>
    <obj-attribute name="priority"
    type="java.lang.Integer"
    db-attribute-path="PRIORITY"/>
    </obj-entity>
    <obj-entity name="Company"
    className="com.ray.database.Company"
    dbEntityName="company">
    </obj-entity>

    <db-relationship name="companyArray" source="boolean_value"
    target="company" toMany="true">
    <db-attribute-pair source="BOOLEAN_VALUE_ID"
    target="ELEMENTS_USED_ID"/>
    </db-relationship>
    <db-relationship name="companyArray1" source="boolean_value"
    target="company" toMany="true">
    <db-attribute-pair source="BOOLEAN_VALUE_ID"
    target="MODELS_USED_ID"/>
    </db-relationship>

    <db-relationship name="toBooleanValue" source="company"
    target="boolean_value" toMany="false">
    <db-attribute-pair source="ELEMENTS_USED_ID"
    target="BOOLEAN_VALUE_ID"/>
    </db-relationship>
    <db-relationship name="toBooleanValue1" source="company"
    target="boolean_value" toMany="false">
    <db-attribute-pair source="MODELS_USED_ID"
    target="BOOLEAN_VALUE_ID"/>
    </db-relationship>

    <obj-relationship name="companyArray" source="BooleanValue"
    target="Company" db-relationship-path="companyArray"/>
    <obj-relationship name="companyArray1" source="BooleanValue"
    target="Company" db-relationship-path="companyArray1"/>
    <obj-relationship name="toBooleanValue" source="Company"
    target="BooleanValue" db-relationship-path="toBooleanValue"/>
    <obj-relationship name="toBooleanValue1" source="Company"
    target="BooleanValue" db-relationship-path="toBooleanValue1"/>
    </data-map>

    Notice, ELEMENTS_USED_ID became toBooleanValue and MODELS_USED_ID
    became
    toBooleanValue1.

    I am sorry to say, that this is a showstopper for me: for a Company
    table, I simply do not know, whether to use toBooleanValue or
    toBooleanValue1.

    If you need the complete files, I will be happy to send them.

    Thanks!!!


    -----Original Message-----
    From: Andrus Adamchik (JIRA)
    Sent: Monday, April 16, 2007 6:47 PM
    To: Yegor
    Subject: [JIRA] Commented: (CAY-777) Still incorrect: CLONE -Import
    EOModel - Incorrect Join src/target names are created


    [
    https://issues.apache.org/cayenne/browse/CAY-777?
    page=com.atlassian.jira
    .plugin.system.issuetabpanels:comment-tabpanel#action_12289 ]

    Andrus Adamchik commented on CAY-777:
    -------------------------------------

    Yegor,

    could you possibly attach an EOModel (or a relevant part of it) to
    this
    issue? This will significantly speed up the fix. Or if it contains
    sensitive company data, could you create a neutral EOModel from
    scratch
    that reproduces the problem.

    Thanks
    Andrus
    Still incorrect: CLONE -Import EOModel - Incorrect Join src/target
    names are created
    ---------------------------------------------------------------------
    -
    --------------

    Key: CAY-777
    URL: https://issues.apache.org/cayenne/browse/ CAY-777
    Project: Cayenne
    Issue Type: Bug
    Components: Cayenne Core Library
    Affects Versions: 1.1 [LEGACY]
    Environment: EOModels created for WO5.2, Cayenne 1.1B1
    Reporter: Kurbachev Yegor
    Assigned To: Andrus Adamchik
    Priority: Critical
    Fix For: 1.1 [LEGACY]


    Join source amd target are all created using ObjAttribute names,
    instead of column names. This may still work for EOModels where the
    two are the same, but it is a nasty bug that completely prevents
    import from working in a general case. Looks like a fresh one (after
    we switched from DBAttributePair to DBJoin, ca. M6)
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.






    *********************************************************************
    ***
    ************
    This footnote confirms that this email message has been scanned by
    PineApp Mail-SeCure for the presence of malicious code, vandals &
    computer viruses.
    *********************************************************************
    ***
    ************




  • Andrus Adamchik at Apr 16, 2007 at 6:59 pm
    FYI:

    Begin forwarded message:
    From: "Yegor" <[email protected]>
    Date: April 16, 2007 8:15:17 PM GMT+03:00
    To: "Andrus Adamchik" <[email protected]>
    Subject: RE: [JIRA] Commented: (CAY-777) Still incorrect: CLONE -
    Import EOModel - Incorrect Join src/target names are created

    I am reverse engineering. Sorry, if EOModel is something different,
    but
    the behaviour is identical to the described in the bug.

    -----Original Message-----
    From: Andrus Adamchik
    Sent: Monday, April 16, 2007 8:01 PM
    To: [email protected]
    Cc: Yegor
    Subject: Re: [JIRA] Commented: (CAY-777) Still incorrect: CLONE -
    Import
    EOModel - Incorrect Join src/target names are created

    Hmmm... Looking at the issue some more - it was cloned from another
    issue... So Yegor, are you importing an EOModel, or are you reverse
    engineering the DB? Somehow I have a feeling there's no WebObjects
    EOModel involved at all.

    Andrus


    On Apr 16, 2007, at 7:49 PM, Mike Kienenberger wrote:
    Yegor,

    You posted the Cayenne data map, which is probably helpful.

    But what's needed (What Andrus asked for) is the EOModel files,
    probably at minimal the Company and BooleanValue.plist files.

    On 4/16/07, Yegor wrote:
    Hi!

    Although I CAN send you the complete set of files and an SQL script
    to create MySQL database, I have decided to extract the relevant
    part
    only:

    <?xml version="1.0" encoding="utf-8"?> <data-map
    project-version="2.0">
    <property name="defaultPackage" value="com.ray.database"/>
    <property name="defaultSchema" value="ray"/>

    <db-entity name="boolean_value" catalog="ray">
    <db-attribute name="BOOLEAN_VALUE_ID" type="INTEGER"
    isPrimaryKey="true" isMandatory="true" length="11"/>
    <db-attribute name="NAME" type="VARCHAR"
    isMandatory="true" length="200"/>
    <db-attribute name="PRIORITY" type="INTEGER"
    isMandatory="true" length="11"/>
    </db-entity>
    <db-entity name="company" catalog="ray">
    <db-attribute name="COMPANY_ID" type="INTEGER"
    isPrimaryKey="true" isMandatory="true" length="11"/>
    <db-attribute name="ELEMENTS_USED_ID" type="INTEGER"
    isMandatory="true" length="11"/>
    <db-attribute name="MODELS_USED_ID" type="INTEGER"
    isMandatory="true" length="11"/>
    </db-entity>

    <obj-entity name="BooleanValue"
    className="com.ray.database.BooleanValue"
    dbEntityName="boolean_value">
    <obj-attribute name="name" type="java.lang.String"
    db-attribute-path="NAME"/>
    <obj-attribute name="priority"
    type="java.lang.Integer"
    db-attribute-path="PRIORITY"/>
    </obj-entity>
    <obj-entity name="Company"
    className="com.ray.database.Company"
    dbEntityName="company">
    </obj-entity>

    <db-relationship name="companyArray" source="boolean_value"
    target="company" toMany="true">
    <db-attribute-pair source="BOOLEAN_VALUE_ID"
    target="ELEMENTS_USED_ID"/>
    </db-relationship>
    <db-relationship name="companyArray1" source="boolean_value"
    target="company" toMany="true">
    <db-attribute-pair source="BOOLEAN_VALUE_ID"
    target="MODELS_USED_ID"/>
    </db-relationship>

    <db-relationship name="toBooleanValue" source="company"
    target="boolean_value" toMany="false">
    <db-attribute-pair source="ELEMENTS_USED_ID"
    target="BOOLEAN_VALUE_ID"/>
    </db-relationship>
    <db-relationship name="toBooleanValue1" source="company"
    target="boolean_value" toMany="false">
    <db-attribute-pair source="MODELS_USED_ID"
    target="BOOLEAN_VALUE_ID"/>
    </db-relationship>

    <obj-relationship name="companyArray" source="BooleanValue"
    target="Company" db-relationship-path="companyArray"/>
    <obj-relationship name="companyArray1" source="BooleanValue"
    target="Company" db-relationship-path="companyArray1"/>
    <obj-relationship name="toBooleanValue" source="Company"
    target="BooleanValue" db-relationship-path="toBooleanValue"/>
    <obj-relationship name="toBooleanValue1" source="Company"
    target="BooleanValue" db-relationship-path="toBooleanValue1"/>
    </data-map>

    Notice, ELEMENTS_USED_ID became toBooleanValue and MODELS_USED_ID
    became toBooleanValue1.

    I am sorry to say, that this is a showstopper for me: for a Company
    table, I simply do not know, whether to use toBooleanValue or
    toBooleanValue1.

    If you need the complete files, I will be happy to send them.

    Thanks!!!


    -----Original Message-----
    From: Andrus Adamchik (JIRA)
    Sent: Monday, April 16, 2007 6:47 PM
    To: Yegor
    Subject: [JIRA] Commented: (CAY-777) Still incorrect: CLONE -Import
    EOModel - Incorrect Join src/target names are created


    [
    https://issues.apache.org/cayenne/browse/CAY-777?
    page=com.atlassian.jira
    .plugin.system.issuetabpanels:comment-tabpanel#action_12289 ]

    Andrus Adamchik commented on CAY-777:
    -------------------------------------

    Yegor,

    could you possibly attach an EOModel (or a relevant part of it) to
    this issue? This will significantly speed up the fix. Or if it
    contains sensitive company data, could you create a neutral EOModel
    from scratch that reproduces the problem.

    Thanks
    Andrus
    Still incorrect: CLONE -Import EOModel - Incorrect Join src/target
    names are created
    --------------------------------------------------------------------
    -
    -
    --------------

    Key: CAY-777
    URL: https://issues.apache.org/cayenne/browse/ CAY-777
    Project: Cayenne
    Issue Type: Bug
    Components: Cayenne Core Library
    Affects Versions: 1.1 [LEGACY]
    Environment: EOModels created for WO5.2, Cayenne 1.1B1
    Reporter: Kurbachev Yegor
    Assigned To: Andrus Adamchik
    Priority: Critical
    Fix For: 1.1 [LEGACY]


    Join source amd target are all created using ObjAttribute names,
    instead of column names. This may still work for EOModels where the
    two are the same, but it is a nasty bug that completely prevents
    import from working in a general case. Looks like a fresh one (after
    we switched from DBAttributePair to DBJoin, ca. M6)
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.






    ********************************************************************
    *
    ***
    ************
    This footnote confirms that this email message has been scanned by
    PineApp Mail-SeCure for the presence of malicious code, vandals &
    computer viruses.
    ********************************************************************
    *
    ***
    ************









    **********************************************************************
    **
    ************
    This footnote confirms that this email message has been scanned by
    PineApp Mail-SeCure for the presence of malicious code, vandals &
    computer viruses.
    **********************************************************************
    **
    ************




  • Andrus Adamchik at Apr 16, 2007 at 7:39 pm

    On Apr 16, 2007, at 8:15 PM, Yegor wrote:

    I am reverse engineering. Sorry, if EOModel is something different,
    but
    the behaviour is identical to the described in the bug.
    Ok, it is clear now. EOModel is a specific object relational mapping
    format used by WebObjects (http://www.apple.com/webobjects/), that
    Cayenne knows how to import. So this is of course something entirely
    different from your case.

    Now back to your problem... This is not a bug, but rather an expected
    behavior of the algorithm used to build the default object mapping
    from DB metadata. There were suggestions in the past to derive
    relationship names from FK's instead of table names, but since
    database column naming can be arbitrary, this is a dubious improvement.

    What you can do is to take a manual pass over the model after reverse
    engineering is done and rename the relationships in question to more
    appropriate names.

    Hope this helps.

    Andrus

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescayenne
postedApr 16, '07 at 4:38p
activeApr 16, '07 at 7:39p
posts5
users3
websitecayenne.apache.org

People

Translate

site design / logo © 2023 Grokbase