openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Linskey" <plins...@bea.com>
Subject RE: JPA Bug:Nesting of Emebedded in Embeddable element
Date Wed, 04 Apr 2007 21:37:37 GMT
That's just a limitation of the JPA spec. See section 9.1.34.

OpenJPA supports embedded fields in embeddable instances, as well as
various other usages of embedded things, but those are extensions to the
spec. Due to OPENJPA-125, you can only configure nested embeddeds via
annotations currently.

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc. 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Sharath_H [mailto:Sharath_H@infosys.com] 
> Sent: Wednesday, April 04, 2007 2:16 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: JPA Bug:Nesting of Emebedded in Embeddable element
> 
> 
> Hi,
>  
> In orm_1_0.xsd or orm-xsd.rsrc files under the 
> <xsd:complexType name="embeddable-attributes"> the 
> <xsd:element name="embedded" type="orm:embedded"    
> minOccurs="0" maxOccurs="unbounded"/> is not present.
>  
> Please let me know if there is any valid reason behind it.Was 
> the embedded element in embeddable-attributes was accidently 
> missed out?
>  
> I faced the issue when i tried the example something like as 
> shown below:
>  
> class A
> {
>   int id;
>   B objB;
>   
> }
>  
> class B
> {
>   String str1;
>   Date d;
>   C objC;
> }
>  
> class C
> {
>    String str2;
> }
>  
> I wanted to persist object A into a single table by having 
> object B as embedded and object B inturn having object C as embedded.
> My corresponding orm mapping file is as shown below:
>  
> <?xml version="1.0" encoding="UTF-8"?>
> <entity-mappings 
> xmlns="http://java.sun.com/xml/ns/persistence/orm" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
>  orm_1_0.xsd" version="1.0">
>  
> <entity class="A">    
> <table name="TableA"/>    
> <attributes> 
> <id name="id">        
>  <column name="ID"/>                   
> </id>  
> <embedded name="objB"/>
> </attributes>
> </entity>
>  
> <embeddable class="B">      
> <attributes>          
> <basic name="str1">
>    <column name="COL2"/>
> </basic>     
> <basic name="d">
>    <column name="DateCol"/>
> </basic>
> <embedded name="objC"/>
> </embeddable>
> 
> <embeddable class="C">      
> <attributes> 
> <basic name="str2">
>    <column name="COL3"/>
> </basic>     
> </embeddable>
> 
> </entity-mappings>
>  
> This was not possible due to orm schema restriction.
>  
>  
>  
> Thanks,
> Regards,
> Sharath.H
> 
> **************** CAUTION - Disclaimer *****************
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION 
> intended solely for the use of the addressee(s). If you are 
> not the intended recipient, please notify the sender by 
> e-mail and delete the original message. Further, you are not 
> to copy, disclose, or distribute this e-mail or its contents 
> to any other person and any such actions are unlawful. This 
> e-mail may contain viruses. Infosys has taken every 
> reasonable precaution to minimize this risk, but is not 
> liable for any damage you may sustain as a result of any 
> virus in this e-mail. You should carry out your own virus 
> checks before opening the e-mail or attachment. Infosys 
> reserves the right to monitor and review the content of all 
> messages sent to or from this e-mail address. Messages sent 
> to or from this e-mail address may be stored on the Infosys 
> e-mail system.
> ***INFOSYS******** End of Disclaimer ********INFOSYS***
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA
Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,
 copyrighted  and/or legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient, and have received
this message in error, please immediately return this by email and then delete it.

Mime
View raw message