...
Code Block | ||
---|---|---|
| ||
<collections> <collection name="MyQueue" is="Queue" contains="MyEntity" factoryid="1" id="5" /> <collection name="MySet" is="Set" contains="MyEntity" factoryid="1" id="6" /> <collection name="MyLongMap" contains="MyEntity" is="LongMap" factoryid="1" id="7" /> <collection name="MyStringMap" contains="CollectionObject" is="LongMap" factoryid="1" id="8" /> </collections> <entity name="MyEntity" factoryid="1" id="1"> <field name="aQueue" type="MyQueue"/> <field name="aMap" type="MyStringMap/> </entity> |
Generated Source
Defined collections entites are generated to extend/implement their java collection type:
Code Block | ||||
---|---|---|---|---|
| ||||
@Generated(value="com.neeve.adm.AdmGenerator", date="Fri Jan 23 02:03:22 PST 2015") public interface IChildLongMap extends IRogLongMap<Child1>, Map<Long, Child1> {} @Generated(value="com.neeve.adm.AdmXbufGenerator", date="Fri Jan 23 02:03:22 PST 2015") final public class ChildLongMap extends RogLongMap<Child1> implements IChildLongMap, IXbufDesyncer, IRogJsonizable {...} |
...
The fields from an embedded entity can be 'inlined' into another message or entity. Inlining an embedded entity produces the same result as if all of the fields for the given entity were defined on the entity itself. It is also possible to inline the fields of one message into another message. It is not possible to inline the fields of an entity into an embedded entity or message, nor is it possible to inline the fields of Message into an embedded entity or entity. a Message or a non embedded entity at this time.
A type that inlines another type will generate code that implements the inlined types's generated interface.
...
- An embedded entity cannot be inlined into another embedded entity in a manner that will produce inlining cycles.
- An embedded entity cannot inline a Message or Entity.
- Messages and non embedded entities cannot inline non embedded entities. entites cannot be inlined.
- A Message can't inline 2 embedded entities that have conflicting field definitions (e.g. fields with the same name but with attributes that differ in any way other than their doc or required attributes). In the case of required, if an embedded entity defines a field as required, then it will be required on the message.
- The isKey and pinned field attributes on an embedded entity are ignored when the entity is inlined into another message or entity.
- A Message can't define fields that conflict with any of its inlined embedded entities (e.g. fields with the same name but with attributes that differ in any way other than their doc or required attributes).
Exceptions to this rule are:- required: In the case of the required attribute, the value set on a message field wins (a particular message can override the required field attribute on an inlined embedded entity).
- isKeyField: entity or message inlining the embedded entity can set the isKey attribute for a given inlined field.
- pinned: the pinned attribute can be overridden by the inlinining entity.
...
Code Block | ||
---|---|---|
| ||
public interface IMyEmbeddedEntity { public void setMyStringField(final String field); public String getMyStringField(); public void setMyIntField(final int field); public int getMyIntField(); } public interface IMyOtherEmbeddedEntity { public void setMyDateField(final Date field); public Date getMyDateField(); public void setMyBooleanField(final boolean field); public boolean getMyBooleanField(); } public interface IMessage extends IRogNode, IRogMessage, IMyEmbeddedEntity, IMyOtherEmbeddedEntity{ public void setMyEnumerationField(final MyEnumeration field); public MyEnumeration getMyEnumerationField(); public void setMyStringField(final String field); public String getMyStringField(); public void setMyIntField(final int field); public int getMyIntField(); public void setMyDateField(final Date field); public Date getMyDateField(); public void setMyBooleanField(final boolean field); public boolean getMyBooleanField(); } |
Inlined Messages
Warning |
---|
At present, it is not possible to declare a Message as a field of another Message or Embedded Entity. This functionality may be added in a future release. |
Required Field Validation
...