You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Pinaki Poddar <pp...@bea.com> on 2007/08/20 20:29:07 UTC
RE: Question about lists in fluid / xsd
Hi Rutger,
> I've just started using fluid to generate domain objects and fluid
looks like a very nice package for this :-)
Thank you.
You are right about the restrictins in generating list of complex types.
It is a limitation of processing SDO properties in Fluid and not of
OpenJPA. My local sandbox copy of Fluid generates mapping for
List<String>. I will update a version in the website (can not do it now
because I have broken some other things :).
If this is support is urgent for you, you can patch
src/main/java/org/apache/openjpa/sdo/mapping/PrimitiveListMapping.java
as follows:
public String getFieldTypeName() {
- return "java.util.List<" +
- ImplHelper.getComponentType(property.getType()).
- getInstanceClass().getName() + ">";
+ Type elementType =
ImplHelper.getComponentType(property.getType());
+ if (elementType==null)
+ elementType = property.getType();
+ return "java.util.List<" +
elementType.getInstanceClass().getName() + ">";
}
FYI, in the next version Fluid will support dynamic bytecode
generation such that no intermediate code generation will be required.
Pinaki Poddar
972.834.2865
________________________________
From: Rutger Lubbers [mailto:Rutger.Lubbers@qnh.nl]
Sent: Monday, August 20, 2007 8:34 AM
To: Pinaki Poddar
Subject: Question about lists in fluid / xsd
Hi Pinaki,
I've just started using fluid to generate domain objects and
fluid looks like a very nice package for this :-)
A small question about the xsd that fluid (openJPA?) accepts.
It accepts a complex type as a definition of a list, but it does
not allow a primitive type to be defined as a list.
I mean, that it does accept:
<xs:element name="authors" >
<xs:complexType>
<xs:sequence>
<xs:element name="authorName"
type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
And does not accept:
<xs:element name="authors" type="xs:string" minOccurs="1"
maxOccurs="unbounded"/>
Is there a reason for this? (I haven't been able to dig deeper
into this, but it looks like the type mapping generated returns a null
implementation for the type of this list...)
Why this question? The last one is a bit easier to model :-)
Thanks & Kind Regards,
Rutger Lubbers
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.