You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Milosz Tylenda (JIRA)" <ji...@apache.org> on 2008/12/27 09:39:44 UTC

[jira] Created: (OPENJPA-846) XML column support for MySQL

XML column support for MySQL
----------------------------

                 Key: OPENJPA-846
                 URL: https://issues.apache.org/jira/browse/OPENJPA-846
             Project: OpenJPA
          Issue Type: New Feature
          Components: sql
    Affects Versions: 2.0.0
         Environment: MySQL 5.1.30
            Reporter: Milosz Tylenda
         Attachments: OPENJPA-846.patch

1. The attached patch provides XML column support for MySQL.

2. Reading the MySQL manual one can expect the minimum required MySQL
   version is 5.1.5 but I tested the patch only on version 5.1.30 - this is
   the first general availability version in the 5.1 series.

3. ExtractValue MySQL function is used to do XML comparisons.
   TestXMLCustomerOrder.mysql file contains samples of SQL.
   Sample queries generated by the patched code:

SELECT t0.oid, t1.oid FROM TORDER t0 CROSS JOIN TORDER t1 WHERE (ExtractValue(t0.shipAddress,'/*/City') = ExtractValue(t1.shipAddress,'/*/City')) ORDER BY t0.oid ASC
SELECT t0.oid, t0.version, t0.amount, t0.CUSTOMER_COUNTRYCODE, t0.CUSTOMER_ID, t0.delivered, t0.shipAddress FROM TORDER t0 CROSS JOIN TCUSTOMER t1 WHERE (ExtractValue(t0.shipAddress,'/*/City') = t1.city)

4. connectedConfiguration method is used to determine whether XML column is
   supported in the database.

5. MySQL does not have a dedicated XML data type. They just added a couple of XML functions
   operating on string types. This requires a change in how Column.isXML() is implemented.
   The current version does:

   return _typeName != null && _typeName.startsWith("XML");

   Not surprisingly this fails while on MySQL. To remedy this I have added the
   "XML" property to Column and XMLValueHandler sets it to true. However,
   I also had to modify MappingInfo, otherwise this new property was
   losing its value. Let me know if there is a better solution for this.

6. If the patch is going to be applied, I will provide an update for the
   manual too.

7. I welcome comments and suggestions. 



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-846) XML column support for MySQL

Posted by "Milosz Tylenda (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-846?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Milosz Tylenda updated OPENJPA-846:
-----------------------------------

    Attachment: OPENJPA-846.patch

The patch is now attached.

> XML column support for MySQL
> ----------------------------
>
>                 Key: OPENJPA-846
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-846
>             Project: OpenJPA
>          Issue Type: New Feature
>          Components: sql
>    Affects Versions: 2.0.0
>         Environment: MySQL 5.1.30
>            Reporter: Milosz Tylenda
>         Attachments: OPENJPA-846.patch
>
>
> 1. The attached patch provides XML column support for MySQL.
> 2. Reading the MySQL manual one can expect the minimum required MySQL
>    version is 5.1.5 but I tested the patch only on version 5.1.30 - this is
>    the first general availability version in the 5.1 series.
> 3. ExtractValue MySQL function is used to do XML comparisons.
>    TestXMLCustomerOrder.mysql file contains samples of SQL.
>    Sample queries generated by the patched code:
> SELECT t0.oid, t1.oid FROM TORDER t0 CROSS JOIN TORDER t1 WHERE (ExtractValue(t0.shipAddress,'/*/City') = ExtractValue(t1.shipAddress,'/*/City')) ORDER BY t0.oid ASC
> SELECT t0.oid, t0.version, t0.amount, t0.CUSTOMER_COUNTRYCODE, t0.CUSTOMER_ID, t0.delivered, t0.shipAddress FROM TORDER t0 CROSS JOIN TCUSTOMER t1 WHERE (ExtractValue(t0.shipAddress,'/*/City') = t1.city)
> 4. connectedConfiguration method is used to determine whether XML column is
>    supported in the database.
> 5. MySQL does not have a dedicated XML data type. They just added a couple of XML functions
>    operating on string types. This requires a change in how Column.isXML() is implemented.
>    The current version does:
>    return _typeName != null && _typeName.startsWith("XML");
>    Not surprisingly this fails while on MySQL. To remedy this I have added the
>    "XML" property to Column and XMLValueHandler sets it to true. However,
>    I also had to modify MappingInfo, otherwise this new property was
>    losing its value. Let me know if there is a better solution for this.
> 6. If the patch is going to be applied, I will provide an update for the
>    manual too.
> 7. I welcome comments and suggestions. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (OPENJPA-846) XML column support for MySQL

Posted by "Catalina Wei (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-846?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Catalina Wei resolved OPENJPA-846.
----------------------------------

    Resolution: Fixed

Thanks to Milosz Tylenda, 
your patch has been committed at trunk r734601 and 1.3.x r734600.
Please open a subtask of this issue or a new issue for  OpenJPA Manual updates for Xmlmapping support for MySQL.





> XML column support for MySQL
> ----------------------------
>
>                 Key: OPENJPA-846
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-846
>             Project: OpenJPA
>          Issue Type: New Feature
>          Components: sql
>    Affects Versions: 2.0.0
>         Environment: MySQL 5.1.30
>            Reporter: Milosz Tylenda
>         Attachments: OPENJPA-846.patch
>
>
> 1. The attached patch provides XML column support for MySQL.
> 2. Reading the MySQL manual one can expect the minimum required MySQL
>    version is 5.1.5 but I tested the patch only on version 5.1.30 - this is
>    the first general availability version in the 5.1 series.
> 3. ExtractValue MySQL function is used to do XML comparisons.
>    TestXMLCustomerOrder.mysql file contains samples of SQL.
>    Sample queries generated by the patched code:
> SELECT t0.oid, t1.oid FROM TORDER t0 CROSS JOIN TORDER t1 WHERE (ExtractValue(t0.shipAddress,'/*/City') = ExtractValue(t1.shipAddress,'/*/City')) ORDER BY t0.oid ASC
> SELECT t0.oid, t0.version, t0.amount, t0.CUSTOMER_COUNTRYCODE, t0.CUSTOMER_ID, t0.delivered, t0.shipAddress FROM TORDER t0 CROSS JOIN TCUSTOMER t1 WHERE (ExtractValue(t0.shipAddress,'/*/City') = t1.city)
> 4. connectedConfiguration method is used to determine whether XML column is
>    supported in the database.
> 5. MySQL does not have a dedicated XML data type. They just added a couple of XML functions
>    operating on string types. This requires a change in how Column.isXML() is implemented.
>    The current version does:
>    return _typeName != null && _typeName.startsWith("XML");
>    Not surprisingly this fails while on MySQL. To remedy this I have added the
>    "XML" property to Column and XMLValueHandler sets it to true. However,
>    I also had to modify MappingInfo, otherwise this new property was
>    losing its value. Let me know if there is a better solution for this.
> 6. If the patch is going to be applied, I will provide an update for the
>    manual too.
> 7. I welcome comments and suggestions. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-846) XML column support for MySQL

Posted by "Michael Dick (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12667719#action_12667719 ] 

Michael Dick commented on OPENJPA-846:
--------------------------------------

Do we need additional test cases for this issue? 

> XML column support for MySQL
> ----------------------------
>
>                 Key: OPENJPA-846
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-846
>             Project: OpenJPA
>          Issue Type: New Feature
>          Components: sql
>    Affects Versions: 2.0.0
>         Environment: MySQL 5.1.30
>            Reporter: Milosz Tylenda
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: OPENJPA-846.patch
>
>
> 1. The attached patch provides XML column support for MySQL.
> 2. Reading the MySQL manual one can expect the minimum required MySQL
>    version is 5.1.5 but I tested the patch only on version 5.1.30 - this is
>    the first general availability version in the 5.1 series.
> 3. ExtractValue MySQL function is used to do XML comparisons.
>    TestXMLCustomerOrder.mysql file contains samples of SQL.
>    Sample queries generated by the patched code:
> SELECT t0.oid, t1.oid FROM TORDER t0 CROSS JOIN TORDER t1 WHERE (ExtractValue(t0.shipAddress,'/*/City') = ExtractValue(t1.shipAddress,'/*/City')) ORDER BY t0.oid ASC
> SELECT t0.oid, t0.version, t0.amount, t0.CUSTOMER_COUNTRYCODE, t0.CUSTOMER_ID, t0.delivered, t0.shipAddress FROM TORDER t0 CROSS JOIN TCUSTOMER t1 WHERE (ExtractValue(t0.shipAddress,'/*/City') = t1.city)
> 4. connectedConfiguration method is used to determine whether XML column is
>    supported in the database.
> 5. MySQL does not have a dedicated XML data type. They just added a couple of XML functions
>    operating on string types. This requires a change in how Column.isXML() is implemented.
>    The current version does:
>    return _typeName != null && _typeName.startsWith("XML");
>    Not surprisingly this fails while on MySQL. To remedy this I have added the
>    "XML" property to Column and XMLValueHandler sets it to true. However,
>    I also had to modify MappingInfo, otherwise this new property was
>    losing its value. Let me know if there is a better solution for this.
> 6. If the patch is going to be applied, I will provide an update for the
>    manual too.
> 7. I welcome comments and suggestions. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-846) XML column support for MySQL

Posted by "Milosz Tylenda (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-846?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Milosz Tylenda updated OPENJPA-846:
-----------------------------------

    Fix Version/s: 2.0.0
                   1.3.0

> XML column support for MySQL
> ----------------------------
>
>                 Key: OPENJPA-846
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-846
>             Project: OpenJPA
>          Issue Type: New Feature
>          Components: sql
>    Affects Versions: 2.0.0
>         Environment: MySQL 5.1.30
>            Reporter: Milosz Tylenda
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: OPENJPA-846.patch
>
>
> 1. The attached patch provides XML column support for MySQL.
> 2. Reading the MySQL manual one can expect the minimum required MySQL
>    version is 5.1.5 but I tested the patch only on version 5.1.30 - this is
>    the first general availability version in the 5.1 series.
> 3. ExtractValue MySQL function is used to do XML comparisons.
>    TestXMLCustomerOrder.mysql file contains samples of SQL.
>    Sample queries generated by the patched code:
> SELECT t0.oid, t1.oid FROM TORDER t0 CROSS JOIN TORDER t1 WHERE (ExtractValue(t0.shipAddress,'/*/City') = ExtractValue(t1.shipAddress,'/*/City')) ORDER BY t0.oid ASC
> SELECT t0.oid, t0.version, t0.amount, t0.CUSTOMER_COUNTRYCODE, t0.CUSTOMER_ID, t0.delivered, t0.shipAddress FROM TORDER t0 CROSS JOIN TCUSTOMER t1 WHERE (ExtractValue(t0.shipAddress,'/*/City') = t1.city)
> 4. connectedConfiguration method is used to determine whether XML column is
>    supported in the database.
> 5. MySQL does not have a dedicated XML data type. They just added a couple of XML functions
>    operating on string types. This requires a change in how Column.isXML() is implemented.
>    The current version does:
>    return _typeName != null && _typeName.startsWith("XML");
>    Not surprisingly this fails while on MySQL. To remedy this I have added the
>    "XML" property to Column and XMLValueHandler sets it to true. However,
>    I also had to modify MappingInfo, otherwise this new property was
>    losing its value. Let me know if there is a better solution for this.
> 6. If the patch is going to be applied, I will provide an update for the
>    manual too.
> 7. I welcome comments and suggestions. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-846) XML column support for MySQL

Posted by "Catalina Wei (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12667732#action_12667732 ] 

Catalina Wei commented on OPENJPA-846:
--------------------------------------

No additional test cases are needed for MySQL database.


> XML column support for MySQL
> ----------------------------
>
>                 Key: OPENJPA-846
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-846
>             Project: OpenJPA
>          Issue Type: New Feature
>          Components: sql
>    Affects Versions: 2.0.0
>         Environment: MySQL 5.1.30
>            Reporter: Milosz Tylenda
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: OPENJPA-846.patch
>
>
> 1. The attached patch provides XML column support for MySQL.
> 2. Reading the MySQL manual one can expect the minimum required MySQL
>    version is 5.1.5 but I tested the patch only on version 5.1.30 - this is
>    the first general availability version in the 5.1 series.
> 3. ExtractValue MySQL function is used to do XML comparisons.
>    TestXMLCustomerOrder.mysql file contains samples of SQL.
>    Sample queries generated by the patched code:
> SELECT t0.oid, t1.oid FROM TORDER t0 CROSS JOIN TORDER t1 WHERE (ExtractValue(t0.shipAddress,'/*/City') = ExtractValue(t1.shipAddress,'/*/City')) ORDER BY t0.oid ASC
> SELECT t0.oid, t0.version, t0.amount, t0.CUSTOMER_COUNTRYCODE, t0.CUSTOMER_ID, t0.delivered, t0.shipAddress FROM TORDER t0 CROSS JOIN TCUSTOMER t1 WHERE (ExtractValue(t0.shipAddress,'/*/City') = t1.city)
> 4. connectedConfiguration method is used to determine whether XML column is
>    supported in the database.
> 5. MySQL does not have a dedicated XML data type. They just added a couple of XML functions
>    operating on string types. This requires a change in how Column.isXML() is implemented.
>    The current version does:
>    return _typeName != null && _typeName.startsWith("XML");
>    Not surprisingly this fails while on MySQL. To remedy this I have added the
>    "XML" property to Column and XMLValueHandler sets it to true. However,
>    I also had to modify MappingInfo, otherwise this new property was
>    losing its value. Let me know if there is a better solution for this.
> 6. If the patch is going to be applied, I will provide an update for the
>    manual too.
> 7. I welcome comments and suggestions. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.