Entity Attributes of collection of custom type

Dear Forum members,


I am looking for ways to declare an attribute of an entity as collection of a custom type (entity). For example I have entity named "requestInfo" which has attribute "simInformationList" which needs to a collection of type "simInformation".

Kindly let me know how do I do this?


Thanks & regards

Deepak

Hi Deepak,

I'm not sure what you mean. Entities map to database tables, and Attributes to database columns. "Lists" of things do not exist in (rational) databases. Afaik, there's no such thing as a "collection" in a database.

You can have Structures with Lists, but if you need to store such a data structure in the database, you need two tables, and therefore two Entities. This is all pretty elementary database design.

Dear Kilian,

Appreciate your quick response. And, also agree about the point you made about the elementary database design. However, my query was not from database perspective. I am trying to create the custom data types that can be used as data contract for a web service.

But, you made a point that entities map to database. Does entities should always map to database tables? or we can use them as custom data types as well?

Thanks & regards

Deepak

Hi Deepak,

For SOAP and REST services, OutSystems uses Structures. You can easily create a Structure based on the JSON (if you have a REST service). However, this is so elementary OutSystems, I would advise you to visit or revisit the tutorials if you haven't got that down.