openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pinaki Poddar" <ppod...@bea.com>
Subject RE: Question about lists in fluid / xsd
Date Mon, 20 Aug 2007 18:29:07 GMT
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.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message