You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Luca Vercelli <l....@finsoft.it> on 2018/01/23 09:19:42 UTC

What are complex types?

Hello,

can somebody give me an example of "complex type"? I didn't catch that 
from documentation.

Thank you




-- 
Luca Vercelli

Finsoft srl
C.so Svizzera 185/bis
10149 Torino

Mail: l.vercelli@finsoft.it

Re: What are complex types?

Posted by Luca Vercelli <l....@finsoft.it>.
Yes, this looks more clear to me. Thank you.



Il 23/01/2018 14:11, Tom van Wietmarschen ha scritto:
> The difference is that an Entity type can be addressed directly,  a complex type can only be part of an entity (or a return value of a function. or a parameter, etc.)
>
> Or to put it in database terms: an entity has a primary key.
>
> If you look at it as a tree, the Entity is the root node, a complex value a non-root node and and a primitive value is a leaf.
>
> /Tom
>
>> On 23 Jan 2018, at 13:59, Luca Vercelli <l....@finsoft.it> wrote:
>>
>> Thank you Oliver for your answer.
>>
>> However, in your example, PostalAddressData could also be a "normal" EntityType, am I wrong?
>>
>> <EntityType Name="PostalAddressData">
>>      <Property Name="Street" Type="Edm.String" MaxLength="255"/>
>>      <Property Name="City" Type="Edm.String" MaxLength="255"/>
>>      <Property Name="House" Type="Edm.String" MaxLength="255"/>
>> </EntityType>
>>
>> I cannot understand the difference.
>>
>>
>>
>> Il 23/01/2018 13:42, Grande, Oliver ha scritto:
>>> Hello Luca,
>>>
>>> from my perspective Complex Types gives you the ability to structure your entities and to reuse the structures in different entities. As an example we want to assume that you like to model an Address, which has a bundle of fields like City, Street and Number. The Address can now be used in two different entities like Good, as the address the good shall be shipped, and Invoice, as the address an invoice is send to. The metadata may now look like this:
>>>
>>> ...
>>> <EntityType Name=" Good">
>>> 	...
>>> 	<Property Name="Address" Type="... .PostalAddressData"/>
>>> 	....
>>> </EntityType>
>>> <EntityType Name=" Invoice">
>>> 	...
>>> 	<Property Name="Address" Type="... .PostalAddressData"/>
>>> 	....
>>> </EntityType>
>>>
>>> <ComplexType Name="PostalAddressData">
>>> 	<Property Name="Street" Type="Edm.String" MaxLength="255"/>
>>> 	<Property Name="City" Type="Edm.String" MaxLength="255"/>
>>> 	<Property Name="House" Type="Edm.String" MaxLength="255"/>
>>> </ComplexType>
>>>
>>> In addition you are able to just read the data of a complex type:
>>>
>>> .../ Good('abc')/ Address
>>>
>>> Regards,
>>> Oliver
>>>
>>>
>>> -----Original Message-----
>>> From: Luca Vercelli [mailto:l.vercelli@finsoft.it]
>>> Sent: Dienstag, 23. Januar 2018 10:20
>>> To: user@olingo.apache.org
>>> Subject: What are complex types?
>>>
>>> Hello,
>>>
>>> can somebody give me an example of "complex type"? I didn't catch that
>>> from documentation.
>>>
>>> Thank you
>>>
>>>
>>>
>>>
>> -- 
>> Luca Vercelli
>>
>> Finsoft srl
>> C.so Svizzera 185/bis
>> 10149 Torino
>>
>> Mail: l.vercelli@finsoft.it
>>
>

-- 
Luca Vercelli

Finsoft srl
C.so Svizzera 185/bis
10149 Torino

Mail: l.vercelli@finsoft.it


Re: What are complex types?

Posted by Tom van Wietmarschen <aa...@gmail.com>.
The difference is that an Entity type can be addressed directly,  a complex type can only be part of an entity (or a return value of a function. or a parameter, etc.) 

Or to put it in database terms: an entity has a primary key. 

If you look at it as a tree, the Entity is the root node, a complex value a non-root node and and a primitive value is a leaf. 

/Tom

> On 23 Jan 2018, at 13:59, Luca Vercelli <l....@finsoft.it> wrote:
> 
> Thank you Oliver for your answer.
> 
> However, in your example, PostalAddressData could also be a "normal" EntityType, am I wrong?
> 
> <EntityType Name="PostalAddressData">
>     <Property Name="Street" Type="Edm.String" MaxLength="255"/>
>     <Property Name="City" Type="Edm.String" MaxLength="255"/>
>     <Property Name="House" Type="Edm.String" MaxLength="255"/>
> </EntityType>
> 
> I cannot understand the difference.
> 
> 
> 
> Il 23/01/2018 13:42, Grande, Oliver ha scritto:
>> Hello Luca,
>> 
>> from my perspective Complex Types gives you the ability to structure your entities and to reuse the structures in different entities. As an example we want to assume that you like to model an Address, which has a bundle of fields like City, Street and Number. The Address can now be used in two different entities like Good, as the address the good shall be shipped, and Invoice, as the address an invoice is send to. The metadata may now look like this:
>> 
>> ...
>> <EntityType Name=" Good">
>> 	...
>> 	<Property Name="Address" Type="... .PostalAddressData"/>
>> 	....
>> </EntityType>
>> <EntityType Name=" Invoice">
>> 	...
>> 	<Property Name="Address" Type="... .PostalAddressData"/>
>> 	....
>> </EntityType>
>> 
>> <ComplexType Name="PostalAddressData">
>> 	<Property Name="Street" Type="Edm.String" MaxLength="255"/>
>> 	<Property Name="City" Type="Edm.String" MaxLength="255"/>
>> 	<Property Name="House" Type="Edm.String" MaxLength="255"/>
>> </ComplexType>
>> 
>> In addition you are able to just read the data of a complex type:
>> 
>> .../ Good('abc')/ Address
>> 
>> Regards,
>> Oliver
>> 
>> 
>> -----Original Message-----
>> From: Luca Vercelli [mailto:l.vercelli@finsoft.it]
>> Sent: Dienstag, 23. Januar 2018 10:20
>> To: user@olingo.apache.org
>> Subject: What are complex types?
>> 
>> Hello,
>> 
>> can somebody give me an example of "complex type"? I didn't catch that
>> from documentation.
>> 
>> Thank you
>> 
>> 
>> 
>> 
> 
> -- 
> Luca Vercelli
> 
> Finsoft srl
> C.so Svizzera 185/bis
> 10149 Torino
> 
> Mail: l.vercelli@finsoft.it
> 


Re: What are complex types?

Posted by Luca Vercelli <l....@finsoft.it>.
Thank you Oliver for your answer.

However, in your example, PostalAddressData could also be a "normal" 
EntityType, am I wrong?

<EntityType Name="PostalAddressData">
     <Property Name="Street" Type="Edm.String" MaxLength="255"/>
     <Property Name="City" Type="Edm.String" MaxLength="255"/>
     <Property Name="House" Type="Edm.String" MaxLength="255"/>
</EntityType>

I cannot understand the difference.



Il 23/01/2018 13:42, Grande, Oliver ha scritto:
> Hello Luca,
>
> from my perspective Complex Types gives you the ability to structure your entities and to reuse the structures in different entities. As an example we want to assume that you like to model an Address, which has a bundle of fields like City, Street and Number. The Address can now be used in two different entities like Good, as the address the good shall be shipped, and Invoice, as the address an invoice is send to. The metadata may now look like this:
>
> ...
> <EntityType Name=" Good">
> 	...
> 	<Property Name="Address" Type="... .PostalAddressData"/>
> 	....
> </EntityType>
> <EntityType Name=" Invoice">
> 	...
> 	<Property Name="Address" Type="... .PostalAddressData"/>
> 	....
> </EntityType>
>
> <ComplexType Name="PostalAddressData">
> 	<Property Name="Street" Type="Edm.String" MaxLength="255"/>
> 	<Property Name="City" Type="Edm.String" MaxLength="255"/>
> 	<Property Name="House" Type="Edm.String" MaxLength="255"/>
> </ComplexType>
>
> In addition you are able to just read the data of a complex type:
>
> .../ Good('abc')/ Address
>
> Regards,
> Oliver
>
>
> -----Original Message-----
> From: Luca Vercelli [mailto:l.vercelli@finsoft.it]
> Sent: Dienstag, 23. Januar 2018 10:20
> To: user@olingo.apache.org
> Subject: What are complex types?
>
> Hello,
>
> can somebody give me an example of "complex type"? I didn't catch that
> from documentation.
>
> Thank you
>
>
>
>

-- 
Luca Vercelli

Finsoft srl
C.so Svizzera 185/bis
10149 Torino

Mail: l.vercelli@finsoft.it


RE: What are complex types?

Posted by "Grande, Oliver" <ol...@sap.com>.
Hello Luca,

from my perspective Complex Types gives you the ability to structure your entities and to reuse the structures in different entities. As an example we want to assume that you like to model an Address, which has a bundle of fields like City, Street and Number. The Address can now be used in two different entities like Good, as the address the good shall be shipped, and Invoice, as the address an invoice is send to. The metadata may now look like this:

...
<EntityType Name=" Good">
	...
	<Property Name="Address" Type="... .PostalAddressData"/>
	....
</EntityType>
<EntityType Name=" Invoice">
	...
	<Property Name="Address" Type="... .PostalAddressData"/>
	....
</EntityType>

<ComplexType Name="PostalAddressData">
	<Property Name="Street" Type="Edm.String" MaxLength="255"/>
	<Property Name="City" Type="Edm.String" MaxLength="255"/>
	<Property Name="House" Type="Edm.String" MaxLength="255"/>
</ComplexType>

In addition you are able to just read the data of a complex type:

.../ Good('abc')/ Address

Regards,
Oliver


-----Original Message-----
From: Luca Vercelli [mailto:l.vercelli@finsoft.it] 
Sent: Dienstag, 23. Januar 2018 10:20
To: user@olingo.apache.org
Subject: What are complex types?

Hello,

can somebody give me an example of "complex type"? I didn't catch that 
from documentation.

Thank you




-- 
Luca Vercelli

Finsoft srl
C.so Svizzera 185/bis
10149 Torino

Mail: l.vercelli@finsoft.it