openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Catalina Wei (JIRA)" <j...@apache.org>
Subject [jira] Updated: (OPENJPA-240) Persistent field mappings to database supported XML columns
Date Fri, 13 Jul 2007 01:09:04 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-240?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Catalina Wei updated OPENJPA-240:
---------------------------------

    Attachment: jpa1.0.0-xmlmapping.r555694.patch

The attached patch is for this feature to support Query over XML mapping columns.
It extends the JPA Path expressions to support queries over persistent fields that are mapped
to XML columns.
To make use of this feature,  You need to add the following property to your persistence.xml:

  <property name="openjpa.MetaDataRepository"
           value="org.apache.openjpa.jdbc.meta.XMLMappingRepository"/>

0.1.1	Query support for XML Mappings
This feature is also extending the path expressions to support XML mappings. The path expressions
and predicates over the XML binding class are converted to XML predicates and XPATH and pushed
down to database. 
The path expressions of XML binding classes are similar to that of embeddable classes. The
regular embedded classes are structurally restricted to one level but the XML binding classes
do not have such restrictions. Furthermore, the embedded fields in XML mappings can be multi-valued
collections. However, traversing through multi-valued collection is not allowed.

Query support for the path expressions of the XML mappings is limited to simple comparison
predicates only for now. We will add more support to handle other JPQL predicates as we see
where they are applicable in the future. 

(Note 1: Path expressions of XML mappings are not allowed in select expressions, i.e. the
persistent field can appear in the selection list but the nested sub-fields can not.)
(Note 2: As it stands now, no proper blocking enforcements are in place. Attempting to do
what is not allowed may get unexpected results.)

0.1.2 Query examples (see attached documentation for the sample Order entity)

The following query finds all Orders that ship to 'San Jose' city:
Select o from Order o where o.shipAddress.city = 'San Jose'

The following query retrieves shipAddress of all Orders:
    Select o.shipAddress from Order o 


Will attach a sample application soon.

Catalina

> Persistent field mappings to database supported XML columns
> -----------------------------------------------------------
>
>                 Key: OPENJPA-240
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-240
>             Project: OpenJPA
>          Issue Type: New Feature
>          Components: jdbc
>            Reporter: Catalina Wei
>         Attachments: jpa1.0.0-xmlmapping.r555694.patch, OpenJPAXMLMapping.doc
>
>
> Many database systems such as DB2 version 9, Oracle 10g, and SQLServer 2005 have support
for XML column types. XML documents can be stored natively in the XML columns in the database.
> What is OpenJPA's position of supporting the XML columns ?

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


Mime
View raw message