<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://download.osbee.org/documentation/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Worayeno</id>
		<title>OS.bee documentation - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://download.osbee.org/documentation/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Worayeno"/>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php/Special:Contributions/Worayeno"/>
		<updated>2026-04-10T23:32:58Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=Entity_DSL&amp;diff=3720</id>
		<title>Entity DSL</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=Entity_DSL&amp;diff=3720"/>
				<updated>2019-02-06T12:36:02Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: /* Reserved Keywords */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
The Entity DSL facilitates the handling of persistence entities. Defining entities using the Entity DSL efficiently creates a clean entity model that contains all relevant semantic elements of the model text file. &lt;br /&gt;
This semantic model is used to automatically transform the semantic information into proper Java code with the respective annotations for a persistence provider. Additionally, if the entity model is located within a project with OSBP nature, &amp;quot;Auto-DTOs&amp;quot; and services are generated as well. In this case, attributes that are added to entities will automatically be transferred to the &amp;quot;Auto-DTOs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The main semantic elements of the Compex Entity DSL are the following:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Package&amp;quot; - the root element that contains all the other elements. A model can contain multiple packages. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Import&amp;quot; declarations - used to import external models or even Java classes. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Datatype&amp;quot; declarations - a way to define datatypes that can be used in entities and beans. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Entity&amp;quot; - the abstraction of a business model entity. It contains further elements such as properties and references. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Bean&amp;quot; - does not compile to a JPA Entity but to a Java Bean (POJO with getter and setter and PropertyChange-Support). Beans may be used as temporary containers in entity operations or can be embedded into JPA Entities. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Enum&amp;quot; - the abstraction for Java enums. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Property&amp;quot; - a reference to an embedded Bean, an Enum, a Java class or a simple datatype (as defined in the datatype declaration). Offers multiplicity. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Reference&amp;quot; - a reference to another Entity (or to another Bean in the case of a Bean). Offers multiplicity. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Operations&amp;quot; - similar to Java methods. The Xbase expression language can be used to write high-level code. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Annotations&amp;quot; can be placed on Entity, Property and Reference. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Comments&amp;quot; can be added to all elements.&lt;br /&gt;
&lt;br /&gt;
== Entity model files ==&lt;br /&gt;
&lt;br /&gt;
Entity models are described in .entitymodel files. These files describe the entity model and are the basis for the code generation. Entity models may be split over several .entitymodel files containing packages in the same namespace.&lt;br /&gt;
An .entitymodel file may contain several packages with entities. However, from a performance point of view, a complex entity model may work better with more and smaller .entitymodel files than the same model crammed into a few large files (or even a single file).&lt;br /&gt;
&lt;br /&gt;
===package===&lt;br /&gt;
Entity model files must start with a package declaration. Packages are the root element of the Entity DSL grammar. Everything is contained in a package: Imports, Entities, Beans and Enums have to be defined inside the Package definition. One document can contain multiple packages with unique names. &lt;br /&gt;
The elements a package can contain are Entities, Beans and Enums. Additionally, a package allows Import statements and the declaration of datatypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  package name {&lt;br /&gt;
     import importStatement;&lt;br /&gt;
     datatype datatypeDefinition;&lt;br /&gt;
     entities/beans/enums&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:entity-1.png|center|frame|''Figure 1 - Entity model file - a package is the topmost element and contains other items.'']]&lt;br /&gt;
&lt;br /&gt;
Marking a DTO as abstract (before the dto keyword) generates an abstract Java class for it.&lt;br /&gt;
&lt;br /&gt;
The following modifiers may be placed after the dto keyword and the DTO name:&lt;br /&gt;
&lt;br /&gt;
=== import ===&lt;br /&gt;
The Entity DSL allows the referencing of entities defined in different packages, even in different .entitymodel files. The import statement is a way to make these elements available in the current namespace without having to address them by their fully qualified name. &lt;br /&gt;
&lt;br /&gt;
Import statements allow the use of the '*' wildcard.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
	import importStatement;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:entity-2.png|center|frame|''Figure 2: Items contained in another package can be addressed if the package is imported using the import keyword and its fully qualified name.'']]&lt;br /&gt;
&lt;br /&gt;
=== datatype ===&lt;br /&gt;
The Entity DSL allows the definition of datatypes. These are translated by the inferrer into their standard Java representation. The behavior of the generator can be controlled by the datatype definitions.&lt;br /&gt;
Datatypes defined in an .entitymodel file are local to that file. In order to define datatypes in one place and have them available in multiple .entitymodel files, the datatypes may be defined in a &amp;quot;.datatypes&amp;quot; file containing only datatype definitions inside a package statement.&lt;br /&gt;
There are three types of datatype definitions:&lt;br /&gt;
&lt;br /&gt;
* '''jvmTypes''': Datatype definitons that map types to '''jvmTypes''' take the basic syntax of&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;datatype &amp;lt;name&amp;gt; jvmType &amp;lt;type&amp;gt; as primitive;&amp;lt;/code&amp;gt;.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Specifying datatypes in this manner uses an appropriate wrapper class in the generated Java code; adding the keywords &amp;lt;code&amp;gt;as primitive&amp;lt;/code&amp;gt; enforces the use of primitive datatypes where applicable:&lt;br /&gt;
&amp;lt;code&amp;gt;datatype foo jvmType Integer;&amp;lt;/code&amp;gt; compiles to an &amp;lt;code&amp;gt;Integer&amp;lt;/code&amp;gt; whereas &amp;lt;code&amp;gt;datatype foo jvmType Integer as primitive;&amp;lt;/code&amp;gt; results in &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:entity-3.png|center|frame|''Figure 3: The defined datatype is translated to a wrapper class.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-4.png|center|frame|''Figure 4: By adding the &amp;lt;code&amp;gt;as primitive&amp;lt;/code&amp;gt; keywords, the datatype is translated to a primitive datatype.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* '''dateTypes''': The datatypes for handling temporal information can be defined by the following statement: &lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;datatype &amp;lt;name&amp;gt; datetype date—time—timestamp; &amp;lt;/code&amp;gt;&lt;br /&gt;
Datatypes that have been defined in this manner can be used as property variables in entities and beans.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-5.png|center|frame|''Figure 5: Defining datatypes for handling temporal information. Content assist is available.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* '''blobs''': Binary blobs can be handled by defining a datatype with the &amp;lt;code&amp;gt;as blob&amp;lt;/code&amp;gt; keywords. The Java implementation of such a blob is a byte array. Appropriate persistence annotations are automatically added.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;datatype &amp;lt;name&amp;gt; as blob;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-6.png|center|frame|''Figure 6: Including binary blobs by using a datatype with the &amp;lt;code&amp;gt;as blob&amp;lt;/code&amp;gt; keywords.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;After import statements and datatype definitions, the content of the .entitymodel file is made up of &amp;lt;code&amp;gt;entity&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;bean&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;enum&amp;lt;/code&amp;gt; definitions.&lt;br /&gt;
&lt;br /&gt;
== Entities ==&lt;br /&gt;
Entities are the most complex elements in the Entity DSL. An entity is an abstraction above a business object. Entities are defined by their name, properties, references and operations. Generally, an entity is an object which can keep the state of variables and references as well as be persisted. &lt;br /&gt;
For each entity that is defined in a package, a Java class and the corresponding persistence structure is automatically generated. Inside a project with Compex nature, &amp;quot;Auto-DTOs&amp;quot; and services are created as well.&lt;br /&gt;
&lt;br /&gt;
Entities may extend other entities. In this case, they are derived from their parent entity. That means that the properties and references of the parent entity are inherited.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 [modifiers] entity &amp;lt;name&amp;gt; extends &amp;lt;parentEntity&amp;gt; {&lt;br /&gt;
     [entityProperties]&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-7.png|center|frame|''Figure 7: Items contained in another package can be addressed if the package is imported using the &amp;lt;code&amp;gt;import&amp;lt;/code&amp;gt; keyword and its fully qualified name'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Entities may be defined with certain modifiers that change the generated Java Code. The following modifiers are supported:&lt;br /&gt;
&lt;br /&gt;
=== abstract ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;abstract&amp;lt;/code&amp;gt; marks the entity as &amp;quot;abstract&amp;quot;. This generates an abstract Java class.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-8.png|center|frame|''Figure 8: The &amp;lt;code&amp;gt;abstract&amp;lt;/code&amp;gt; keyword causes the translation into an abstract Java class'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== historized ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;historized&amp;lt;/code&amp;gt; marks the entity as &amp;quot;historized&amp;quot;. Historized entities can have several entries in a database, but only one of them may be marked as current.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;historized&amp;lt;/code&amp;gt; keyword adds an object ID, a version field and a flag for the current version to the entity.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-9.png|center|frame|''Figure 9: The &amp;lt;code&amp;gt;historized&amp;lt;/code&amp;gt; modifier triggers the creation of an object ID, an object version and a flag for marking the current version.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== cacheable ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;cacheable&amp;lt;/code&amp;gt; marks the entity as &amp;quot;cacheable&amp;quot;. The appropriate annotation for the persistence provider is added to the generated Java code.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-10.png|center|frame|''Figure 10: Declaring an entity to be &amp;lt;code&amp;gt;cacheable&amp;lt;/code&amp;gt; adds the &amp;lt;code&amp;gt;@Cacheable&amp;lt;/code&amp;gt; annotation'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== timedependent ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;timedependent&amp;lt;/code&amp;gt; marks the entity as &amp;quot;time-dependent&amp;quot;. An object may have several entries in the database. Which entry is valid will be determined by '''valid from''' and '''valid until''' fields that are added to the entity.&lt;br /&gt;
An object ID is created in order to tie the entries together. The &amp;lt;code&amp;gt;timedependent&amp;lt;/code&amp;gt; keyword recognizes the modifiers &amp;lt;code&amp;gt;(DATE)&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;(TIMESTAMP)&amp;lt;/code&amp;gt;. Default is &amp;lt;code&amp;gt;timedependent(DATE)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-11.png|center|frame|''Figure 11: The &amp;lt;code&amp;gt;timedependent&amp;lt;/code&amp;gt; keyword causes an object ID, a validFrom and a validUntil field to be created in order to support multiple database entries for an object.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== mapped superclass ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;mapped superclass&amp;lt;/code&amp;gt; marks a class that provides persistent entity state and mapping information for its subclasses, but which is not an entity itself.&lt;br /&gt;
&lt;br /&gt;
Typically, the purpose of a mapped superclass is to define state and mapping information that is common to multiple entities. All the mappings from the mapped superclass are inherited by its subclasses, as if they had been defined there directly.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-12.png|center|frame|''Figure 12: The &amp;lt;code&amp;gt;mapped superclass&amp;lt;/code&amp;gt; keyword sets the appropriate annotation which causes the persistence provider to move the mappings to the derived subclasses.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===extends===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The modifier &amp;lt;code&amp;gt;extends&amp;lt;/code&amp;gt; may be placed after the entity keyword and the entity name, as &amp;lt;code&amp;gt;entity foo extends bar {&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; has already been defined as an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;extends&amp;lt;/code&amp;gt; marks an entity that is derived from another entity. That means that the properties and references of the parent entity are inherited.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Entity Persistence Settings==&lt;br /&gt;
&lt;br /&gt;
Apart from the mapped superclass modifier that moves all property columns to the tables belonging to derived classes, the following settings for table inheritance can be specified within an entity definition:&lt;br /&gt;
* inheritance per class&lt;br /&gt;
* inheritance per subclass&lt;br /&gt;
&lt;br /&gt;
The structure of the database created from an entity model can be controlled by the following settings:&lt;br /&gt;
* schemaName&lt;br /&gt;
* tableName&lt;br /&gt;
* discriminatorColumn&lt;br /&gt;
* discriminatorType&lt;br /&gt;
* discriminatorValue&lt;br /&gt;
&lt;br /&gt;
===inheritance per class===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;inheritance per class{}&amp;lt;/code&amp;gt; causes a table to be created for each class; subclasses share this table using a discriminator value. This statement has to be followed by braces, inside of which further details can be specified.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-13.png|center|frame|''Figure 13: A single table for entity Base is created; the generated Java code for the “Derived” class shows that the “Derived” entity is added to this table by using a discriminator.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===inheritance per subclass===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;inheritance per subclass{}&amp;lt;/code&amp;gt; causes a table to be created for each subclass. This statement has to be followed by braces, inside of which further details can be specified. This is the default behaviour if no inheritance strategy is specified.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-14.png|center|frame|''Figure 14: An &amp;lt;code&amp;gt;@Table&amp;lt;/code&amp;gt; annotation is added to the generated Java code, so that the &amp;quot;Derived&amp;quot; entity is mapped to a table of its own.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===schemaName===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;schemaName&amp;lt;/code&amp;gt; allows the specification of a name for the database schema to be used. This setting is translated to the appropriate JPA annotation &amp;lt;code&amp;gt;@Table(schema = &amp;lt;xyz&amp;gt;)&amp;lt;/code&amp;gt;. The schema name given is converted to snake case using capitals.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===tableName===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;tableName&amp;lt;/code&amp;gt; allows the specification of a name for the table (within the database schema) to which the entity is mapped. This setting is translated to the appropriate JPA annotation &lt;br /&gt;
&amp;lt;code&amp;gt;@Table(name = &amp;lt;xyz&amp;gt;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The table name specified is converted to snake case using capitals. The default value is the name of the entity.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-15.png|center|frame|''Figure 15: Specifying the &amp;lt;code&amp;gt;schemaName&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;tableName&amp;lt;/code&amp;gt; settings in an entity determines the name of the database schema and tables used for persistence.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===discriminatorColumn===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;discriminatorColumn&amp;lt;/code&amp;gt; optionally allows the specification of a name for the discriminator column in the case of &amp;lt;code&amp;gt;inheritance per class&amp;lt;/code&amp;gt;. It appears within the braces after the inheritance-strategy statement and must be followed by a semicolon. It defaults to &amp;lt;code&amp;gt;DISC&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===discriminatorType===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;discriminatorType&amp;lt;/code&amp;gt; optionally allows the definition of the datatype of the discriminator within the single table. It can be set to &amp;lt;code&amp;gt;CHAR&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;INT&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;STRING&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;INHERIT&amp;lt;/code&amp;gt;. It appears within the braces after the &amp;lt;code&amp;gt;inheritance&amp;lt;/code&amp;gt; statement and must be followed by a semicolon. It defaults to &amp;lt;code&amp;gt;STRING;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===discriminatorValue===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;discriminatorValue&amp;lt;/code&amp;gt; allows a custom value to be used for the discriminator within the single table. It appears within the braces after the &amp;lt;code&amp;gt;inheritance&amp;lt;/code&amp;gt; statement and must be followed by a semicolon. It defaults to the entity name converted to snake case.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-16.png|center|frame|''Figure 16: The &amp;lt;code&amp;gt;inheritance&amp;lt;/code&amp;gt; statement allows the optional specification of discriminator column, type and value to be used in the case of a single table.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Beans==&lt;br /&gt;
&lt;br /&gt;
'''Beans''' are objects that are embedded in other entities, inheriting their persistence and lifecycle. Similar to entities, beans are characterised by their name, their properties and their references. For each bean that is defined in a package, a Java class is automatically generated.&lt;br /&gt;
&lt;br /&gt;
Beans can be embedded into entities by defining them as properties of the respective entity. The appropriate annotations (&amp;lt;code&amp;gt;@Embeddable&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@Embedded&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@AttributeOverrides&amp;lt;/code&amp;gt; etc.) are added in order to have beans persisted with their parent entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-17.png|center|frame|''Figure 17: Beans can be embedded in entities and are persisted with them.'']]&lt;br /&gt;
&lt;br /&gt;
==Enums==&lt;br /&gt;
&lt;br /&gt;
'''Enums''' are an abstraction of the Java &amp;lt;code&amp;gt;enum&amp;lt;/code&amp;gt;. They compile to &amp;lt;code&amp;gt;enum&amp;lt;/code&amp;gt; classes and can be used as properties in entities and beans.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-18.png|center|frame|''Figure 18: Defining &amp;lt;code&amp;gt;enums&amp;lt;/code&amp;gt; allows using them as variables in entities and beans.'']]&lt;br /&gt;
&lt;br /&gt;
==Properties==&lt;br /&gt;
Properties of entities and beans are references to datatypes or enums. They can be regarded as variables and are defined by a keyword followed by a datatype (Java type or datatype defined in the &amp;lt;code&amp;gt;datatype&amp;lt;/code&amp;gt; section) and a name. By defining a bean as a property of an entity, it is embedded in it.&lt;br /&gt;
&lt;br /&gt;
Properties can be determined with the following keywords:&lt;br /&gt;
&lt;br /&gt;
===var===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The basic property &amp;lt;code&amp;gt;var&amp;lt;/code&amp;gt; defines a variable that is persisted in a table column. A property must have a type and a name. &lt;br /&gt;
&lt;br /&gt;
'''Multiplicity''' of properties can be controlled by the following (optional) settings: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;[1]&amp;lt;/code&amp;gt; defines a non-nullable property. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..1]&amp;lt;/code&amp;gt; defines a nullable property (this is the default behavior). &lt;br /&gt;
* &amp;lt;code&amp;gt;[1..*]&amp;lt;/code&amp;gt; defines a list of properties that must not be empty. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..*]&amp;lt;/code&amp;gt; or simply &amp;lt;code&amp;gt;[*]&amp;lt;/code&amp;gt; defines a list of properties that may be empty.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-19.png|center|frame|''Figure 19: Variables can be defined using the &amp;lt;code&amp;gt;var&amp;lt;/code&amp;gt; keyword.'']]&lt;br /&gt;
&lt;br /&gt;
The appropriate persistence settings are generated automatically. If a multiplicity is specified, the appropriate annotations (and, if necessary, a list rather than a single variable) are generated.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===derived===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;derived&amp;lt;/code&amp;gt; defines a property that is derived from other properties. The derived property must be have a type, a name and the calculation logic that derives it from the other properties, written as an Xexpression in braces.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-20.png|center|frame|''Figure 20: Properties may be derived from other properties using an Xexpression.'']]&lt;br /&gt;
&lt;br /&gt;
The code is automatically translated to valid Java code.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dirty===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; defines a property used as a flag to track the &amp;quot;dirty&amp;quot; state of the buffered data when editing values, before the changes have been written back to the persistence entity. Only one &amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; flag is allowed per entity. The datatype has to be boolean.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-21.png|center|frame|''Figure 21: The &amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; property is used to flag whether changes have been made to the bufered data, but not yet written back to the persistence entity. '']]&lt;br /&gt;
&lt;br /&gt;
The boolean field for this property and the appropriate annotation are generated with the &amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; keyword.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===domainDescription===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;domainDescription&amp;lt;/code&amp;gt; defines a property that is used as a domain description. The appropriate annotation is added to the property. A domain description must be of type &amp;lt;code&amp;gt;String&amp;lt;/code&amp;gt;. Domain descriptions may be derived from other properties.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-22.png|center|frame|''Figure 22: Domain description properties can be created with the &amp;lt;code&amp;gt;domainDescription&amp;lt;/code&amp;gt; keyword.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===domainKey===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;domainKey&amp;lt;/code&amp;gt; defines a domain key. The appropriate annotation is added to the property. Primitive datatypes may be used as domain keys.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-23.png|center|frame|''Figure 23: A field containing a domain key is created with the &amp;lt;code&amp;gt;domainKey keyword&amp;lt;/code&amp;gt;.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===id===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
{{Deprecated}}&lt;br /&gt;
&lt;br /&gt;
'''id''' defines an ID property (used as a primary key by the JPA compiler). '''This keyword is deprecated - use uuid instead'''. If no &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; is specified, a warning is given. &lt;br /&gt;
&lt;br /&gt;
'''Caution''': ID autogeneration causes problems, since the value is not set before the entity is persisted, e.g., in the database. It is therefore advised to use the &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; keyword instead.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-24.png|center|frame|''Figure 24: Entities are supposed to have an ID property that is used as a primary key to the underlying database.'']]&lt;br /&gt;
&lt;br /&gt;
'''Caution''': The generated IDs are not necessarily unique if the deprecated &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; keyword is used!&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===index===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt; keyword causes an index for the table to be generated. Indexes may be based on one or more properties (primitive only) and references (one-to-one only) of the entity. An index must be given a name and, in braces, a list of the fields it is based upon. If the &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt; keyword is prefixed with &amp;lt;code&amp;gt;unique&amp;lt;/code&amp;gt;, a unique index is created.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-25.png|center|frame|''Figure 25: Database table indexes that map entities are generated with the &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt; keyword.'']]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;@Table&amp;lt;/code&amp;gt; annotation is supplemented with the index definition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===properties===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Features (properties and references) of entities and beans can optionally be given additional information in the form of key-value pairs. This information can then be retrieved from the semantic model. The key-value pairs are defined in parentheses after the properties keyword following the feature name. Multiple pairs can be defined (comma-separated).&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-26.png|center|frame|''Figure 26: Additional information about features can be defined by key-value pairs. This information is then stored in the semantic model and is retrievable.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===uuid===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; allows the use of Universally Unique IDs as primary keys. A new UUID value is generated for each object as soon as that object has been created, independently of database operations. This circumvents the problems with the &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; keyword. UUIDs have to be of type &amp;lt;code&amp;gt;String&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-27.png|center|frame|''Figure 27: By using the &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; keyword, entities are created with a reliably unique identifier.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===version===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; defines a version-property (used by the JPA-Compiler).&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-28.png|center|frame|''Figure 28: A &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; property can be added to entities and beans.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===transient===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;transient&amp;lt;/code&amp;gt; marks the property as transient. Instead of a &amp;lt;code&amp;gt;@Column&amp;lt;/code&amp;gt;, a &amp;lt;code&amp;gt;@Transient&amp;lt;/code&amp;gt; annotation is generated, so that the property is not persisted in the database.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-29.png|center|frame|''Figure 29: The &amp;lt;code&amp;gt;transient&amp;lt;/code&amp;gt; keyword enables the exclusion of properties from persistence.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
The Entity DSL tracks relationships between entities by using the concept of &amp;quot;references&amp;quot;. References can exist between objects of the same nature (entities to entities, beans to beans). Where appropriate, back references (&amp;quot;opposite&amp;quot;) are added.&lt;br /&gt;
References are defined by the &amp;lt;code&amp;gt;ref&amp;lt;/code&amp;gt; keyword, a target, an optional type and a name. The exact type of the reference can be specified with the following modifiers:&lt;br /&gt;
&lt;br /&gt;
===Multiplicity and nullability===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The Entity DSL supports the specification of multiplicities in square brackets appended to the type: &lt;br /&gt;
* &amp;lt;code&amp;gt;[1]&amp;lt;/code&amp;gt; defines a non-nullable, one-to-one relationship. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..1]&amp;lt;/code&amp;gt; defines a nullable, one-to-one relationship (this is the default behavior). &lt;br /&gt;
* &amp;lt;code&amp;gt;[1..*]&amp;lt;/code&amp;gt; defines a non-nullable, one-to-many relationship. An &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; reference is needed. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..*]&amp;lt;/code&amp;gt; or simply &amp;lt;code&amp;gt;[*]&amp;lt;/code&amp;gt; defines a nullable, one-to-many relationship. An &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; reference is needed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-30.png|center|frame|''Figure 30: Adding multiplicity &amp;quot;[1]&amp;quot; causes the annotations for non-nullable database entries to be set.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===opposite reference===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Lifecycle references need the specification of an opposite reference. This can be done with the &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; keyword.&lt;br /&gt;
&lt;br /&gt;
Using the &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; reference, it is possible to navigate back to the original object after following the reference. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===cascade===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; specifier controls the behavior of the database on delete operations. If an object with a &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; reference to other objects is deleted, those other objects will be removed as well.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-31.png|center|frame|''Figure 31: By using the &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; keywords, bidirectional associations can be achieved.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Operations==&lt;br /&gt;
&lt;br /&gt;
Operations are other important features. They are based on Xbase and offer a huge set of semantic features, extending the featureset of Java. Xbase additionally offers features such as closures.&lt;br /&gt;
Operations can be declared by the &amp;lt;code&amp;gt;def&amp;lt;/code&amp;gt; keyword followed by braces containing the inline operation.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-32.png|center|frame|''Figure 32: The &amp;lt;code&amp;gt;def&amp;lt;/code&amp;gt; keyword allows the inlining of custom methods in the Entity DSL code.'']]&lt;br /&gt;
&lt;br /&gt;
These methods are translated into the appropriate Java methods along with the automatically generated getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
==Annotations==&lt;br /&gt;
&lt;br /&gt;
Annotations can be added to all elements except import declarations. Specifying annotations in the Entity DSL works in a straightforward manner; content assist is available. The added annotations are taken over into the generated Java code.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-33.png|center|frame|''Figure 33: Annotating elements in the Compex Entity DSL causes an annotation to be inserted into the generated Java code.'']]&lt;br /&gt;
&lt;br /&gt;
These methods are translated into the appropriate Java methods along with the automatically generated getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
&lt;br /&gt;
Comments can be added anywhere in an .entitymodel text file and are copied over into the generated Java code. Comments are enclosed in &amp;lt;code&amp;gt;/* ... */&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-34.png|center|frame|''Figure 34: The comments added in the Entity DSL are transformed to Java-style comments in the generated code.'']]&lt;br /&gt;
&lt;br /&gt;
Comments before the &amp;lt;code&amp;gt;package&amp;lt;/code&amp;gt; keyword are copied over to all generated Java classes – this is the place for copyright notices.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-35.png|center|frame|''Figure 35: A comment before the package keyword ends up in all generated Java classes.'']]&lt;br /&gt;
&lt;br /&gt;
==Reserved Keywords==&lt;br /&gt;
&lt;br /&gt;
The keywords of the Entity DSL are syntactic features and can therefore not be used as semantic identifiers. &lt;br /&gt;
&lt;br /&gt;
In order to circumvent this, it is possible to escape them with the &amp;lt;code&amp;gt;^&amp;lt;/code&amp;gt; character. During the generation of the Java code, this escape character is removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-36.png|center|frame|''Figure 36: Using the escape character '^', it is possible to achieve an identifier in the generated Java code with a name that would be a reserved word in the Entity DSL. In this case, a variable named &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; is generated that cannot be specified in the entity model file.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note that you are '''not allowed to use identifiers corresponding to reserved keywords''' of the supported databases you can find here below: &lt;br /&gt;
&lt;br /&gt;
[https://db.apache.org/derby/docs/10.2/ref/rrefkeywords29722.html Derby]&lt;br /&gt;
&lt;br /&gt;
[http://www.h2database.com/html/advanced.html?highlight=reserved&amp;amp;search=reser#firstFound H2]&lt;br /&gt;
&lt;br /&gt;
[https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/reserved-keywords?view=sql-server-2017 MS SQL]&lt;br /&gt;
&lt;br /&gt;
[https://docs.oracle.com/database/121/SQLRF/ap_keywd001.htm#SQLRF55621 Oracle]&lt;br /&gt;
&lt;br /&gt;
[​https://dev.mysql.com/doc/refman/8.0/en/keywords.html MySQL]&lt;br /&gt;
&lt;br /&gt;
[​https://www.postgresql.org/docs/8.2/sql-keywords-appendix.html PostgreSQL]&lt;br /&gt;
&lt;br /&gt;
== Copyright Notice ==&lt;br /&gt;
{{Copyright Notice}}&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=Entity_DSL&amp;diff=3719</id>
		<title>Entity DSL</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=Entity_DSL&amp;diff=3719"/>
				<updated>2019-02-06T12:32:21Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: /* Reserved Keywords */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
The Entity DSL facilitates the handling of persistence entities. Defining entities using the Entity DSL efficiently creates a clean entity model that contains all relevant semantic elements of the model text file. &lt;br /&gt;
This semantic model is used to automatically transform the semantic information into proper Java code with the respective annotations for a persistence provider. Additionally, if the entity model is located within a project with OSBP nature, &amp;quot;Auto-DTOs&amp;quot; and services are generated as well. In this case, attributes that are added to entities will automatically be transferred to the &amp;quot;Auto-DTOs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The main semantic elements of the Compex Entity DSL are the following:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Package&amp;quot; - the root element that contains all the other elements. A model can contain multiple packages. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Import&amp;quot; declarations - used to import external models or even Java classes. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Datatype&amp;quot; declarations - a way to define datatypes that can be used in entities and beans. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Entity&amp;quot; - the abstraction of a business model entity. It contains further elements such as properties and references. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Bean&amp;quot; - does not compile to a JPA Entity but to a Java Bean (POJO with getter and setter and PropertyChange-Support). Beans may be used as temporary containers in entity operations or can be embedded into JPA Entities. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Enum&amp;quot; - the abstraction for Java enums. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Property&amp;quot; - a reference to an embedded Bean, an Enum, a Java class or a simple datatype (as defined in the datatype declaration). Offers multiplicity. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Reference&amp;quot; - a reference to another Entity (or to another Bean in the case of a Bean). Offers multiplicity. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Operations&amp;quot; - similar to Java methods. The Xbase expression language can be used to write high-level code. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Annotations&amp;quot; can be placed on Entity, Property and Reference. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Comments&amp;quot; can be added to all elements.&lt;br /&gt;
&lt;br /&gt;
== Entity model files ==&lt;br /&gt;
&lt;br /&gt;
Entity models are described in .entitymodel files. These files describe the entity model and are the basis for the code generation. Entity models may be split over several .entitymodel files containing packages in the same namespace.&lt;br /&gt;
An .entitymodel file may contain several packages with entities. However, from a performance point of view, a complex entity model may work better with more and smaller .entitymodel files than the same model crammed into a few large files (or even a single file).&lt;br /&gt;
&lt;br /&gt;
===package===&lt;br /&gt;
Entity model files must start with a package declaration. Packages are the root element of the Entity DSL grammar. Everything is contained in a package: Imports, Entities, Beans and Enums have to be defined inside the Package definition. One document can contain multiple packages with unique names. &lt;br /&gt;
The elements a package can contain are Entities, Beans and Enums. Additionally, a package allows Import statements and the declaration of datatypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  package name {&lt;br /&gt;
     import importStatement;&lt;br /&gt;
     datatype datatypeDefinition;&lt;br /&gt;
     entities/beans/enums&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:entity-1.png|center|frame|''Figure 1 - Entity model file - a package is the topmost element and contains other items.'']]&lt;br /&gt;
&lt;br /&gt;
Marking a DTO as abstract (before the dto keyword) generates an abstract Java class for it.&lt;br /&gt;
&lt;br /&gt;
The following modifiers may be placed after the dto keyword and the DTO name:&lt;br /&gt;
&lt;br /&gt;
=== import ===&lt;br /&gt;
The Entity DSL allows the referencing of entities defined in different packages, even in different .entitymodel files. The import statement is a way to make these elements available in the current namespace without having to address them by their fully qualified name. &lt;br /&gt;
&lt;br /&gt;
Import statements allow the use of the '*' wildcard.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
	import importStatement;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:entity-2.png|center|frame|''Figure 2: Items contained in another package can be addressed if the package is imported using the import keyword and its fully qualified name.'']]&lt;br /&gt;
&lt;br /&gt;
=== datatype ===&lt;br /&gt;
The Entity DSL allows the definition of datatypes. These are translated by the inferrer into their standard Java representation. The behavior of the generator can be controlled by the datatype definitions.&lt;br /&gt;
Datatypes defined in an .entitymodel file are local to that file. In order to define datatypes in one place and have them available in multiple .entitymodel files, the datatypes may be defined in a &amp;quot;.datatypes&amp;quot; file containing only datatype definitions inside a package statement.&lt;br /&gt;
There are three types of datatype definitions:&lt;br /&gt;
&lt;br /&gt;
* '''jvmTypes''': Datatype definitons that map types to '''jvmTypes''' take the basic syntax of&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;datatype &amp;lt;name&amp;gt; jvmType &amp;lt;type&amp;gt; as primitive;&amp;lt;/code&amp;gt;.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Specifying datatypes in this manner uses an appropriate wrapper class in the generated Java code; adding the keywords &amp;lt;code&amp;gt;as primitive&amp;lt;/code&amp;gt; enforces the use of primitive datatypes where applicable:&lt;br /&gt;
&amp;lt;code&amp;gt;datatype foo jvmType Integer;&amp;lt;/code&amp;gt; compiles to an &amp;lt;code&amp;gt;Integer&amp;lt;/code&amp;gt; whereas &amp;lt;code&amp;gt;datatype foo jvmType Integer as primitive;&amp;lt;/code&amp;gt; results in &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:entity-3.png|center|frame|''Figure 3: The defined datatype is translated to a wrapper class.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-4.png|center|frame|''Figure 4: By adding the &amp;lt;code&amp;gt;as primitive&amp;lt;/code&amp;gt; keywords, the datatype is translated to a primitive datatype.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* '''dateTypes''': The datatypes for handling temporal information can be defined by the following statement: &lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;datatype &amp;lt;name&amp;gt; datetype date—time—timestamp; &amp;lt;/code&amp;gt;&lt;br /&gt;
Datatypes that have been defined in this manner can be used as property variables in entities and beans.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-5.png|center|frame|''Figure 5: Defining datatypes for handling temporal information. Content assist is available.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* '''blobs''': Binary blobs can be handled by defining a datatype with the &amp;lt;code&amp;gt;as blob&amp;lt;/code&amp;gt; keywords. The Java implementation of such a blob is a byte array. Appropriate persistence annotations are automatically added.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;datatype &amp;lt;name&amp;gt; as blob;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-6.png|center|frame|''Figure 6: Including binary blobs by using a datatype with the &amp;lt;code&amp;gt;as blob&amp;lt;/code&amp;gt; keywords.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;After import statements and datatype definitions, the content of the .entitymodel file is made up of &amp;lt;code&amp;gt;entity&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;bean&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;enum&amp;lt;/code&amp;gt; definitions.&lt;br /&gt;
&lt;br /&gt;
== Entities ==&lt;br /&gt;
Entities are the most complex elements in the Entity DSL. An entity is an abstraction above a business object. Entities are defined by their name, properties, references and operations. Generally, an entity is an object which can keep the state of variables and references as well as be persisted. &lt;br /&gt;
For each entity that is defined in a package, a Java class and the corresponding persistence structure is automatically generated. Inside a project with Compex nature, &amp;quot;Auto-DTOs&amp;quot; and services are created as well.&lt;br /&gt;
&lt;br /&gt;
Entities may extend other entities. In this case, they are derived from their parent entity. That means that the properties and references of the parent entity are inherited.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 [modifiers] entity &amp;lt;name&amp;gt; extends &amp;lt;parentEntity&amp;gt; {&lt;br /&gt;
     [entityProperties]&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-7.png|center|frame|''Figure 7: Items contained in another package can be addressed if the package is imported using the &amp;lt;code&amp;gt;import&amp;lt;/code&amp;gt; keyword and its fully qualified name'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Entities may be defined with certain modifiers that change the generated Java Code. The following modifiers are supported:&lt;br /&gt;
&lt;br /&gt;
=== abstract ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;abstract&amp;lt;/code&amp;gt; marks the entity as &amp;quot;abstract&amp;quot;. This generates an abstract Java class.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-8.png|center|frame|''Figure 8: The &amp;lt;code&amp;gt;abstract&amp;lt;/code&amp;gt; keyword causes the translation into an abstract Java class'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== historized ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;historized&amp;lt;/code&amp;gt; marks the entity as &amp;quot;historized&amp;quot;. Historized entities can have several entries in a database, but only one of them may be marked as current.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;historized&amp;lt;/code&amp;gt; keyword adds an object ID, a version field and a flag for the current version to the entity.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-9.png|center|frame|''Figure 9: The &amp;lt;code&amp;gt;historized&amp;lt;/code&amp;gt; modifier triggers the creation of an object ID, an object version and a flag for marking the current version.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== cacheable ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;cacheable&amp;lt;/code&amp;gt; marks the entity as &amp;quot;cacheable&amp;quot;. The appropriate annotation for the persistence provider is added to the generated Java code.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-10.png|center|frame|''Figure 10: Declaring an entity to be &amp;lt;code&amp;gt;cacheable&amp;lt;/code&amp;gt; adds the &amp;lt;code&amp;gt;@Cacheable&amp;lt;/code&amp;gt; annotation'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== timedependent ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;timedependent&amp;lt;/code&amp;gt; marks the entity as &amp;quot;time-dependent&amp;quot;. An object may have several entries in the database. Which entry is valid will be determined by '''valid from''' and '''valid until''' fields that are added to the entity.&lt;br /&gt;
An object ID is created in order to tie the entries together. The &amp;lt;code&amp;gt;timedependent&amp;lt;/code&amp;gt; keyword recognizes the modifiers &amp;lt;code&amp;gt;(DATE)&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;(TIMESTAMP)&amp;lt;/code&amp;gt;. Default is &amp;lt;code&amp;gt;timedependent(DATE)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-11.png|center|frame|''Figure 11: The &amp;lt;code&amp;gt;timedependent&amp;lt;/code&amp;gt; keyword causes an object ID, a validFrom and a validUntil field to be created in order to support multiple database entries for an object.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== mapped superclass ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;mapped superclass&amp;lt;/code&amp;gt; marks a class that provides persistent entity state and mapping information for its subclasses, but which is not an entity itself.&lt;br /&gt;
&lt;br /&gt;
Typically, the purpose of a mapped superclass is to define state and mapping information that is common to multiple entities. All the mappings from the mapped superclass are inherited by its subclasses, as if they had been defined there directly.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-12.png|center|frame|''Figure 12: The &amp;lt;code&amp;gt;mapped superclass&amp;lt;/code&amp;gt; keyword sets the appropriate annotation which causes the persistence provider to move the mappings to the derived subclasses.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===extends===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The modifier &amp;lt;code&amp;gt;extends&amp;lt;/code&amp;gt; may be placed after the entity keyword and the entity name, as &amp;lt;code&amp;gt;entity foo extends bar {&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; has already been defined as an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;extends&amp;lt;/code&amp;gt; marks an entity that is derived from another entity. That means that the properties and references of the parent entity are inherited.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Entity Persistence Settings==&lt;br /&gt;
&lt;br /&gt;
Apart from the mapped superclass modifier that moves all property columns to the tables belonging to derived classes, the following settings for table inheritance can be specified within an entity definition:&lt;br /&gt;
* inheritance per class&lt;br /&gt;
* inheritance per subclass&lt;br /&gt;
&lt;br /&gt;
The structure of the database created from an entity model can be controlled by the following settings:&lt;br /&gt;
* schemaName&lt;br /&gt;
* tableName&lt;br /&gt;
* discriminatorColumn&lt;br /&gt;
* discriminatorType&lt;br /&gt;
* discriminatorValue&lt;br /&gt;
&lt;br /&gt;
===inheritance per class===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;inheritance per class{}&amp;lt;/code&amp;gt; causes a table to be created for each class; subclasses share this table using a discriminator value. This statement has to be followed by braces, inside of which further details can be specified.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-13.png|center|frame|''Figure 13: A single table for entity Base is created; the generated Java code for the “Derived” class shows that the “Derived” entity is added to this table by using a discriminator.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===inheritance per subclass===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;inheritance per subclass{}&amp;lt;/code&amp;gt; causes a table to be created for each subclass. This statement has to be followed by braces, inside of which further details can be specified. This is the default behaviour if no inheritance strategy is specified.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-14.png|center|frame|''Figure 14: An &amp;lt;code&amp;gt;@Table&amp;lt;/code&amp;gt; annotation is added to the generated Java code, so that the &amp;quot;Derived&amp;quot; entity is mapped to a table of its own.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===schemaName===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;schemaName&amp;lt;/code&amp;gt; allows the specification of a name for the database schema to be used. This setting is translated to the appropriate JPA annotation &amp;lt;code&amp;gt;@Table(schema = &amp;lt;xyz&amp;gt;)&amp;lt;/code&amp;gt;. The schema name given is converted to snake case using capitals.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===tableName===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;tableName&amp;lt;/code&amp;gt; allows the specification of a name for the table (within the database schema) to which the entity is mapped. This setting is translated to the appropriate JPA annotation &lt;br /&gt;
&amp;lt;code&amp;gt;@Table(name = &amp;lt;xyz&amp;gt;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The table name specified is converted to snake case using capitals. The default value is the name of the entity.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-15.png|center|frame|''Figure 15: Specifying the &amp;lt;code&amp;gt;schemaName&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;tableName&amp;lt;/code&amp;gt; settings in an entity determines the name of the database schema and tables used for persistence.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===discriminatorColumn===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;discriminatorColumn&amp;lt;/code&amp;gt; optionally allows the specification of a name for the discriminator column in the case of &amp;lt;code&amp;gt;inheritance per class&amp;lt;/code&amp;gt;. It appears within the braces after the inheritance-strategy statement and must be followed by a semicolon. It defaults to &amp;lt;code&amp;gt;DISC&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===discriminatorType===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;discriminatorType&amp;lt;/code&amp;gt; optionally allows the definition of the datatype of the discriminator within the single table. It can be set to &amp;lt;code&amp;gt;CHAR&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;INT&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;STRING&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;INHERIT&amp;lt;/code&amp;gt;. It appears within the braces after the &amp;lt;code&amp;gt;inheritance&amp;lt;/code&amp;gt; statement and must be followed by a semicolon. It defaults to &amp;lt;code&amp;gt;STRING;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===discriminatorValue===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;discriminatorValue&amp;lt;/code&amp;gt; allows a custom value to be used for the discriminator within the single table. It appears within the braces after the &amp;lt;code&amp;gt;inheritance&amp;lt;/code&amp;gt; statement and must be followed by a semicolon. It defaults to the entity name converted to snake case.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-16.png|center|frame|''Figure 16: The &amp;lt;code&amp;gt;inheritance&amp;lt;/code&amp;gt; statement allows the optional specification of discriminator column, type and value to be used in the case of a single table.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Beans==&lt;br /&gt;
&lt;br /&gt;
'''Beans''' are objects that are embedded in other entities, inheriting their persistence and lifecycle. Similar to entities, beans are characterised by their name, their properties and their references. For each bean that is defined in a package, a Java class is automatically generated.&lt;br /&gt;
&lt;br /&gt;
Beans can be embedded into entities by defining them as properties of the respective entity. The appropriate annotations (&amp;lt;code&amp;gt;@Embeddable&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@Embedded&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@AttributeOverrides&amp;lt;/code&amp;gt; etc.) are added in order to have beans persisted with their parent entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-17.png|center|frame|''Figure 17: Beans can be embedded in entities and are persisted with them.'']]&lt;br /&gt;
&lt;br /&gt;
==Enums==&lt;br /&gt;
&lt;br /&gt;
'''Enums''' are an abstraction of the Java &amp;lt;code&amp;gt;enum&amp;lt;/code&amp;gt;. They compile to &amp;lt;code&amp;gt;enum&amp;lt;/code&amp;gt; classes and can be used as properties in entities and beans.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-18.png|center|frame|''Figure 18: Defining &amp;lt;code&amp;gt;enums&amp;lt;/code&amp;gt; allows using them as variables in entities and beans.'']]&lt;br /&gt;
&lt;br /&gt;
==Properties==&lt;br /&gt;
Properties of entities and beans are references to datatypes or enums. They can be regarded as variables and are defined by a keyword followed by a datatype (Java type or datatype defined in the &amp;lt;code&amp;gt;datatype&amp;lt;/code&amp;gt; section) and a name. By defining a bean as a property of an entity, it is embedded in it.&lt;br /&gt;
&lt;br /&gt;
Properties can be determined with the following keywords:&lt;br /&gt;
&lt;br /&gt;
===var===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The basic property &amp;lt;code&amp;gt;var&amp;lt;/code&amp;gt; defines a variable that is persisted in a table column. A property must have a type and a name. &lt;br /&gt;
&lt;br /&gt;
'''Multiplicity''' of properties can be controlled by the following (optional) settings: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;[1]&amp;lt;/code&amp;gt; defines a non-nullable property. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..1]&amp;lt;/code&amp;gt; defines a nullable property (this is the default behavior). &lt;br /&gt;
* &amp;lt;code&amp;gt;[1..*]&amp;lt;/code&amp;gt; defines a list of properties that must not be empty. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..*]&amp;lt;/code&amp;gt; or simply &amp;lt;code&amp;gt;[*]&amp;lt;/code&amp;gt; defines a list of properties that may be empty.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-19.png|center|frame|''Figure 19: Variables can be defined using the &amp;lt;code&amp;gt;var&amp;lt;/code&amp;gt; keyword.'']]&lt;br /&gt;
&lt;br /&gt;
The appropriate persistence settings are generated automatically. If a multiplicity is specified, the appropriate annotations (and, if necessary, a list rather than a single variable) are generated.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===derived===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;derived&amp;lt;/code&amp;gt; defines a property that is derived from other properties. The derived property must be have a type, a name and the calculation logic that derives it from the other properties, written as an Xexpression in braces.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-20.png|center|frame|''Figure 20: Properties may be derived from other properties using an Xexpression.'']]&lt;br /&gt;
&lt;br /&gt;
The code is automatically translated to valid Java code.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dirty===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; defines a property used as a flag to track the &amp;quot;dirty&amp;quot; state of the buffered data when editing values, before the changes have been written back to the persistence entity. Only one &amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; flag is allowed per entity. The datatype has to be boolean.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-21.png|center|frame|''Figure 21: The &amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; property is used to flag whether changes have been made to the bufered data, but not yet written back to the persistence entity. '']]&lt;br /&gt;
&lt;br /&gt;
The boolean field for this property and the appropriate annotation are generated with the &amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; keyword.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===domainDescription===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;domainDescription&amp;lt;/code&amp;gt; defines a property that is used as a domain description. The appropriate annotation is added to the property. A domain description must be of type &amp;lt;code&amp;gt;String&amp;lt;/code&amp;gt;. Domain descriptions may be derived from other properties.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-22.png|center|frame|''Figure 22: Domain description properties can be created with the &amp;lt;code&amp;gt;domainDescription&amp;lt;/code&amp;gt; keyword.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===domainKey===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;domainKey&amp;lt;/code&amp;gt; defines a domain key. The appropriate annotation is added to the property. Primitive datatypes may be used as domain keys.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-23.png|center|frame|''Figure 23: A field containing a domain key is created with the &amp;lt;code&amp;gt;domainKey keyword&amp;lt;/code&amp;gt;.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===id===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
{{Deprecated}}&lt;br /&gt;
&lt;br /&gt;
'''id''' defines an ID property (used as a primary key by the JPA compiler). '''This keyword is deprecated - use uuid instead'''. If no &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; is specified, a warning is given. &lt;br /&gt;
&lt;br /&gt;
'''Caution''': ID autogeneration causes problems, since the value is not set before the entity is persisted, e.g., in the database. It is therefore advised to use the &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; keyword instead.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-24.png|center|frame|''Figure 24: Entities are supposed to have an ID property that is used as a primary key to the underlying database.'']]&lt;br /&gt;
&lt;br /&gt;
'''Caution''': The generated IDs are not necessarily unique if the deprecated &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; keyword is used!&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===index===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt; keyword causes an index for the table to be generated. Indexes may be based on one or more properties (primitive only) and references (one-to-one only) of the entity. An index must be given a name and, in braces, a list of the fields it is based upon. If the &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt; keyword is prefixed with &amp;lt;code&amp;gt;unique&amp;lt;/code&amp;gt;, a unique index is created.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-25.png|center|frame|''Figure 25: Database table indexes that map entities are generated with the &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt; keyword.'']]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;@Table&amp;lt;/code&amp;gt; annotation is supplemented with the index definition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===properties===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Features (properties and references) of entities and beans can optionally be given additional information in the form of key-value pairs. This information can then be retrieved from the semantic model. The key-value pairs are defined in parentheses after the properties keyword following the feature name. Multiple pairs can be defined (comma-separated).&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-26.png|center|frame|''Figure 26: Additional information about features can be defined by key-value pairs. This information is then stored in the semantic model and is retrievable.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===uuid===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; allows the use of Universally Unique IDs as primary keys. A new UUID value is generated for each object as soon as that object has been created, independently of database operations. This circumvents the problems with the &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; keyword. UUIDs have to be of type &amp;lt;code&amp;gt;String&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-27.png|center|frame|''Figure 27: By using the &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; keyword, entities are created with a reliably unique identifier.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===version===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; defines a version-property (used by the JPA-Compiler).&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-28.png|center|frame|''Figure 28: A &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; property can be added to entities and beans.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===transient===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;transient&amp;lt;/code&amp;gt; marks the property as transient. Instead of a &amp;lt;code&amp;gt;@Column&amp;lt;/code&amp;gt;, a &amp;lt;code&amp;gt;@Transient&amp;lt;/code&amp;gt; annotation is generated, so that the property is not persisted in the database.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-29.png|center|frame|''Figure 29: The &amp;lt;code&amp;gt;transient&amp;lt;/code&amp;gt; keyword enables the exclusion of properties from persistence.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
The Entity DSL tracks relationships between entities by using the concept of &amp;quot;references&amp;quot;. References can exist between objects of the same nature (entities to entities, beans to beans). Where appropriate, back references (&amp;quot;opposite&amp;quot;) are added.&lt;br /&gt;
References are defined by the &amp;lt;code&amp;gt;ref&amp;lt;/code&amp;gt; keyword, a target, an optional type and a name. The exact type of the reference can be specified with the following modifiers:&lt;br /&gt;
&lt;br /&gt;
===Multiplicity and nullability===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The Entity DSL supports the specification of multiplicities in square brackets appended to the type: &lt;br /&gt;
* &amp;lt;code&amp;gt;[1]&amp;lt;/code&amp;gt; defines a non-nullable, one-to-one relationship. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..1]&amp;lt;/code&amp;gt; defines a nullable, one-to-one relationship (this is the default behavior). &lt;br /&gt;
* &amp;lt;code&amp;gt;[1..*]&amp;lt;/code&amp;gt; defines a non-nullable, one-to-many relationship. An &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; reference is needed. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..*]&amp;lt;/code&amp;gt; or simply &amp;lt;code&amp;gt;[*]&amp;lt;/code&amp;gt; defines a nullable, one-to-many relationship. An &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; reference is needed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-30.png|center|frame|''Figure 30: Adding multiplicity &amp;quot;[1]&amp;quot; causes the annotations for non-nullable database entries to be set.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===opposite reference===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Lifecycle references need the specification of an opposite reference. This can be done with the &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; keyword.&lt;br /&gt;
&lt;br /&gt;
Using the &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; reference, it is possible to navigate back to the original object after following the reference. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===cascade===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; specifier controls the behavior of the database on delete operations. If an object with a &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; reference to other objects is deleted, those other objects will be removed as well.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-31.png|center|frame|''Figure 31: By using the &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; keywords, bidirectional associations can be achieved.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Operations==&lt;br /&gt;
&lt;br /&gt;
Operations are other important features. They are based on Xbase and offer a huge set of semantic features, extending the featureset of Java. Xbase additionally offers features such as closures.&lt;br /&gt;
Operations can be declared by the &amp;lt;code&amp;gt;def&amp;lt;/code&amp;gt; keyword followed by braces containing the inline operation.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-32.png|center|frame|''Figure 32: The &amp;lt;code&amp;gt;def&amp;lt;/code&amp;gt; keyword allows the inlining of custom methods in the Entity DSL code.'']]&lt;br /&gt;
&lt;br /&gt;
These methods are translated into the appropriate Java methods along with the automatically generated getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
==Annotations==&lt;br /&gt;
&lt;br /&gt;
Annotations can be added to all elements except import declarations. Specifying annotations in the Entity DSL works in a straightforward manner; content assist is available. The added annotations are taken over into the generated Java code.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-33.png|center|frame|''Figure 33: Annotating elements in the Compex Entity DSL causes an annotation to be inserted into the generated Java code.'']]&lt;br /&gt;
&lt;br /&gt;
These methods are translated into the appropriate Java methods along with the automatically generated getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
&lt;br /&gt;
Comments can be added anywhere in an .entitymodel text file and are copied over into the generated Java code. Comments are enclosed in &amp;lt;code&amp;gt;/* ... */&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-34.png|center|frame|''Figure 34: The comments added in the Entity DSL are transformed to Java-style comments in the generated code.'']]&lt;br /&gt;
&lt;br /&gt;
Comments before the &amp;lt;code&amp;gt;package&amp;lt;/code&amp;gt; keyword are copied over to all generated Java classes – this is the place for copyright notices.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-35.png|center|frame|''Figure 35: A comment before the package keyword ends up in all generated Java classes.'']]&lt;br /&gt;
&lt;br /&gt;
==Reserved Keywords==&lt;br /&gt;
&lt;br /&gt;
The keywords of the Entity DSL are syntactic features and can therefore not be used as semantic identifiers. &lt;br /&gt;
&lt;br /&gt;
In order to circumvent this, it is possible to escape them with the &amp;lt;code&amp;gt;^&amp;lt;/code&amp;gt; character. During the generation of the Java code, this escape character is removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-36.png|center|frame|''Figure 36: Using the escape character '^', it is possible to achieve an identifier in the generated Java code with a name that would be a reserved word in the Entity DSL. In this case, a variable named &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; is generated that cannot be specified in the entity model file.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note that you are also '''not allowed to use identifiers corresponding to reserved keywords''' of the supported databases you can find here below: &lt;br /&gt;
&lt;br /&gt;
[https://db.apache.org/derby/docs/10.2/ref/rrefkeywords29722.html Derby]&lt;br /&gt;
&lt;br /&gt;
[http://www.h2database.com/html/advanced.html?highlight=reserved&amp;amp;search=reser#firstFound H2]&lt;br /&gt;
&lt;br /&gt;
[https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/reserved-keywords?view=sql-server-2017 MS SQL]&lt;br /&gt;
&lt;br /&gt;
[https://docs.oracle.com/database/121/SQLRF/ap_keywd001.htm#SQLRF55621 Oracle]&lt;br /&gt;
&lt;br /&gt;
[​https://dev.mysql.com/doc/refman/8.0/en/keywords.html MySQL]&lt;br /&gt;
&lt;br /&gt;
[​https://www.postgresql.org/docs/8.2/sql-keywords-appendix.html PostgreSQL]&lt;br /&gt;
&lt;br /&gt;
== Copyright Notice ==&lt;br /&gt;
{{Copyright Notice}}&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=Entity_DSL&amp;diff=3718</id>
		<title>Entity DSL</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=Entity_DSL&amp;diff=3718"/>
				<updated>2019-02-06T10:44:25Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: /* Reserved Keywords */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
The Entity DSL facilitates the handling of persistence entities. Defining entities using the Entity DSL efficiently creates a clean entity model that contains all relevant semantic elements of the model text file. &lt;br /&gt;
This semantic model is used to automatically transform the semantic information into proper Java code with the respective annotations for a persistence provider. Additionally, if the entity model is located within a project with OSBP nature, &amp;quot;Auto-DTOs&amp;quot; and services are generated as well. In this case, attributes that are added to entities will automatically be transferred to the &amp;quot;Auto-DTOs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The main semantic elements of the Compex Entity DSL are the following:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Package&amp;quot; - the root element that contains all the other elements. A model can contain multiple packages. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Import&amp;quot; declarations - used to import external models or even Java classes. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Datatype&amp;quot; declarations - a way to define datatypes that can be used in entities and beans. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Entity&amp;quot; - the abstraction of a business model entity. It contains further elements such as properties and references. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Bean&amp;quot; - does not compile to a JPA Entity but to a Java Bean (POJO with getter and setter and PropertyChange-Support). Beans may be used as temporary containers in entity operations or can be embedded into JPA Entities. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Enum&amp;quot; - the abstraction for Java enums. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Property&amp;quot; - a reference to an embedded Bean, an Enum, a Java class or a simple datatype (as defined in the datatype declaration). Offers multiplicity. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Reference&amp;quot; - a reference to another Entity (or to another Bean in the case of a Bean). Offers multiplicity. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Operations&amp;quot; - similar to Java methods. The Xbase expression language can be used to write high-level code. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Annotations&amp;quot; can be placed on Entity, Property and Reference. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Comments&amp;quot; can be added to all elements.&lt;br /&gt;
&lt;br /&gt;
== Entity model files ==&lt;br /&gt;
&lt;br /&gt;
Entity models are described in .entitymodel files. These files describe the entity model and are the basis for the code generation. Entity models may be split over several .entitymodel files containing packages in the same namespace.&lt;br /&gt;
An .entitymodel file may contain several packages with entities. However, from a performance point of view, a complex entity model may work better with more and smaller .entitymodel files than the same model crammed into a few large files (or even a single file).&lt;br /&gt;
&lt;br /&gt;
===package===&lt;br /&gt;
Entity model files must start with a package declaration. Packages are the root element of the Entity DSL grammar. Everything is contained in a package: Imports, Entities, Beans and Enums have to be defined inside the Package definition. One document can contain multiple packages with unique names. &lt;br /&gt;
The elements a package can contain are Entities, Beans and Enums. Additionally, a package allows Import statements and the declaration of datatypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  package name {&lt;br /&gt;
     import importStatement;&lt;br /&gt;
     datatype datatypeDefinition;&lt;br /&gt;
     entities/beans/enums&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:entity-1.png|center|frame|''Figure 1 - Entity model file - a package is the topmost element and contains other items.'']]&lt;br /&gt;
&lt;br /&gt;
Marking a DTO as abstract (before the dto keyword) generates an abstract Java class for it.&lt;br /&gt;
&lt;br /&gt;
The following modifiers may be placed after the dto keyword and the DTO name:&lt;br /&gt;
&lt;br /&gt;
=== import ===&lt;br /&gt;
The Entity DSL allows the referencing of entities defined in different packages, even in different .entitymodel files. The import statement is a way to make these elements available in the current namespace without having to address them by their fully qualified name. &lt;br /&gt;
&lt;br /&gt;
Import statements allow the use of the '*' wildcard.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
	import importStatement;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:entity-2.png|center|frame|''Figure 2: Items contained in another package can be addressed if the package is imported using the import keyword and its fully qualified name.'']]&lt;br /&gt;
&lt;br /&gt;
=== datatype ===&lt;br /&gt;
The Entity DSL allows the definition of datatypes. These are translated by the inferrer into their standard Java representation. The behavior of the generator can be controlled by the datatype definitions.&lt;br /&gt;
Datatypes defined in an .entitymodel file are local to that file. In order to define datatypes in one place and have them available in multiple .entitymodel files, the datatypes may be defined in a &amp;quot;.datatypes&amp;quot; file containing only datatype definitions inside a package statement.&lt;br /&gt;
There are three types of datatype definitions:&lt;br /&gt;
&lt;br /&gt;
* '''jvmTypes''': Datatype definitons that map types to '''jvmTypes''' take the basic syntax of&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;datatype &amp;lt;name&amp;gt; jvmType &amp;lt;type&amp;gt; as primitive;&amp;lt;/code&amp;gt;.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Specifying datatypes in this manner uses an appropriate wrapper class in the generated Java code; adding the keywords &amp;lt;code&amp;gt;as primitive&amp;lt;/code&amp;gt; enforces the use of primitive datatypes where applicable:&lt;br /&gt;
&amp;lt;code&amp;gt;datatype foo jvmType Integer;&amp;lt;/code&amp;gt; compiles to an &amp;lt;code&amp;gt;Integer&amp;lt;/code&amp;gt; whereas &amp;lt;code&amp;gt;datatype foo jvmType Integer as primitive;&amp;lt;/code&amp;gt; results in &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:entity-3.png|center|frame|''Figure 3: The defined datatype is translated to a wrapper class.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-4.png|center|frame|''Figure 4: By adding the &amp;lt;code&amp;gt;as primitive&amp;lt;/code&amp;gt; keywords, the datatype is translated to a primitive datatype.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* '''dateTypes''': The datatypes for handling temporal information can be defined by the following statement: &lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;datatype &amp;lt;name&amp;gt; datetype date—time—timestamp; &amp;lt;/code&amp;gt;&lt;br /&gt;
Datatypes that have been defined in this manner can be used as property variables in entities and beans.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-5.png|center|frame|''Figure 5: Defining datatypes for handling temporal information. Content assist is available.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* '''blobs''': Binary blobs can be handled by defining a datatype with the &amp;lt;code&amp;gt;as blob&amp;lt;/code&amp;gt; keywords. The Java implementation of such a blob is a byte array. Appropriate persistence annotations are automatically added.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;datatype &amp;lt;name&amp;gt; as blob;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-6.png|center|frame|''Figure 6: Including binary blobs by using a datatype with the &amp;lt;code&amp;gt;as blob&amp;lt;/code&amp;gt; keywords.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;After import statements and datatype definitions, the content of the .entitymodel file is made up of &amp;lt;code&amp;gt;entity&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;bean&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;enum&amp;lt;/code&amp;gt; definitions.&lt;br /&gt;
&lt;br /&gt;
== Entities ==&lt;br /&gt;
Entities are the most complex elements in the Entity DSL. An entity is an abstraction above a business object. Entities are defined by their name, properties, references and operations. Generally, an entity is an object which can keep the state of variables and references as well as be persisted. &lt;br /&gt;
For each entity that is defined in a package, a Java class and the corresponding persistence structure is automatically generated. Inside a project with Compex nature, &amp;quot;Auto-DTOs&amp;quot; and services are created as well.&lt;br /&gt;
&lt;br /&gt;
Entities may extend other entities. In this case, they are derived from their parent entity. That means that the properties and references of the parent entity are inherited.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 [modifiers] entity &amp;lt;name&amp;gt; extends &amp;lt;parentEntity&amp;gt; {&lt;br /&gt;
     [entityProperties]&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-7.png|center|frame|''Figure 7: Items contained in another package can be addressed if the package is imported using the &amp;lt;code&amp;gt;import&amp;lt;/code&amp;gt; keyword and its fully qualified name'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Entities may be defined with certain modifiers that change the generated Java Code. The following modifiers are supported:&lt;br /&gt;
&lt;br /&gt;
=== abstract ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;abstract&amp;lt;/code&amp;gt; marks the entity as &amp;quot;abstract&amp;quot;. This generates an abstract Java class.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-8.png|center|frame|''Figure 8: The &amp;lt;code&amp;gt;abstract&amp;lt;/code&amp;gt; keyword causes the translation into an abstract Java class'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== historized ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;historized&amp;lt;/code&amp;gt; marks the entity as &amp;quot;historized&amp;quot;. Historized entities can have several entries in a database, but only one of them may be marked as current.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;historized&amp;lt;/code&amp;gt; keyword adds an object ID, a version field and a flag for the current version to the entity.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-9.png|center|frame|''Figure 9: The &amp;lt;code&amp;gt;historized&amp;lt;/code&amp;gt; modifier triggers the creation of an object ID, an object version and a flag for marking the current version.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== cacheable ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;cacheable&amp;lt;/code&amp;gt; marks the entity as &amp;quot;cacheable&amp;quot;. The appropriate annotation for the persistence provider is added to the generated Java code.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-10.png|center|frame|''Figure 10: Declaring an entity to be &amp;lt;code&amp;gt;cacheable&amp;lt;/code&amp;gt; adds the &amp;lt;code&amp;gt;@Cacheable&amp;lt;/code&amp;gt; annotation'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== timedependent ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;timedependent&amp;lt;/code&amp;gt; marks the entity as &amp;quot;time-dependent&amp;quot;. An object may have several entries in the database. Which entry is valid will be determined by '''valid from''' and '''valid until''' fields that are added to the entity.&lt;br /&gt;
An object ID is created in order to tie the entries together. The &amp;lt;code&amp;gt;timedependent&amp;lt;/code&amp;gt; keyword recognizes the modifiers &amp;lt;code&amp;gt;(DATE)&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;(TIMESTAMP)&amp;lt;/code&amp;gt;. Default is &amp;lt;code&amp;gt;timedependent(DATE)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-11.png|center|frame|''Figure 11: The &amp;lt;code&amp;gt;timedependent&amp;lt;/code&amp;gt; keyword causes an object ID, a validFrom and a validUntil field to be created in order to support multiple database entries for an object.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== mapped superclass ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;mapped superclass&amp;lt;/code&amp;gt; marks a class that provides persistent entity state and mapping information for its subclasses, but which is not an entity itself.&lt;br /&gt;
&lt;br /&gt;
Typically, the purpose of a mapped superclass is to define state and mapping information that is common to multiple entities. All the mappings from the mapped superclass are inherited by its subclasses, as if they had been defined there directly.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-12.png|center|frame|''Figure 12: The &amp;lt;code&amp;gt;mapped superclass&amp;lt;/code&amp;gt; keyword sets the appropriate annotation which causes the persistence provider to move the mappings to the derived subclasses.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===extends===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The modifier &amp;lt;code&amp;gt;extends&amp;lt;/code&amp;gt; may be placed after the entity keyword and the entity name, as &amp;lt;code&amp;gt;entity foo extends bar {&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; has already been defined as an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;extends&amp;lt;/code&amp;gt; marks an entity that is derived from another entity. That means that the properties and references of the parent entity are inherited.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Entity Persistence Settings==&lt;br /&gt;
&lt;br /&gt;
Apart from the mapped superclass modifier that moves all property columns to the tables belonging to derived classes, the following settings for table inheritance can be specified within an entity definition:&lt;br /&gt;
* inheritance per class&lt;br /&gt;
* inheritance per subclass&lt;br /&gt;
&lt;br /&gt;
The structure of the database created from an entity model can be controlled by the following settings:&lt;br /&gt;
* schemaName&lt;br /&gt;
* tableName&lt;br /&gt;
* discriminatorColumn&lt;br /&gt;
* discriminatorType&lt;br /&gt;
* discriminatorValue&lt;br /&gt;
&lt;br /&gt;
===inheritance per class===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;inheritance per class{}&amp;lt;/code&amp;gt; causes a table to be created for each class; subclasses share this table using a discriminator value. This statement has to be followed by braces, inside of which further details can be specified.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-13.png|center|frame|''Figure 13: A single table for entity Base is created; the generated Java code for the “Derived” class shows that the “Derived” entity is added to this table by using a discriminator.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===inheritance per subclass===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;inheritance per subclass{}&amp;lt;/code&amp;gt; causes a table to be created for each subclass. This statement has to be followed by braces, inside of which further details can be specified. This is the default behaviour if no inheritance strategy is specified.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-14.png|center|frame|''Figure 14: An &amp;lt;code&amp;gt;@Table&amp;lt;/code&amp;gt; annotation is added to the generated Java code, so that the &amp;quot;Derived&amp;quot; entity is mapped to a table of its own.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===schemaName===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;schemaName&amp;lt;/code&amp;gt; allows the specification of a name for the database schema to be used. This setting is translated to the appropriate JPA annotation &amp;lt;code&amp;gt;@Table(schema = &amp;lt;xyz&amp;gt;)&amp;lt;/code&amp;gt;. The schema name given is converted to snake case using capitals.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===tableName===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;tableName&amp;lt;/code&amp;gt; allows the specification of a name for the table (within the database schema) to which the entity is mapped. This setting is translated to the appropriate JPA annotation &lt;br /&gt;
&amp;lt;code&amp;gt;@Table(name = &amp;lt;xyz&amp;gt;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The table name specified is converted to snake case using capitals. The default value is the name of the entity.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-15.png|center|frame|''Figure 15: Specifying the &amp;lt;code&amp;gt;schemaName&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;tableName&amp;lt;/code&amp;gt; settings in an entity determines the name of the database schema and tables used for persistence.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===discriminatorColumn===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;discriminatorColumn&amp;lt;/code&amp;gt; optionally allows the specification of a name for the discriminator column in the case of &amp;lt;code&amp;gt;inheritance per class&amp;lt;/code&amp;gt;. It appears within the braces after the inheritance-strategy statement and must be followed by a semicolon. It defaults to &amp;lt;code&amp;gt;DISC&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===discriminatorType===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;discriminatorType&amp;lt;/code&amp;gt; optionally allows the definition of the datatype of the discriminator within the single table. It can be set to &amp;lt;code&amp;gt;CHAR&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;INT&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;STRING&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;INHERIT&amp;lt;/code&amp;gt;. It appears within the braces after the &amp;lt;code&amp;gt;inheritance&amp;lt;/code&amp;gt; statement and must be followed by a semicolon. It defaults to &amp;lt;code&amp;gt;STRING;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===discriminatorValue===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;discriminatorValue&amp;lt;/code&amp;gt; allows a custom value to be used for the discriminator within the single table. It appears within the braces after the &amp;lt;code&amp;gt;inheritance&amp;lt;/code&amp;gt; statement and must be followed by a semicolon. It defaults to the entity name converted to snake case.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-16.png|center|frame|''Figure 16: The &amp;lt;code&amp;gt;inheritance&amp;lt;/code&amp;gt; statement allows the optional specification of discriminator column, type and value to be used in the case of a single table.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Beans==&lt;br /&gt;
&lt;br /&gt;
'''Beans''' are objects that are embedded in other entities, inheriting their persistence and lifecycle. Similar to entities, beans are characterised by their name, their properties and their references. For each bean that is defined in a package, a Java class is automatically generated.&lt;br /&gt;
&lt;br /&gt;
Beans can be embedded into entities by defining them as properties of the respective entity. The appropriate annotations (&amp;lt;code&amp;gt;@Embeddable&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@Embedded&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@AttributeOverrides&amp;lt;/code&amp;gt; etc.) are added in order to have beans persisted with their parent entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-17.png|center|frame|''Figure 17: Beans can be embedded in entities and are persisted with them.'']]&lt;br /&gt;
&lt;br /&gt;
==Enums==&lt;br /&gt;
&lt;br /&gt;
'''Enums''' are an abstraction of the Java &amp;lt;code&amp;gt;enum&amp;lt;/code&amp;gt;. They compile to &amp;lt;code&amp;gt;enum&amp;lt;/code&amp;gt; classes and can be used as properties in entities and beans.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-18.png|center|frame|''Figure 18: Defining &amp;lt;code&amp;gt;enums&amp;lt;/code&amp;gt; allows using them as variables in entities and beans.'']]&lt;br /&gt;
&lt;br /&gt;
==Properties==&lt;br /&gt;
Properties of entities and beans are references to datatypes or enums. They can be regarded as variables and are defined by a keyword followed by a datatype (Java type or datatype defined in the &amp;lt;code&amp;gt;datatype&amp;lt;/code&amp;gt; section) and a name. By defining a bean as a property of an entity, it is embedded in it.&lt;br /&gt;
&lt;br /&gt;
Properties can be determined with the following keywords:&lt;br /&gt;
&lt;br /&gt;
===var===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The basic property &amp;lt;code&amp;gt;var&amp;lt;/code&amp;gt; defines a variable that is persisted in a table column. A property must have a type and a name. &lt;br /&gt;
&lt;br /&gt;
'''Multiplicity''' of properties can be controlled by the following (optional) settings: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;[1]&amp;lt;/code&amp;gt; defines a non-nullable property. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..1]&amp;lt;/code&amp;gt; defines a nullable property (this is the default behavior). &lt;br /&gt;
* &amp;lt;code&amp;gt;[1..*]&amp;lt;/code&amp;gt; defines a list of properties that must not be empty. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..*]&amp;lt;/code&amp;gt; or simply &amp;lt;code&amp;gt;[*]&amp;lt;/code&amp;gt; defines a list of properties that may be empty.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-19.png|center|frame|''Figure 19: Variables can be defined using the &amp;lt;code&amp;gt;var&amp;lt;/code&amp;gt; keyword.'']]&lt;br /&gt;
&lt;br /&gt;
The appropriate persistence settings are generated automatically. If a multiplicity is specified, the appropriate annotations (and, if necessary, a list rather than a single variable) are generated.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===derived===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;derived&amp;lt;/code&amp;gt; defines a property that is derived from other properties. The derived property must be have a type, a name and the calculation logic that derives it from the other properties, written as an Xexpression in braces.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-20.png|center|frame|''Figure 20: Properties may be derived from other properties using an Xexpression.'']]&lt;br /&gt;
&lt;br /&gt;
The code is automatically translated to valid Java code.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dirty===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; defines a property used as a flag to track the &amp;quot;dirty&amp;quot; state of the buffered data when editing values, before the changes have been written back to the persistence entity. Only one &amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; flag is allowed per entity. The datatype has to be boolean.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-21.png|center|frame|''Figure 21: The &amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; property is used to flag whether changes have been made to the bufered data, but not yet written back to the persistence entity. '']]&lt;br /&gt;
&lt;br /&gt;
The boolean field for this property and the appropriate annotation are generated with the &amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; keyword.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===domainDescription===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;domainDescription&amp;lt;/code&amp;gt; defines a property that is used as a domain description. The appropriate annotation is added to the property. A domain description must be of type &amp;lt;code&amp;gt;String&amp;lt;/code&amp;gt;. Domain descriptions may be derived from other properties.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-22.png|center|frame|''Figure 22: Domain description properties can be created with the &amp;lt;code&amp;gt;domainDescription&amp;lt;/code&amp;gt; keyword.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===domainKey===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;domainKey&amp;lt;/code&amp;gt; defines a domain key. The appropriate annotation is added to the property. Primitive datatypes may be used as domain keys.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-23.png|center|frame|''Figure 23: A field containing a domain key is created with the &amp;lt;code&amp;gt;domainKey keyword&amp;lt;/code&amp;gt;.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===id===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
{{Deprecated}}&lt;br /&gt;
&lt;br /&gt;
'''id''' defines an ID property (used as a primary key by the JPA compiler). '''This keyword is deprecated - use uuid instead'''. If no &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; is specified, a warning is given. &lt;br /&gt;
&lt;br /&gt;
'''Caution''': ID autogeneration causes problems, since the value is not set before the entity is persisted, e.g., in the database. It is therefore advised to use the &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; keyword instead.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-24.png|center|frame|''Figure 24: Entities are supposed to have an ID property that is used as a primary key to the underlying database.'']]&lt;br /&gt;
&lt;br /&gt;
'''Caution''': The generated IDs are not necessarily unique if the deprecated &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; keyword is used!&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===index===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt; keyword causes an index for the table to be generated. Indexes may be based on one or more properties (primitive only) and references (one-to-one only) of the entity. An index must be given a name and, in braces, a list of the fields it is based upon. If the &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt; keyword is prefixed with &amp;lt;code&amp;gt;unique&amp;lt;/code&amp;gt;, a unique index is created.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-25.png|center|frame|''Figure 25: Database table indexes that map entities are generated with the &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt; keyword.'']]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;@Table&amp;lt;/code&amp;gt; annotation is supplemented with the index definition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===properties===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Features (properties and references) of entities and beans can optionally be given additional information in the form of key-value pairs. This information can then be retrieved from the semantic model. The key-value pairs are defined in parentheses after the properties keyword following the feature name. Multiple pairs can be defined (comma-separated).&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-26.png|center|frame|''Figure 26: Additional information about features can be defined by key-value pairs. This information is then stored in the semantic model and is retrievable.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===uuid===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; allows the use of Universally Unique IDs as primary keys. A new UUID value is generated for each object as soon as that object has been created, independently of database operations. This circumvents the problems with the &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; keyword. UUIDs have to be of type &amp;lt;code&amp;gt;String&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-27.png|center|frame|''Figure 27: By using the &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; keyword, entities are created with a reliably unique identifier.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===version===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; defines a version-property (used by the JPA-Compiler).&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-28.png|center|frame|''Figure 28: A &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; property can be added to entities and beans.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===transient===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;transient&amp;lt;/code&amp;gt; marks the property as transient. Instead of a &amp;lt;code&amp;gt;@Column&amp;lt;/code&amp;gt;, a &amp;lt;code&amp;gt;@Transient&amp;lt;/code&amp;gt; annotation is generated, so that the property is not persisted in the database.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-29.png|center|frame|''Figure 29: The &amp;lt;code&amp;gt;transient&amp;lt;/code&amp;gt; keyword enables the exclusion of properties from persistence.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
The Entity DSL tracks relationships between entities by using the concept of &amp;quot;references&amp;quot;. References can exist between objects of the same nature (entities to entities, beans to beans). Where appropriate, back references (&amp;quot;opposite&amp;quot;) are added.&lt;br /&gt;
References are defined by the &amp;lt;code&amp;gt;ref&amp;lt;/code&amp;gt; keyword, a target, an optional type and a name. The exact type of the reference can be specified with the following modifiers:&lt;br /&gt;
&lt;br /&gt;
===Multiplicity and nullability===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The Entity DSL supports the specification of multiplicities in square brackets appended to the type: &lt;br /&gt;
* &amp;lt;code&amp;gt;[1]&amp;lt;/code&amp;gt; defines a non-nullable, one-to-one relationship. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..1]&amp;lt;/code&amp;gt; defines a nullable, one-to-one relationship (this is the default behavior). &lt;br /&gt;
* &amp;lt;code&amp;gt;[1..*]&amp;lt;/code&amp;gt; defines a non-nullable, one-to-many relationship. An &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; reference is needed. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..*]&amp;lt;/code&amp;gt; or simply &amp;lt;code&amp;gt;[*]&amp;lt;/code&amp;gt; defines a nullable, one-to-many relationship. An &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; reference is needed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-30.png|center|frame|''Figure 30: Adding multiplicity &amp;quot;[1]&amp;quot; causes the annotations for non-nullable database entries to be set.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===opposite reference===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Lifecycle references need the specification of an opposite reference. This can be done with the &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; keyword.&lt;br /&gt;
&lt;br /&gt;
Using the &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; reference, it is possible to navigate back to the original object after following the reference. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===cascade===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; specifier controls the behavior of the database on delete operations. If an object with a &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; reference to other objects is deleted, those other objects will be removed as well.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-31.png|center|frame|''Figure 31: By using the &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; keywords, bidirectional associations can be achieved.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Operations==&lt;br /&gt;
&lt;br /&gt;
Operations are other important features. They are based on Xbase and offer a huge set of semantic features, extending the featureset of Java. Xbase additionally offers features such as closures.&lt;br /&gt;
Operations can be declared by the &amp;lt;code&amp;gt;def&amp;lt;/code&amp;gt; keyword followed by braces containing the inline operation.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-32.png|center|frame|''Figure 32: The &amp;lt;code&amp;gt;def&amp;lt;/code&amp;gt; keyword allows the inlining of custom methods in the Entity DSL code.'']]&lt;br /&gt;
&lt;br /&gt;
These methods are translated into the appropriate Java methods along with the automatically generated getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
==Annotations==&lt;br /&gt;
&lt;br /&gt;
Annotations can be added to all elements except import declarations. Specifying annotations in the Entity DSL works in a straightforward manner; content assist is available. The added annotations are taken over into the generated Java code.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-33.png|center|frame|''Figure 33: Annotating elements in the Compex Entity DSL causes an annotation to be inserted into the generated Java code.'']]&lt;br /&gt;
&lt;br /&gt;
These methods are translated into the appropriate Java methods along with the automatically generated getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
&lt;br /&gt;
Comments can be added anywhere in an .entitymodel text file and are copied over into the generated Java code. Comments are enclosed in &amp;lt;code&amp;gt;/* ... */&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-34.png|center|frame|''Figure 34: The comments added in the Entity DSL are transformed to Java-style comments in the generated code.'']]&lt;br /&gt;
&lt;br /&gt;
Comments before the &amp;lt;code&amp;gt;package&amp;lt;/code&amp;gt; keyword are copied over to all generated Java classes – this is the place for copyright notices.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-35.png|center|frame|''Figure 35: A comment before the package keyword ends up in all generated Java classes.'']]&lt;br /&gt;
&lt;br /&gt;
==Reserved Keywords==&lt;br /&gt;
&lt;br /&gt;
The keywords of the Entity DSL are syntactic features and can therefore not be used as semantic identifiers. &lt;br /&gt;
&lt;br /&gt;
In order to circumvent this, it is possible to escape them with the &amp;lt;code&amp;gt;^&amp;lt;/code&amp;gt; character. During the generation of the Java code, this escape character is removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-36.png|center|frame|''Figure 36: Using the escape character '^', it is possible to achieve an identifier in the generated Java code with a name that would be a reserved word in the Entity DSL. In this case, a variable named &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; is generated that cannot be specified in the entity model file.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note that you are also '''not allowed to use identifiers corresponding to reserved keywords''' of the supported databases you can find here below: &lt;br /&gt;
&lt;br /&gt;
[https://db.apache.org/derby/docs/10.2/ref/rrefkeywords29722.html Derby]&lt;br /&gt;
&lt;br /&gt;
[http://www.h2database.com/html/advanced.html?highlight=reserved&amp;amp;search=reser#firstFound H2] &lt;br /&gt;
&lt;br /&gt;
[https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/reserved-keywords?view=sql-server-2017 MS SQL] &lt;br /&gt;
&lt;br /&gt;
[​https://dev.mysql.com/doc/refman/8.0/en/keywords.html MySQL] &lt;br /&gt;
&lt;br /&gt;
[https://docs.oracle.com/database/121/SQLRF/ap_keywd001.htm#SQLRF55621 Oracle] &lt;br /&gt;
&lt;br /&gt;
[​https://www.postgresql.org/docs/8.2/sql-keywords-appendix.html PostgreSQL]&lt;br /&gt;
&lt;br /&gt;
== Copyright Notice ==&lt;br /&gt;
{{Copyright Notice}}&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=Entity_DSL&amp;diff=3717</id>
		<title>Entity DSL</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=Entity_DSL&amp;diff=3717"/>
				<updated>2019-02-06T10:42:55Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: /* Reserved Keywords */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
The Entity DSL facilitates the handling of persistence entities. Defining entities using the Entity DSL efficiently creates a clean entity model that contains all relevant semantic elements of the model text file. &lt;br /&gt;
This semantic model is used to automatically transform the semantic information into proper Java code with the respective annotations for a persistence provider. Additionally, if the entity model is located within a project with OSBP nature, &amp;quot;Auto-DTOs&amp;quot; and services are generated as well. In this case, attributes that are added to entities will automatically be transferred to the &amp;quot;Auto-DTOs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The main semantic elements of the Compex Entity DSL are the following:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Package&amp;quot; - the root element that contains all the other elements. A model can contain multiple packages. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Import&amp;quot; declarations - used to import external models or even Java classes. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Datatype&amp;quot; declarations - a way to define datatypes that can be used in entities and beans. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Entity&amp;quot; - the abstraction of a business model entity. It contains further elements such as properties and references. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Bean&amp;quot; - does not compile to a JPA Entity but to a Java Bean (POJO with getter and setter and PropertyChange-Support). Beans may be used as temporary containers in entity operations or can be embedded into JPA Entities. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Enum&amp;quot; - the abstraction for Java enums. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Property&amp;quot; - a reference to an embedded Bean, an Enum, a Java class or a simple datatype (as defined in the datatype declaration). Offers multiplicity. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Reference&amp;quot; - a reference to another Entity (or to another Bean in the case of a Bean). Offers multiplicity. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Operations&amp;quot; - similar to Java methods. The Xbase expression language can be used to write high-level code. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Annotations&amp;quot; can be placed on Entity, Property and Reference. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Comments&amp;quot; can be added to all elements.&lt;br /&gt;
&lt;br /&gt;
== Entity model files ==&lt;br /&gt;
&lt;br /&gt;
Entity models are described in .entitymodel files. These files describe the entity model and are the basis for the code generation. Entity models may be split over several .entitymodel files containing packages in the same namespace.&lt;br /&gt;
An .entitymodel file may contain several packages with entities. However, from a performance point of view, a complex entity model may work better with more and smaller .entitymodel files than the same model crammed into a few large files (or even a single file).&lt;br /&gt;
&lt;br /&gt;
===package===&lt;br /&gt;
Entity model files must start with a package declaration. Packages are the root element of the Entity DSL grammar. Everything is contained in a package: Imports, Entities, Beans and Enums have to be defined inside the Package definition. One document can contain multiple packages with unique names. &lt;br /&gt;
The elements a package can contain are Entities, Beans and Enums. Additionally, a package allows Import statements and the declaration of datatypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  package name {&lt;br /&gt;
     import importStatement;&lt;br /&gt;
     datatype datatypeDefinition;&lt;br /&gt;
     entities/beans/enums&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:entity-1.png|center|frame|''Figure 1 - Entity model file - a package is the topmost element and contains other items.'']]&lt;br /&gt;
&lt;br /&gt;
Marking a DTO as abstract (before the dto keyword) generates an abstract Java class for it.&lt;br /&gt;
&lt;br /&gt;
The following modifiers may be placed after the dto keyword and the DTO name:&lt;br /&gt;
&lt;br /&gt;
=== import ===&lt;br /&gt;
The Entity DSL allows the referencing of entities defined in different packages, even in different .entitymodel files. The import statement is a way to make these elements available in the current namespace without having to address them by their fully qualified name. &lt;br /&gt;
&lt;br /&gt;
Import statements allow the use of the '*' wildcard.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
	import importStatement;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:entity-2.png|center|frame|''Figure 2: Items contained in another package can be addressed if the package is imported using the import keyword and its fully qualified name.'']]&lt;br /&gt;
&lt;br /&gt;
=== datatype ===&lt;br /&gt;
The Entity DSL allows the definition of datatypes. These are translated by the inferrer into their standard Java representation. The behavior of the generator can be controlled by the datatype definitions.&lt;br /&gt;
Datatypes defined in an .entitymodel file are local to that file. In order to define datatypes in one place and have them available in multiple .entitymodel files, the datatypes may be defined in a &amp;quot;.datatypes&amp;quot; file containing only datatype definitions inside a package statement.&lt;br /&gt;
There are three types of datatype definitions:&lt;br /&gt;
&lt;br /&gt;
* '''jvmTypes''': Datatype definitons that map types to '''jvmTypes''' take the basic syntax of&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;datatype &amp;lt;name&amp;gt; jvmType &amp;lt;type&amp;gt; as primitive;&amp;lt;/code&amp;gt;.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Specifying datatypes in this manner uses an appropriate wrapper class in the generated Java code; adding the keywords &amp;lt;code&amp;gt;as primitive&amp;lt;/code&amp;gt; enforces the use of primitive datatypes where applicable:&lt;br /&gt;
&amp;lt;code&amp;gt;datatype foo jvmType Integer;&amp;lt;/code&amp;gt; compiles to an &amp;lt;code&amp;gt;Integer&amp;lt;/code&amp;gt; whereas &amp;lt;code&amp;gt;datatype foo jvmType Integer as primitive;&amp;lt;/code&amp;gt; results in &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:entity-3.png|center|frame|''Figure 3: The defined datatype is translated to a wrapper class.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-4.png|center|frame|''Figure 4: By adding the &amp;lt;code&amp;gt;as primitive&amp;lt;/code&amp;gt; keywords, the datatype is translated to a primitive datatype.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* '''dateTypes''': The datatypes for handling temporal information can be defined by the following statement: &lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;datatype &amp;lt;name&amp;gt; datetype date—time—timestamp; &amp;lt;/code&amp;gt;&lt;br /&gt;
Datatypes that have been defined in this manner can be used as property variables in entities and beans.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-5.png|center|frame|''Figure 5: Defining datatypes for handling temporal information. Content assist is available.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* '''blobs''': Binary blobs can be handled by defining a datatype with the &amp;lt;code&amp;gt;as blob&amp;lt;/code&amp;gt; keywords. The Java implementation of such a blob is a byte array. Appropriate persistence annotations are automatically added.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;datatype &amp;lt;name&amp;gt; as blob;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-6.png|center|frame|''Figure 6: Including binary blobs by using a datatype with the &amp;lt;code&amp;gt;as blob&amp;lt;/code&amp;gt; keywords.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;After import statements and datatype definitions, the content of the .entitymodel file is made up of &amp;lt;code&amp;gt;entity&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;bean&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;enum&amp;lt;/code&amp;gt; definitions.&lt;br /&gt;
&lt;br /&gt;
== Entities ==&lt;br /&gt;
Entities are the most complex elements in the Entity DSL. An entity is an abstraction above a business object. Entities are defined by their name, properties, references and operations. Generally, an entity is an object which can keep the state of variables and references as well as be persisted. &lt;br /&gt;
For each entity that is defined in a package, a Java class and the corresponding persistence structure is automatically generated. Inside a project with Compex nature, &amp;quot;Auto-DTOs&amp;quot; and services are created as well.&lt;br /&gt;
&lt;br /&gt;
Entities may extend other entities. In this case, they are derived from their parent entity. That means that the properties and references of the parent entity are inherited.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 [modifiers] entity &amp;lt;name&amp;gt; extends &amp;lt;parentEntity&amp;gt; {&lt;br /&gt;
     [entityProperties]&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-7.png|center|frame|''Figure 7: Items contained in another package can be addressed if the package is imported using the &amp;lt;code&amp;gt;import&amp;lt;/code&amp;gt; keyword and its fully qualified name'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Entities may be defined with certain modifiers that change the generated Java Code. The following modifiers are supported:&lt;br /&gt;
&lt;br /&gt;
=== abstract ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;abstract&amp;lt;/code&amp;gt; marks the entity as &amp;quot;abstract&amp;quot;. This generates an abstract Java class.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-8.png|center|frame|''Figure 8: The &amp;lt;code&amp;gt;abstract&amp;lt;/code&amp;gt; keyword causes the translation into an abstract Java class'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== historized ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;historized&amp;lt;/code&amp;gt; marks the entity as &amp;quot;historized&amp;quot;. Historized entities can have several entries in a database, but only one of them may be marked as current.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;historized&amp;lt;/code&amp;gt; keyword adds an object ID, a version field and a flag for the current version to the entity.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-9.png|center|frame|''Figure 9: The &amp;lt;code&amp;gt;historized&amp;lt;/code&amp;gt; modifier triggers the creation of an object ID, an object version and a flag for marking the current version.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== cacheable ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;cacheable&amp;lt;/code&amp;gt; marks the entity as &amp;quot;cacheable&amp;quot;. The appropriate annotation for the persistence provider is added to the generated Java code.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-10.png|center|frame|''Figure 10: Declaring an entity to be &amp;lt;code&amp;gt;cacheable&amp;lt;/code&amp;gt; adds the &amp;lt;code&amp;gt;@Cacheable&amp;lt;/code&amp;gt; annotation'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== timedependent ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;timedependent&amp;lt;/code&amp;gt; marks the entity as &amp;quot;time-dependent&amp;quot;. An object may have several entries in the database. Which entry is valid will be determined by '''valid from''' and '''valid until''' fields that are added to the entity.&lt;br /&gt;
An object ID is created in order to tie the entries together. The &amp;lt;code&amp;gt;timedependent&amp;lt;/code&amp;gt; keyword recognizes the modifiers &amp;lt;code&amp;gt;(DATE)&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;(TIMESTAMP)&amp;lt;/code&amp;gt;. Default is &amp;lt;code&amp;gt;timedependent(DATE)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-11.png|center|frame|''Figure 11: The &amp;lt;code&amp;gt;timedependent&amp;lt;/code&amp;gt; keyword causes an object ID, a validFrom and a validUntil field to be created in order to support multiple database entries for an object.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== mapped superclass ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;mapped superclass&amp;lt;/code&amp;gt; marks a class that provides persistent entity state and mapping information for its subclasses, but which is not an entity itself.&lt;br /&gt;
&lt;br /&gt;
Typically, the purpose of a mapped superclass is to define state and mapping information that is common to multiple entities. All the mappings from the mapped superclass are inherited by its subclasses, as if they had been defined there directly.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-12.png|center|frame|''Figure 12: The &amp;lt;code&amp;gt;mapped superclass&amp;lt;/code&amp;gt; keyword sets the appropriate annotation which causes the persistence provider to move the mappings to the derived subclasses.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===extends===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The modifier &amp;lt;code&amp;gt;extends&amp;lt;/code&amp;gt; may be placed after the entity keyword and the entity name, as &amp;lt;code&amp;gt;entity foo extends bar {&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; has already been defined as an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;extends&amp;lt;/code&amp;gt; marks an entity that is derived from another entity. That means that the properties and references of the parent entity are inherited.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Entity Persistence Settings==&lt;br /&gt;
&lt;br /&gt;
Apart from the mapped superclass modifier that moves all property columns to the tables belonging to derived classes, the following settings for table inheritance can be specified within an entity definition:&lt;br /&gt;
* inheritance per class&lt;br /&gt;
* inheritance per subclass&lt;br /&gt;
&lt;br /&gt;
The structure of the database created from an entity model can be controlled by the following settings:&lt;br /&gt;
* schemaName&lt;br /&gt;
* tableName&lt;br /&gt;
* discriminatorColumn&lt;br /&gt;
* discriminatorType&lt;br /&gt;
* discriminatorValue&lt;br /&gt;
&lt;br /&gt;
===inheritance per class===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;inheritance per class{}&amp;lt;/code&amp;gt; causes a table to be created for each class; subclasses share this table using a discriminator value. This statement has to be followed by braces, inside of which further details can be specified.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-13.png|center|frame|''Figure 13: A single table for entity Base is created; the generated Java code for the “Derived” class shows that the “Derived” entity is added to this table by using a discriminator.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===inheritance per subclass===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;inheritance per subclass{}&amp;lt;/code&amp;gt; causes a table to be created for each subclass. This statement has to be followed by braces, inside of which further details can be specified. This is the default behaviour if no inheritance strategy is specified.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-14.png|center|frame|''Figure 14: An &amp;lt;code&amp;gt;@Table&amp;lt;/code&amp;gt; annotation is added to the generated Java code, so that the &amp;quot;Derived&amp;quot; entity is mapped to a table of its own.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===schemaName===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;schemaName&amp;lt;/code&amp;gt; allows the specification of a name for the database schema to be used. This setting is translated to the appropriate JPA annotation &amp;lt;code&amp;gt;@Table(schema = &amp;lt;xyz&amp;gt;)&amp;lt;/code&amp;gt;. The schema name given is converted to snake case using capitals.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===tableName===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;tableName&amp;lt;/code&amp;gt; allows the specification of a name for the table (within the database schema) to which the entity is mapped. This setting is translated to the appropriate JPA annotation &lt;br /&gt;
&amp;lt;code&amp;gt;@Table(name = &amp;lt;xyz&amp;gt;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The table name specified is converted to snake case using capitals. The default value is the name of the entity.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-15.png|center|frame|''Figure 15: Specifying the &amp;lt;code&amp;gt;schemaName&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;tableName&amp;lt;/code&amp;gt; settings in an entity determines the name of the database schema and tables used for persistence.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===discriminatorColumn===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;discriminatorColumn&amp;lt;/code&amp;gt; optionally allows the specification of a name for the discriminator column in the case of &amp;lt;code&amp;gt;inheritance per class&amp;lt;/code&amp;gt;. It appears within the braces after the inheritance-strategy statement and must be followed by a semicolon. It defaults to &amp;lt;code&amp;gt;DISC&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===discriminatorType===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;discriminatorType&amp;lt;/code&amp;gt; optionally allows the definition of the datatype of the discriminator within the single table. It can be set to &amp;lt;code&amp;gt;CHAR&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;INT&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;STRING&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;INHERIT&amp;lt;/code&amp;gt;. It appears within the braces after the &amp;lt;code&amp;gt;inheritance&amp;lt;/code&amp;gt; statement and must be followed by a semicolon. It defaults to &amp;lt;code&amp;gt;STRING;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===discriminatorValue===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;discriminatorValue&amp;lt;/code&amp;gt; allows a custom value to be used for the discriminator within the single table. It appears within the braces after the &amp;lt;code&amp;gt;inheritance&amp;lt;/code&amp;gt; statement and must be followed by a semicolon. It defaults to the entity name converted to snake case.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-16.png|center|frame|''Figure 16: The &amp;lt;code&amp;gt;inheritance&amp;lt;/code&amp;gt; statement allows the optional specification of discriminator column, type and value to be used in the case of a single table.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Beans==&lt;br /&gt;
&lt;br /&gt;
'''Beans''' are objects that are embedded in other entities, inheriting their persistence and lifecycle. Similar to entities, beans are characterised by their name, their properties and their references. For each bean that is defined in a package, a Java class is automatically generated.&lt;br /&gt;
&lt;br /&gt;
Beans can be embedded into entities by defining them as properties of the respective entity. The appropriate annotations (&amp;lt;code&amp;gt;@Embeddable&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@Embedded&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@AttributeOverrides&amp;lt;/code&amp;gt; etc.) are added in order to have beans persisted with their parent entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-17.png|center|frame|''Figure 17: Beans can be embedded in entities and are persisted with them.'']]&lt;br /&gt;
&lt;br /&gt;
==Enums==&lt;br /&gt;
&lt;br /&gt;
'''Enums''' are an abstraction of the Java &amp;lt;code&amp;gt;enum&amp;lt;/code&amp;gt;. They compile to &amp;lt;code&amp;gt;enum&amp;lt;/code&amp;gt; classes and can be used as properties in entities and beans.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-18.png|center|frame|''Figure 18: Defining &amp;lt;code&amp;gt;enums&amp;lt;/code&amp;gt; allows using them as variables in entities and beans.'']]&lt;br /&gt;
&lt;br /&gt;
==Properties==&lt;br /&gt;
Properties of entities and beans are references to datatypes or enums. They can be regarded as variables and are defined by a keyword followed by a datatype (Java type or datatype defined in the &amp;lt;code&amp;gt;datatype&amp;lt;/code&amp;gt; section) and a name. By defining a bean as a property of an entity, it is embedded in it.&lt;br /&gt;
&lt;br /&gt;
Properties can be determined with the following keywords:&lt;br /&gt;
&lt;br /&gt;
===var===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The basic property &amp;lt;code&amp;gt;var&amp;lt;/code&amp;gt; defines a variable that is persisted in a table column. A property must have a type and a name. &lt;br /&gt;
&lt;br /&gt;
'''Multiplicity''' of properties can be controlled by the following (optional) settings: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;[1]&amp;lt;/code&amp;gt; defines a non-nullable property. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..1]&amp;lt;/code&amp;gt; defines a nullable property (this is the default behavior). &lt;br /&gt;
* &amp;lt;code&amp;gt;[1..*]&amp;lt;/code&amp;gt; defines a list of properties that must not be empty. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..*]&amp;lt;/code&amp;gt; or simply &amp;lt;code&amp;gt;[*]&amp;lt;/code&amp;gt; defines a list of properties that may be empty.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-19.png|center|frame|''Figure 19: Variables can be defined using the &amp;lt;code&amp;gt;var&amp;lt;/code&amp;gt; keyword.'']]&lt;br /&gt;
&lt;br /&gt;
The appropriate persistence settings are generated automatically. If a multiplicity is specified, the appropriate annotations (and, if necessary, a list rather than a single variable) are generated.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===derived===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;derived&amp;lt;/code&amp;gt; defines a property that is derived from other properties. The derived property must be have a type, a name and the calculation logic that derives it from the other properties, written as an Xexpression in braces.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-20.png|center|frame|''Figure 20: Properties may be derived from other properties using an Xexpression.'']]&lt;br /&gt;
&lt;br /&gt;
The code is automatically translated to valid Java code.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dirty===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; defines a property used as a flag to track the &amp;quot;dirty&amp;quot; state of the buffered data when editing values, before the changes have been written back to the persistence entity. Only one &amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; flag is allowed per entity. The datatype has to be boolean.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-21.png|center|frame|''Figure 21: The &amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; property is used to flag whether changes have been made to the bufered data, but not yet written back to the persistence entity. '']]&lt;br /&gt;
&lt;br /&gt;
The boolean field for this property and the appropriate annotation are generated with the &amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; keyword.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===domainDescription===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;domainDescription&amp;lt;/code&amp;gt; defines a property that is used as a domain description. The appropriate annotation is added to the property. A domain description must be of type &amp;lt;code&amp;gt;String&amp;lt;/code&amp;gt;. Domain descriptions may be derived from other properties.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-22.png|center|frame|''Figure 22: Domain description properties can be created with the &amp;lt;code&amp;gt;domainDescription&amp;lt;/code&amp;gt; keyword.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===domainKey===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;domainKey&amp;lt;/code&amp;gt; defines a domain key. The appropriate annotation is added to the property. Primitive datatypes may be used as domain keys.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-23.png|center|frame|''Figure 23: A field containing a domain key is created with the &amp;lt;code&amp;gt;domainKey keyword&amp;lt;/code&amp;gt;.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===id===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
{{Deprecated}}&lt;br /&gt;
&lt;br /&gt;
'''id''' defines an ID property (used as a primary key by the JPA compiler). '''This keyword is deprecated - use uuid instead'''. If no &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; is specified, a warning is given. &lt;br /&gt;
&lt;br /&gt;
'''Caution''': ID autogeneration causes problems, since the value is not set before the entity is persisted, e.g., in the database. It is therefore advised to use the &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; keyword instead.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-24.png|center|frame|''Figure 24: Entities are supposed to have an ID property that is used as a primary key to the underlying database.'']]&lt;br /&gt;
&lt;br /&gt;
'''Caution''': The generated IDs are not necessarily unique if the deprecated &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; keyword is used!&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===index===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt; keyword causes an index for the table to be generated. Indexes may be based on one or more properties (primitive only) and references (one-to-one only) of the entity. An index must be given a name and, in braces, a list of the fields it is based upon. If the &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt; keyword is prefixed with &amp;lt;code&amp;gt;unique&amp;lt;/code&amp;gt;, a unique index is created.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-25.png|center|frame|''Figure 25: Database table indexes that map entities are generated with the &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt; keyword.'']]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;@Table&amp;lt;/code&amp;gt; annotation is supplemented with the index definition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===properties===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Features (properties and references) of entities and beans can optionally be given additional information in the form of key-value pairs. This information can then be retrieved from the semantic model. The key-value pairs are defined in parentheses after the properties keyword following the feature name. Multiple pairs can be defined (comma-separated).&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-26.png|center|frame|''Figure 26: Additional information about features can be defined by key-value pairs. This information is then stored in the semantic model and is retrievable.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===uuid===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; allows the use of Universally Unique IDs as primary keys. A new UUID value is generated for each object as soon as that object has been created, independently of database operations. This circumvents the problems with the &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; keyword. UUIDs have to be of type &amp;lt;code&amp;gt;String&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-27.png|center|frame|''Figure 27: By using the &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; keyword, entities are created with a reliably unique identifier.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===version===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; defines a version-property (used by the JPA-Compiler).&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-28.png|center|frame|''Figure 28: A &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; property can be added to entities and beans.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===transient===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;transient&amp;lt;/code&amp;gt; marks the property as transient. Instead of a &amp;lt;code&amp;gt;@Column&amp;lt;/code&amp;gt;, a &amp;lt;code&amp;gt;@Transient&amp;lt;/code&amp;gt; annotation is generated, so that the property is not persisted in the database.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-29.png|center|frame|''Figure 29: The &amp;lt;code&amp;gt;transient&amp;lt;/code&amp;gt; keyword enables the exclusion of properties from persistence.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
The Entity DSL tracks relationships between entities by using the concept of &amp;quot;references&amp;quot;. References can exist between objects of the same nature (entities to entities, beans to beans). Where appropriate, back references (&amp;quot;opposite&amp;quot;) are added.&lt;br /&gt;
References are defined by the &amp;lt;code&amp;gt;ref&amp;lt;/code&amp;gt; keyword, a target, an optional type and a name. The exact type of the reference can be specified with the following modifiers:&lt;br /&gt;
&lt;br /&gt;
===Multiplicity and nullability===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The Entity DSL supports the specification of multiplicities in square brackets appended to the type: &lt;br /&gt;
* &amp;lt;code&amp;gt;[1]&amp;lt;/code&amp;gt; defines a non-nullable, one-to-one relationship. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..1]&amp;lt;/code&amp;gt; defines a nullable, one-to-one relationship (this is the default behavior). &lt;br /&gt;
* &amp;lt;code&amp;gt;[1..*]&amp;lt;/code&amp;gt; defines a non-nullable, one-to-many relationship. An &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; reference is needed. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..*]&amp;lt;/code&amp;gt; or simply &amp;lt;code&amp;gt;[*]&amp;lt;/code&amp;gt; defines a nullable, one-to-many relationship. An &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; reference is needed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-30.png|center|frame|''Figure 30: Adding multiplicity &amp;quot;[1]&amp;quot; causes the annotations for non-nullable database entries to be set.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===opposite reference===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Lifecycle references need the specification of an opposite reference. This can be done with the &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; keyword.&lt;br /&gt;
&lt;br /&gt;
Using the &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; reference, it is possible to navigate back to the original object after following the reference. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===cascade===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; specifier controls the behavior of the database on delete operations. If an object with a &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; reference to other objects is deleted, those other objects will be removed as well.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-31.png|center|frame|''Figure 31: By using the &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; keywords, bidirectional associations can be achieved.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Operations==&lt;br /&gt;
&lt;br /&gt;
Operations are other important features. They are based on Xbase and offer a huge set of semantic features, extending the featureset of Java. Xbase additionally offers features such as closures.&lt;br /&gt;
Operations can be declared by the &amp;lt;code&amp;gt;def&amp;lt;/code&amp;gt; keyword followed by braces containing the inline operation.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-32.png|center|frame|''Figure 32: The &amp;lt;code&amp;gt;def&amp;lt;/code&amp;gt; keyword allows the inlining of custom methods in the Entity DSL code.'']]&lt;br /&gt;
&lt;br /&gt;
These methods are translated into the appropriate Java methods along with the automatically generated getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
==Annotations==&lt;br /&gt;
&lt;br /&gt;
Annotations can be added to all elements except import declarations. Specifying annotations in the Entity DSL works in a straightforward manner; content assist is available. The added annotations are taken over into the generated Java code.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-33.png|center|frame|''Figure 33: Annotating elements in the Compex Entity DSL causes an annotation to be inserted into the generated Java code.'']]&lt;br /&gt;
&lt;br /&gt;
These methods are translated into the appropriate Java methods along with the automatically generated getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
&lt;br /&gt;
Comments can be added anywhere in an .entitymodel text file and are copied over into the generated Java code. Comments are enclosed in &amp;lt;code&amp;gt;/* ... */&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-34.png|center|frame|''Figure 34: The comments added in the Entity DSL are transformed to Java-style comments in the generated code.'']]&lt;br /&gt;
&lt;br /&gt;
Comments before the &amp;lt;code&amp;gt;package&amp;lt;/code&amp;gt; keyword are copied over to all generated Java classes – this is the place for copyright notices.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-35.png|center|frame|''Figure 35: A comment before the package keyword ends up in all generated Java classes.'']]&lt;br /&gt;
&lt;br /&gt;
==Reserved Keywords==&lt;br /&gt;
&lt;br /&gt;
The keywords of the Entity DSL are syntactic features and can therefore not be used as semantic identifiers. &lt;br /&gt;
&lt;br /&gt;
In order to circumvent this, it is possible to escape them with the &amp;lt;code&amp;gt;^&amp;lt;/code&amp;gt; character. During the generation of the Java code, this escape character is removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-36.png|center|frame|''Figure 36: Using the escape character '^', it is possible to achieve an identifier in the generated Java code with a name that would be a reserved word in the Entity DSL. In this case, a variable named &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; is generated that cannot be specified in the entity model file.'']]&lt;br /&gt;
&lt;br /&gt;
Please note that you are also '''not allowed to use identifiers corresponding to reserved keywords''' of the supported databases you can find here below: &lt;br /&gt;
&lt;br /&gt;
[https://db.apache.org/derby/docs/10.2/ref/rrefkeywords29722.html Derby]&lt;br /&gt;
&lt;br /&gt;
[http://www.h2database.com/html/advanced.html?highlight=reserved&amp;amp;search=reser#firstFound H2] &lt;br /&gt;
&lt;br /&gt;
[https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/reserved-keywords?view=sql-server-2017 MS SQL] &lt;br /&gt;
&lt;br /&gt;
[​https://dev.mysql.com/doc/refman/8.0/en/keywords.html MySQL] &lt;br /&gt;
&lt;br /&gt;
[https://docs.oracle.com/database/121/SQLRF/ap_keywd001.htm#SQLRF55621 Oracle] &lt;br /&gt;
&lt;br /&gt;
[​https://www.postgresql.org/docs/8.2/sql-keywords-appendix.html PostgreSQL]&lt;br /&gt;
&lt;br /&gt;
== Copyright Notice ==&lt;br /&gt;
{{Copyright Notice}}&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=Entity_DSL&amp;diff=3716</id>
		<title>Entity DSL</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=Entity_DSL&amp;diff=3716"/>
				<updated>2019-02-06T10:41:40Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: /* Reserved Keywords */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
The Entity DSL facilitates the handling of persistence entities. Defining entities using the Entity DSL efficiently creates a clean entity model that contains all relevant semantic elements of the model text file. &lt;br /&gt;
This semantic model is used to automatically transform the semantic information into proper Java code with the respective annotations for a persistence provider. Additionally, if the entity model is located within a project with OSBP nature, &amp;quot;Auto-DTOs&amp;quot; and services are generated as well. In this case, attributes that are added to entities will automatically be transferred to the &amp;quot;Auto-DTOs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The main semantic elements of the Compex Entity DSL are the following:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Package&amp;quot; - the root element that contains all the other elements. A model can contain multiple packages. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Import&amp;quot; declarations - used to import external models or even Java classes. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Datatype&amp;quot; declarations - a way to define datatypes that can be used in entities and beans. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Entity&amp;quot; - the abstraction of a business model entity. It contains further elements such as properties and references. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Bean&amp;quot; - does not compile to a JPA Entity but to a Java Bean (POJO with getter and setter and PropertyChange-Support). Beans may be used as temporary containers in entity operations or can be embedded into JPA Entities. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Enum&amp;quot; - the abstraction for Java enums. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Property&amp;quot; - a reference to an embedded Bean, an Enum, a Java class or a simple datatype (as defined in the datatype declaration). Offers multiplicity. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Reference&amp;quot; - a reference to another Entity (or to another Bean in the case of a Bean). Offers multiplicity. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Operations&amp;quot; - similar to Java methods. The Xbase expression language can be used to write high-level code. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Annotations&amp;quot; can be placed on Entity, Property and Reference. &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Comments&amp;quot; can be added to all elements.&lt;br /&gt;
&lt;br /&gt;
== Entity model files ==&lt;br /&gt;
&lt;br /&gt;
Entity models are described in .entitymodel files. These files describe the entity model and are the basis for the code generation. Entity models may be split over several .entitymodel files containing packages in the same namespace.&lt;br /&gt;
An .entitymodel file may contain several packages with entities. However, from a performance point of view, a complex entity model may work better with more and smaller .entitymodel files than the same model crammed into a few large files (or even a single file).&lt;br /&gt;
&lt;br /&gt;
===package===&lt;br /&gt;
Entity model files must start with a package declaration. Packages are the root element of the Entity DSL grammar. Everything is contained in a package: Imports, Entities, Beans and Enums have to be defined inside the Package definition. One document can contain multiple packages with unique names. &lt;br /&gt;
The elements a package can contain are Entities, Beans and Enums. Additionally, a package allows Import statements and the declaration of datatypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  package name {&lt;br /&gt;
     import importStatement;&lt;br /&gt;
     datatype datatypeDefinition;&lt;br /&gt;
     entities/beans/enums&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:entity-1.png|center|frame|''Figure 1 - Entity model file - a package is the topmost element and contains other items.'']]&lt;br /&gt;
&lt;br /&gt;
Marking a DTO as abstract (before the dto keyword) generates an abstract Java class for it.&lt;br /&gt;
&lt;br /&gt;
The following modifiers may be placed after the dto keyword and the DTO name:&lt;br /&gt;
&lt;br /&gt;
=== import ===&lt;br /&gt;
The Entity DSL allows the referencing of entities defined in different packages, even in different .entitymodel files. The import statement is a way to make these elements available in the current namespace without having to address them by their fully qualified name. &lt;br /&gt;
&lt;br /&gt;
Import statements allow the use of the '*' wildcard.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
	import importStatement;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:entity-2.png|center|frame|''Figure 2: Items contained in another package can be addressed if the package is imported using the import keyword and its fully qualified name.'']]&lt;br /&gt;
&lt;br /&gt;
=== datatype ===&lt;br /&gt;
The Entity DSL allows the definition of datatypes. These are translated by the inferrer into their standard Java representation. The behavior of the generator can be controlled by the datatype definitions.&lt;br /&gt;
Datatypes defined in an .entitymodel file are local to that file. In order to define datatypes in one place and have them available in multiple .entitymodel files, the datatypes may be defined in a &amp;quot;.datatypes&amp;quot; file containing only datatype definitions inside a package statement.&lt;br /&gt;
There are three types of datatype definitions:&lt;br /&gt;
&lt;br /&gt;
* '''jvmTypes''': Datatype definitons that map types to '''jvmTypes''' take the basic syntax of&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;datatype &amp;lt;name&amp;gt; jvmType &amp;lt;type&amp;gt; as primitive;&amp;lt;/code&amp;gt;.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Specifying datatypes in this manner uses an appropriate wrapper class in the generated Java code; adding the keywords &amp;lt;code&amp;gt;as primitive&amp;lt;/code&amp;gt; enforces the use of primitive datatypes where applicable:&lt;br /&gt;
&amp;lt;code&amp;gt;datatype foo jvmType Integer;&amp;lt;/code&amp;gt; compiles to an &amp;lt;code&amp;gt;Integer&amp;lt;/code&amp;gt; whereas &amp;lt;code&amp;gt;datatype foo jvmType Integer as primitive;&amp;lt;/code&amp;gt; results in &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:entity-3.png|center|frame|''Figure 3: The defined datatype is translated to a wrapper class.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-4.png|center|frame|''Figure 4: By adding the &amp;lt;code&amp;gt;as primitive&amp;lt;/code&amp;gt; keywords, the datatype is translated to a primitive datatype.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* '''dateTypes''': The datatypes for handling temporal information can be defined by the following statement: &lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;datatype &amp;lt;name&amp;gt; datetype date—time—timestamp; &amp;lt;/code&amp;gt;&lt;br /&gt;
Datatypes that have been defined in this manner can be used as property variables in entities and beans.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-5.png|center|frame|''Figure 5: Defining datatypes for handling temporal information. Content assist is available.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* '''blobs''': Binary blobs can be handled by defining a datatype with the &amp;lt;code&amp;gt;as blob&amp;lt;/code&amp;gt; keywords. The Java implementation of such a blob is a byte array. Appropriate persistence annotations are automatically added.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;datatype &amp;lt;name&amp;gt; as blob;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-6.png|center|frame|''Figure 6: Including binary blobs by using a datatype with the &amp;lt;code&amp;gt;as blob&amp;lt;/code&amp;gt; keywords.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;After import statements and datatype definitions, the content of the .entitymodel file is made up of &amp;lt;code&amp;gt;entity&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;bean&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;enum&amp;lt;/code&amp;gt; definitions.&lt;br /&gt;
&lt;br /&gt;
== Entities ==&lt;br /&gt;
Entities are the most complex elements in the Entity DSL. An entity is an abstraction above a business object. Entities are defined by their name, properties, references and operations. Generally, an entity is an object which can keep the state of variables and references as well as be persisted. &lt;br /&gt;
For each entity that is defined in a package, a Java class and the corresponding persistence structure is automatically generated. Inside a project with Compex nature, &amp;quot;Auto-DTOs&amp;quot; and services are created as well.&lt;br /&gt;
&lt;br /&gt;
Entities may extend other entities. In this case, they are derived from their parent entity. That means that the properties and references of the parent entity are inherited.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 [modifiers] entity &amp;lt;name&amp;gt; extends &amp;lt;parentEntity&amp;gt; {&lt;br /&gt;
     [entityProperties]&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-7.png|center|frame|''Figure 7: Items contained in another package can be addressed if the package is imported using the &amp;lt;code&amp;gt;import&amp;lt;/code&amp;gt; keyword and its fully qualified name'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Entities may be defined with certain modifiers that change the generated Java Code. The following modifiers are supported:&lt;br /&gt;
&lt;br /&gt;
=== abstract ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;abstract&amp;lt;/code&amp;gt; marks the entity as &amp;quot;abstract&amp;quot;. This generates an abstract Java class.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-8.png|center|frame|''Figure 8: The &amp;lt;code&amp;gt;abstract&amp;lt;/code&amp;gt; keyword causes the translation into an abstract Java class'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== historized ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;historized&amp;lt;/code&amp;gt; marks the entity as &amp;quot;historized&amp;quot;. Historized entities can have several entries in a database, but only one of them may be marked as current.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;historized&amp;lt;/code&amp;gt; keyword adds an object ID, a version field and a flag for the current version to the entity.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-9.png|center|frame|''Figure 9: The &amp;lt;code&amp;gt;historized&amp;lt;/code&amp;gt; modifier triggers the creation of an object ID, an object version and a flag for marking the current version.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== cacheable ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;cacheable&amp;lt;/code&amp;gt; marks the entity as &amp;quot;cacheable&amp;quot;. The appropriate annotation for the persistence provider is added to the generated Java code.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-10.png|center|frame|''Figure 10: Declaring an entity to be &amp;lt;code&amp;gt;cacheable&amp;lt;/code&amp;gt; adds the &amp;lt;code&amp;gt;@Cacheable&amp;lt;/code&amp;gt; annotation'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== timedependent ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;timedependent&amp;lt;/code&amp;gt; marks the entity as &amp;quot;time-dependent&amp;quot;. An object may have several entries in the database. Which entry is valid will be determined by '''valid from''' and '''valid until''' fields that are added to the entity.&lt;br /&gt;
An object ID is created in order to tie the entries together. The &amp;lt;code&amp;gt;timedependent&amp;lt;/code&amp;gt; keyword recognizes the modifiers &amp;lt;code&amp;gt;(DATE)&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;(TIMESTAMP)&amp;lt;/code&amp;gt;. Default is &amp;lt;code&amp;gt;timedependent(DATE)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-11.png|center|frame|''Figure 11: The &amp;lt;code&amp;gt;timedependent&amp;lt;/code&amp;gt; keyword causes an object ID, a validFrom and a validUntil field to be created in order to support multiple database entries for an object.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== mapped superclass ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;mapped superclass&amp;lt;/code&amp;gt; marks a class that provides persistent entity state and mapping information for its subclasses, but which is not an entity itself.&lt;br /&gt;
&lt;br /&gt;
Typically, the purpose of a mapped superclass is to define state and mapping information that is common to multiple entities. All the mappings from the mapped superclass are inherited by its subclasses, as if they had been defined there directly.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-12.png|center|frame|''Figure 12: The &amp;lt;code&amp;gt;mapped superclass&amp;lt;/code&amp;gt; keyword sets the appropriate annotation which causes the persistence provider to move the mappings to the derived subclasses.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===extends===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The modifier &amp;lt;code&amp;gt;extends&amp;lt;/code&amp;gt; may be placed after the entity keyword and the entity name, as &amp;lt;code&amp;gt;entity foo extends bar {&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; has already been defined as an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;extends&amp;lt;/code&amp;gt; marks an entity that is derived from another entity. That means that the properties and references of the parent entity are inherited.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Entity Persistence Settings==&lt;br /&gt;
&lt;br /&gt;
Apart from the mapped superclass modifier that moves all property columns to the tables belonging to derived classes, the following settings for table inheritance can be specified within an entity definition:&lt;br /&gt;
* inheritance per class&lt;br /&gt;
* inheritance per subclass&lt;br /&gt;
&lt;br /&gt;
The structure of the database created from an entity model can be controlled by the following settings:&lt;br /&gt;
* schemaName&lt;br /&gt;
* tableName&lt;br /&gt;
* discriminatorColumn&lt;br /&gt;
* discriminatorType&lt;br /&gt;
* discriminatorValue&lt;br /&gt;
&lt;br /&gt;
===inheritance per class===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;inheritance per class{}&amp;lt;/code&amp;gt; causes a table to be created for each class; subclasses share this table using a discriminator value. This statement has to be followed by braces, inside of which further details can be specified.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-13.png|center|frame|''Figure 13: A single table for entity Base is created; the generated Java code for the “Derived” class shows that the “Derived” entity is added to this table by using a discriminator.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===inheritance per subclass===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;inheritance per subclass{}&amp;lt;/code&amp;gt; causes a table to be created for each subclass. This statement has to be followed by braces, inside of which further details can be specified. This is the default behaviour if no inheritance strategy is specified.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-14.png|center|frame|''Figure 14: An &amp;lt;code&amp;gt;@Table&amp;lt;/code&amp;gt; annotation is added to the generated Java code, so that the &amp;quot;Derived&amp;quot; entity is mapped to a table of its own.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===schemaName===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;schemaName&amp;lt;/code&amp;gt; allows the specification of a name for the database schema to be used. This setting is translated to the appropriate JPA annotation &amp;lt;code&amp;gt;@Table(schema = &amp;lt;xyz&amp;gt;)&amp;lt;/code&amp;gt;. The schema name given is converted to snake case using capitals.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===tableName===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;tableName&amp;lt;/code&amp;gt; allows the specification of a name for the table (within the database schema) to which the entity is mapped. This setting is translated to the appropriate JPA annotation &lt;br /&gt;
&amp;lt;code&amp;gt;@Table(name = &amp;lt;xyz&amp;gt;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The table name specified is converted to snake case using capitals. The default value is the name of the entity.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-15.png|center|frame|''Figure 15: Specifying the &amp;lt;code&amp;gt;schemaName&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;tableName&amp;lt;/code&amp;gt; settings in an entity determines the name of the database schema and tables used for persistence.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===discriminatorColumn===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;discriminatorColumn&amp;lt;/code&amp;gt; optionally allows the specification of a name for the discriminator column in the case of &amp;lt;code&amp;gt;inheritance per class&amp;lt;/code&amp;gt;. It appears within the braces after the inheritance-strategy statement and must be followed by a semicolon. It defaults to &amp;lt;code&amp;gt;DISC&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===discriminatorType===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;discriminatorType&amp;lt;/code&amp;gt; optionally allows the definition of the datatype of the discriminator within the single table. It can be set to &amp;lt;code&amp;gt;CHAR&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;INT&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;STRING&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;INHERIT&amp;lt;/code&amp;gt;. It appears within the braces after the &amp;lt;code&amp;gt;inheritance&amp;lt;/code&amp;gt; statement and must be followed by a semicolon. It defaults to &amp;lt;code&amp;gt;STRING;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===discriminatorValue===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;discriminatorValue&amp;lt;/code&amp;gt; allows a custom value to be used for the discriminator within the single table. It appears within the braces after the &amp;lt;code&amp;gt;inheritance&amp;lt;/code&amp;gt; statement and must be followed by a semicolon. It defaults to the entity name converted to snake case.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-16.png|center|frame|''Figure 16: The &amp;lt;code&amp;gt;inheritance&amp;lt;/code&amp;gt; statement allows the optional specification of discriminator column, type and value to be used in the case of a single table.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Beans==&lt;br /&gt;
&lt;br /&gt;
'''Beans''' are objects that are embedded in other entities, inheriting their persistence and lifecycle. Similar to entities, beans are characterised by their name, their properties and their references. For each bean that is defined in a package, a Java class is automatically generated.&lt;br /&gt;
&lt;br /&gt;
Beans can be embedded into entities by defining them as properties of the respective entity. The appropriate annotations (&amp;lt;code&amp;gt;@Embeddable&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@Embedded&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@AttributeOverrides&amp;lt;/code&amp;gt; etc.) are added in order to have beans persisted with their parent entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-17.png|center|frame|''Figure 17: Beans can be embedded in entities and are persisted with them.'']]&lt;br /&gt;
&lt;br /&gt;
==Enums==&lt;br /&gt;
&lt;br /&gt;
'''Enums''' are an abstraction of the Java &amp;lt;code&amp;gt;enum&amp;lt;/code&amp;gt;. They compile to &amp;lt;code&amp;gt;enum&amp;lt;/code&amp;gt; classes and can be used as properties in entities and beans.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-18.png|center|frame|''Figure 18: Defining &amp;lt;code&amp;gt;enums&amp;lt;/code&amp;gt; allows using them as variables in entities and beans.'']]&lt;br /&gt;
&lt;br /&gt;
==Properties==&lt;br /&gt;
Properties of entities and beans are references to datatypes or enums. They can be regarded as variables and are defined by a keyword followed by a datatype (Java type or datatype defined in the &amp;lt;code&amp;gt;datatype&amp;lt;/code&amp;gt; section) and a name. By defining a bean as a property of an entity, it is embedded in it.&lt;br /&gt;
&lt;br /&gt;
Properties can be determined with the following keywords:&lt;br /&gt;
&lt;br /&gt;
===var===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The basic property &amp;lt;code&amp;gt;var&amp;lt;/code&amp;gt; defines a variable that is persisted in a table column. A property must have a type and a name. &lt;br /&gt;
&lt;br /&gt;
'''Multiplicity''' of properties can be controlled by the following (optional) settings: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;[1]&amp;lt;/code&amp;gt; defines a non-nullable property. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..1]&amp;lt;/code&amp;gt; defines a nullable property (this is the default behavior). &lt;br /&gt;
* &amp;lt;code&amp;gt;[1..*]&amp;lt;/code&amp;gt; defines a list of properties that must not be empty. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..*]&amp;lt;/code&amp;gt; or simply &amp;lt;code&amp;gt;[*]&amp;lt;/code&amp;gt; defines a list of properties that may be empty.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-19.png|center|frame|''Figure 19: Variables can be defined using the &amp;lt;code&amp;gt;var&amp;lt;/code&amp;gt; keyword.'']]&lt;br /&gt;
&lt;br /&gt;
The appropriate persistence settings are generated automatically. If a multiplicity is specified, the appropriate annotations (and, if necessary, a list rather than a single variable) are generated.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===derived===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;derived&amp;lt;/code&amp;gt; defines a property that is derived from other properties. The derived property must be have a type, a name and the calculation logic that derives it from the other properties, written as an Xexpression in braces.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-20.png|center|frame|''Figure 20: Properties may be derived from other properties using an Xexpression.'']]&lt;br /&gt;
&lt;br /&gt;
The code is automatically translated to valid Java code.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dirty===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; defines a property used as a flag to track the &amp;quot;dirty&amp;quot; state of the buffered data when editing values, before the changes have been written back to the persistence entity. Only one &amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; flag is allowed per entity. The datatype has to be boolean.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-21.png|center|frame|''Figure 21: The &amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; property is used to flag whether changes have been made to the bufered data, but not yet written back to the persistence entity. '']]&lt;br /&gt;
&lt;br /&gt;
The boolean field for this property and the appropriate annotation are generated with the &amp;lt;code&amp;gt;dirty&amp;lt;/code&amp;gt; keyword.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===domainDescription===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;domainDescription&amp;lt;/code&amp;gt; defines a property that is used as a domain description. The appropriate annotation is added to the property. A domain description must be of type &amp;lt;code&amp;gt;String&amp;lt;/code&amp;gt;. Domain descriptions may be derived from other properties.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-22.png|center|frame|''Figure 22: Domain description properties can be created with the &amp;lt;code&amp;gt;domainDescription&amp;lt;/code&amp;gt; keyword.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===domainKey===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;domainKey&amp;lt;/code&amp;gt; defines a domain key. The appropriate annotation is added to the property. Primitive datatypes may be used as domain keys.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-23.png|center|frame|''Figure 23: A field containing a domain key is created with the &amp;lt;code&amp;gt;domainKey keyword&amp;lt;/code&amp;gt;.'']]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===id===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
{{Deprecated}}&lt;br /&gt;
&lt;br /&gt;
'''id''' defines an ID property (used as a primary key by the JPA compiler). '''This keyword is deprecated - use uuid instead'''. If no &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; is specified, a warning is given. &lt;br /&gt;
&lt;br /&gt;
'''Caution''': ID autogeneration causes problems, since the value is not set before the entity is persisted, e.g., in the database. It is therefore advised to use the &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; keyword instead.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-24.png|center|frame|''Figure 24: Entities are supposed to have an ID property that is used as a primary key to the underlying database.'']]&lt;br /&gt;
&lt;br /&gt;
'''Caution''': The generated IDs are not necessarily unique if the deprecated &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; keyword is used!&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===index===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt; keyword causes an index for the table to be generated. Indexes may be based on one or more properties (primitive only) and references (one-to-one only) of the entity. An index must be given a name and, in braces, a list of the fields it is based upon. If the &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt; keyword is prefixed with &amp;lt;code&amp;gt;unique&amp;lt;/code&amp;gt;, a unique index is created.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-25.png|center|frame|''Figure 25: Database table indexes that map entities are generated with the &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt; keyword.'']]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;@Table&amp;lt;/code&amp;gt; annotation is supplemented with the index definition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===properties===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Features (properties and references) of entities and beans can optionally be given additional information in the form of key-value pairs. This information can then be retrieved from the semantic model. The key-value pairs are defined in parentheses after the properties keyword following the feature name. Multiple pairs can be defined (comma-separated).&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-26.png|center|frame|''Figure 26: Additional information about features can be defined by key-value pairs. This information is then stored in the semantic model and is retrievable.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===uuid===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; allows the use of Universally Unique IDs as primary keys. A new UUID value is generated for each object as soon as that object has been created, independently of database operations. This circumvents the problems with the &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; keyword. UUIDs have to be of type &amp;lt;code&amp;gt;String&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-27.png|center|frame|''Figure 27: By using the &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; keyword, entities are created with a reliably unique identifier.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===version===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; defines a version-property (used by the JPA-Compiler).&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-28.png|center|frame|''Figure 28: A &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; property can be added to entities and beans.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===transient===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;transient&amp;lt;/code&amp;gt; marks the property as transient. Instead of a &amp;lt;code&amp;gt;@Column&amp;lt;/code&amp;gt;, a &amp;lt;code&amp;gt;@Transient&amp;lt;/code&amp;gt; annotation is generated, so that the property is not persisted in the database.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-29.png|center|frame|''Figure 29: The &amp;lt;code&amp;gt;transient&amp;lt;/code&amp;gt; keyword enables the exclusion of properties from persistence.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
The Entity DSL tracks relationships between entities by using the concept of &amp;quot;references&amp;quot;. References can exist between objects of the same nature (entities to entities, beans to beans). Where appropriate, back references (&amp;quot;opposite&amp;quot;) are added.&lt;br /&gt;
References are defined by the &amp;lt;code&amp;gt;ref&amp;lt;/code&amp;gt; keyword, a target, an optional type and a name. The exact type of the reference can be specified with the following modifiers:&lt;br /&gt;
&lt;br /&gt;
===Multiplicity and nullability===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The Entity DSL supports the specification of multiplicities in square brackets appended to the type: &lt;br /&gt;
* &amp;lt;code&amp;gt;[1]&amp;lt;/code&amp;gt; defines a non-nullable, one-to-one relationship. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..1]&amp;lt;/code&amp;gt; defines a nullable, one-to-one relationship (this is the default behavior). &lt;br /&gt;
* &amp;lt;code&amp;gt;[1..*]&amp;lt;/code&amp;gt; defines a non-nullable, one-to-many relationship. An &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; reference is needed. &lt;br /&gt;
* &amp;lt;code&amp;gt;[0..*]&amp;lt;/code&amp;gt; or simply &amp;lt;code&amp;gt;[*]&amp;lt;/code&amp;gt; defines a nullable, one-to-many relationship. An &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; reference is needed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-30.png|center|frame|''Figure 30: Adding multiplicity &amp;quot;[1]&amp;quot; causes the annotations for non-nullable database entries to be set.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===opposite reference===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Lifecycle references need the specification of an opposite reference. This can be done with the &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; keyword.&lt;br /&gt;
&lt;br /&gt;
Using the &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; reference, it is possible to navigate back to the original object after following the reference. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===cascade===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; specifier controls the behavior of the database on delete operations. If an object with a &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; reference to other objects is deleted, those other objects will be removed as well.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-31.png|center|frame|''Figure 31: By using the &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;opposite&amp;lt;/code&amp;gt; keywords, bidirectional associations can be achieved.'']]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Operations==&lt;br /&gt;
&lt;br /&gt;
Operations are other important features. They are based on Xbase and offer a huge set of semantic features, extending the featureset of Java. Xbase additionally offers features such as closures.&lt;br /&gt;
Operations can be declared by the &amp;lt;code&amp;gt;def&amp;lt;/code&amp;gt; keyword followed by braces containing the inline operation.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-32.png|center|frame|''Figure 32: The &amp;lt;code&amp;gt;def&amp;lt;/code&amp;gt; keyword allows the inlining of custom methods in the Entity DSL code.'']]&lt;br /&gt;
&lt;br /&gt;
These methods are translated into the appropriate Java methods along with the automatically generated getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
==Annotations==&lt;br /&gt;
&lt;br /&gt;
Annotations can be added to all elements except import declarations. Specifying annotations in the Entity DSL works in a straightforward manner; content assist is available. The added annotations are taken over into the generated Java code.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-33.png|center|frame|''Figure 33: Annotating elements in the Compex Entity DSL causes an annotation to be inserted into the generated Java code.'']]&lt;br /&gt;
&lt;br /&gt;
These methods are translated into the appropriate Java methods along with the automatically generated getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
&lt;br /&gt;
Comments can be added anywhere in an .entitymodel text file and are copied over into the generated Java code. Comments are enclosed in &amp;lt;code&amp;gt;/* ... */&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-34.png|center|frame|''Figure 34: The comments added in the Entity DSL are transformed to Java-style comments in the generated code.'']]&lt;br /&gt;
&lt;br /&gt;
Comments before the &amp;lt;code&amp;gt;package&amp;lt;/code&amp;gt; keyword are copied over to all generated Java classes – this is the place for copyright notices.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-35.png|center|frame|''Figure 35: A comment before the package keyword ends up in all generated Java classes.'']]&lt;br /&gt;
&lt;br /&gt;
==Reserved Keywords==&lt;br /&gt;
&lt;br /&gt;
The keywords of the Entity DSL are syntactic features and can therefore not be used as semantic identifiers. &lt;br /&gt;
&lt;br /&gt;
In order to circumvent this, it is possible to escape them with the &amp;lt;code&amp;gt;^&amp;lt;/code&amp;gt; character. During the generation of the Java code, this escape character is removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Entity-36.png|center|frame|''Figure 36: Using the escape character '^', it is possible to achieve an identifier in the generated Java code with a name that would be a reserved word in the Entity DSL. In this case, a variable named &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt; is generated that cannot be specified in the entity model file.'']]&lt;br /&gt;
&lt;br /&gt;
Please note that you are also '''not allowed to use identifiers corresponding to reserved keywords''' of the supported databases: &lt;br /&gt;
&lt;br /&gt;
[https://db.apache.org/derby/docs/10.2/ref/rrefkeywords29722.html Derby]&lt;br /&gt;
&lt;br /&gt;
[http://www.h2database.com/html/advanced.html?highlight=reserved&amp;amp;search=reser#firstFound H2] &lt;br /&gt;
&lt;br /&gt;
[https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/reserved-keywords?view=sql-server-2017 MS SQL] &lt;br /&gt;
&lt;br /&gt;
[​https://dev.mysql.com/doc/refman/8.0/en/keywords.html MySQL] &lt;br /&gt;
&lt;br /&gt;
[https://docs.oracle.com/database/121/SQLRF/ap_keywd001.htm#SQLRF55621 Oracle] &lt;br /&gt;
&lt;br /&gt;
[​https://www.postgresql.org/docs/8.2/sql-keywords-appendix.html PostgreSQL]&lt;br /&gt;
&lt;br /&gt;
== Copyright Notice ==&lt;br /&gt;
{{Copyright Notice}}&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=3005</id>
		<title>AppUpIn5Extensions</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=3005"/>
				<updated>2018-01-23T10:27:43Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Purpose==&lt;br /&gt;
&lt;br /&gt;
The purpose of this document is to describe the first set of functional extensions of the CSV2App module presented in the [[App up in 5 minutes]] page, which will be available with the next release version.&lt;br /&gt;
&lt;br /&gt;
=== OSBP applications===&lt;br /&gt;
&lt;br /&gt;
The OSBP application '''My1App''' should already have been generated before starting this app.  &lt;br /&gt;
You can find the instructions [http://download.osbee.org/documentation/index.php/My_first_app here].&lt;br /&gt;
&lt;br /&gt;
=== CSV-file ===&lt;br /&gt;
&lt;br /&gt;
You may use the two following files as reference files [http://download.osbee.org/downloads/samples/documentation/BrandType.csv BrandType.csv] and [http://download.osbee.org/downloads/samples/documentation/Brand.csv Brand.csv]&amp;lt;span id=&amp;quot;files&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''AppUpIn5 - Extensions 1.0'' ==&lt;br /&gt;
&lt;br /&gt;
You get access to those new functionalities by opening a csv file with the CSV2App module editor of the OS.bee Software Factory, and by making a left mouse click on the column you wish to edit the metadata from.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Brandtype.png|none|frame|''Figure 1: Brandtype.csv in CSV2 Editor'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The settings dialog of the corresponding column will then appear. The several options provided in this dialog are organized in two parts: the meta data section and the sorting section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Settingdialog.png|frame|none|''Figure 2: Settings dialog of column &amp;quot;id&amp;quot;'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The sorting options are always available to the user, whereas the meta data options are only available based on the analysis of the type of data contained in the selected column.&lt;br /&gt;
&lt;br /&gt;
==Metadata options==&lt;br /&gt;
The metadata section allows users to set additional information related to the entity that will be created, based on the content of a csv file and existing dsl model files.&lt;br /&gt;
&lt;br /&gt;
===Id===&lt;br /&gt;
With the option ''ID'' you are able to define the column representing the unique identifier data of an entity. An entity has always one identification key, also known as primary key, which is here a ''Universal Unique Identifier'' (UUID), a unique alphanumerical string. Only columns having this type of data can be defined by the user as ''ID''-columns.&lt;br /&gt;
&lt;br /&gt;
With a left mouse click on the column named ''id'' of the csv file ''BrandType.csv'', the user opens the settings dialog of this column.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:SettingsID.png|frame|none|''Figure 3: Settings dialog column &amp;quot;id&amp;quot; of Brandtype'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the ''ID'' checkbox, (2) and then pressing the OK button, the user set the column ''id'' as the ''ID''-column of the entity created later on, like shown on the figure below. Each entity has always one UUID attribute. Therefore each csv file must have one ''ID''-column. The generated code later on will look like this snippet on figure 4.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Brandtypeid.png|frame|none|''Figure 4: Entity dsl model - &amp;quot;id&amp;quot; attribute of Brandtype'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reference===&lt;br /&gt;
With the reference option you are able to set column data as reference data (or foreign key) pointing to the ''Universal Unique Identifier'' (primary key) of another '''already existing entity'''. These data are also alphanumerical values, as mentioned in the section above concerning the id-option. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:RefArea.png|frame|none|''Figure 5: Reference area.'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A reference column results into the creation of a 1-n relation between the new entity, which will be created on the basis of the considered csv file and the referenced entity, which already exists in the entity model file of your project. The condition of having this target entity to be referenced on already existing in the model translates into a specific '''order of execution''' of the application creation:  successively pressing the button ''Create App'' in the right order to be able to choose the target entity.&lt;br /&gt;
&lt;br /&gt;
For instance, we would like to create a reference between the entity ''Brandtype'' and the new entity to be created ''Brand'', whose csv file contains the ''brandTypeId'' as column. As you can see on the left side of figure 6, showing the content of the entity dsl model file, the entity ''Brandtype'' has already been created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:RefEntBrand.png|thumb|600px|none|''Figure 6: Entity model file and Brand.csv file.'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the reference checkbox, (2) selecting ''Brandtype'' in the list of all existing entities, (3) and then by pressing the OK button, the user set the column ''brandTypeId'' as a reference key pointing to the UUID of the entity ''Brandtype''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:RefBrandtypeId.png|thumb|600px|none|''Figure 7: Settings dialog column &amp;quot;brandTypeId&amp;quot; of Brand'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The result of this relation at the end of the app creation would then look like this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Refbrandtypenormal.png|thumb|600px|none|''Figure 8: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The optional tag &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; allows, when selected, the deletion of all elements of the n-side of the relation, when the one-side element is deleted. In our example, the removal of one brand type would then result to the deletion of all the brands categorized by that type. The generated relation would then look like this in contrast to last example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Refbrandtypecascade.png|thumb|600px|none|''Figure 9: Reference result on &amp;quot;brandTypeId&amp;quot; with cascade'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Besides the fact that here 1-n relations are created between entities, a reference attribute will also be generated in each one of them. This is needed in order to show the information data of each relation graphically (here as table) in the application interface. This is characterized by the use of a &amp;lt;code&amp;gt;properties{...}&amp;lt;/code&amp;gt; block.&lt;br /&gt;
&lt;br /&gt;
===Domain key===&lt;br /&gt;
The domain key option allows the user to set a user friendly identification search field for the application instead of UUIDs, since those are too cryptic for users to clearly distinguish data from each other. &lt;br /&gt;
&lt;br /&gt;
Only column data from type string allow the user to define a column as the domain key column.&lt;br /&gt;
&lt;br /&gt;
In the case of the entity ''Brandtype'', an adequate candidate for the domain key is the column ''brandTypeNm'' containing the names of brand types, which are easy for users to read and identify data from in the application later on.&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the domain key checkbox, (2) and then pressing the OK button, the user defines the column ''brandTypeNm'' as the domain key column of the entity Brandtype.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Brandtypenm.png|frame|none|''Figure 10:  Settings dialog column &amp;quot;brandTypeNm&amp;quot; of Brandtype'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The result is the creation of the domain key attribute of the entity ''Brandtype'' as shown on the figure below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:BrandtypenmEntity.png|frame|none|''Figure 11: Domain key in entity dsl model'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Media data===&lt;br /&gt;
The media data option allows the user to define a column as a multimedia column. It allows user to specify from which columns information can be gathered from, in order to create the appropriate structures to store and upload any type of files in your application. This type of column contains the filenames of the multimedia files without extension. In addition to both the mime type and the extension, the user has also to define the directory path, where those files are located.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata.png|thumb|600px|none|''Figure 12: Media data section'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The currently supported mime types are the following: plain, jpg, mpeg, octetstream and pdf. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata4.png|thumb|600px|none|''Figure 13: Mimetypes'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The user can not just select one of the predefined extension formats (bmp, csv, jpg, mp3, pdf, txt, xml), but also edit an extension format on his own (java or sql ...).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata5.png|thumb|600px|none|''Figure 14: Extensions'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An optional column name can be given by the user to set the name of the multimedia column, which will be additionally created to store these files based on the OS.bee [[BlobMapping]] data type. If not defined, the media column name will consist of the actual column name followed with the suffix '''media'''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only columns containing text data can be defined as media data column by the user. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata1.png|thumb|600px|none|''Figure 15: Media data on column &amp;quot;bsin&amp;quot;'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The column ''bsin'' of the entity Brand contains media file name. Besides being provided with the Brand.csv file, we also have the corresponding jpg-files illustrated here in figure 16.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata2.png|thumb|600px|none|''Figure 16: Media file location'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After opening the settings dialog of the column ''bsin'', (1) the user needs first to select the media data checkbox, which allows the modification of the information needed. (2) The user sets the path directory with the help of directory chooser, which appears after pressing the Path button and then selects the directory, in which the files are located. (3) The mime type and extension of the files have to be chosen within the corresponding combo boxes. (4) After pressing the OK button, the user sets the column ''bsin'' as a multimedia column. This will then result into the creation of both attributes ''bsin'' and ''bsinmedia'' of the entity Brand later on, as shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata3.png|thumb|600px|none|''Figure 17: Blobmapping attribute in entity Brand'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==General Notice==&lt;br /&gt;
As soon as the user press the button &amp;quot;Create App&amp;quot;, an error message will eventually be displayed to inform the user to complete or adapt the meta data configuration of the considered csv file.&lt;br /&gt;
* '''Please note that a proper configuration of column definitions has to be done by the user as soon as id, reference or domain keys candidates have been detected.''' Candidates are columns of a csv file, which meet the criteria for either an id, a reference (both from alphanumerical string with UUID format as described above) or a domain key column. Setting the meta data of those columns is then '''mandatory'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''A universal unique identifier (UUID) will be automatically generated by the OS.bee Software Factory for an entity only in the case, in which no id-column candidates are available in a csv file.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Please note that all configurations made by the user in one csv file are immediately lost, as soon as the user close the file from the CSV2App module editor or by restarting the eclipse IDE.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further information over the usage of meta data such as '''id''', '''reference''' and '''domain key''' can be found in the [[Entity DSL]] documentation page.&lt;br /&gt;
&lt;br /&gt;
==Sorting options==&lt;br /&gt;
The sorting section allows you to sort the csv data within the editor. The selected column data can be sorted either in an ascending or a descending order.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting.png|frame|none|''Figure 18: Sorting options'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following examples show you how to use the sort functions by applying it on the column ''brandNm'' of the provided [[#files|Brand.csv]] file. After you opened it in the CSV2App module editor within your eclipse workspace (for example via drag-n-drop), (1) make a left-mouse click on the column ''brandNm'', (2) choose either the ascending (figure 19) or the descending (figure 20) option in the sorting section, (3) and then press the OK button to trigger to the sorting of the column data. (4) You can observe the resulting sorted column data on the right side of both figures below.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
► '''Example 1''':&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting1.png|thumb|600px|none|''Figure 19: Ascending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
► '''Example 2''':&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting2.png|thumb|600px|none|''Figure 20: Descending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copyright Notice ==&lt;br /&gt;
{{Copyright Notice}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== License information ==&lt;br /&gt;
&lt;br /&gt;
{{License information}}&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Sorting2.png&amp;diff=3004</id>
		<title>File:Sorting2.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Sorting2.png&amp;diff=3004"/>
				<updated>2018-01-23T10:01:21Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: Worayeno uploaded a new version of File:Sorting2.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Sorting1.png&amp;diff=3003</id>
		<title>File:Sorting1.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Sorting1.png&amp;diff=3003"/>
				<updated>2018-01-23T10:00:54Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: Worayeno uploaded a new version of File:Sorting1.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Refbrandtypecascade.png&amp;diff=3002</id>
		<title>File:Refbrandtypecascade.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Refbrandtypecascade.png&amp;diff=3002"/>
				<updated>2018-01-23T09:41:05Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Refbrandtypenormal.png&amp;diff=3001</id>
		<title>File:Refbrandtypenormal.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Refbrandtypenormal.png&amp;diff=3001"/>
				<updated>2018-01-23T09:40:44Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=3000</id>
		<title>AppUpIn5Extensions</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=3000"/>
				<updated>2018-01-23T09:40:22Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Purpose==&lt;br /&gt;
&lt;br /&gt;
The purpose of this document is to describe the first set of functional extensions of the CSV2App module presented in the [[App up in 5 minutes]] page, which will be available with the next release version.&lt;br /&gt;
&lt;br /&gt;
=== OSBP applications===&lt;br /&gt;
&lt;br /&gt;
The OSBP application '''My1App''' should already have been generated before starting this app.  &lt;br /&gt;
You can find the instructions [http://download.osbee.org/documentation/index.php/My_first_app here].&lt;br /&gt;
&lt;br /&gt;
=== CSV-file ===&lt;br /&gt;
&lt;br /&gt;
You may use the two following files as reference files [http://download.osbee.org/downloads/samples/documentation/BrandType.csv BrandType.csv] and [http://download.osbee.org/downloads/samples/documentation/Brand.csv Brand.csv]&amp;lt;span id=&amp;quot;files&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''AppUpIn5 - Extensions 1.0'' ==&lt;br /&gt;
&lt;br /&gt;
You get access to those new functionalities by opening a csv file with the CSV2App module editor of the OS.bee Software Factory, and by making a left mouse click on the column you wish to edit the metadata from.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Brandtype.png|none|frame|''Figure 1: Brandtype.csv im CSV2 Editor'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The settings dialog of the corresponding column will then appear. The several options provided in this dialog are organized in two parts: the meta data section and the sorting section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Settingdialog.png|frame|none|''Figure 2: Settings dialog of column &amp;quot;id&amp;quot;'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The sorting options are always available to the user, whereas the meta data options are only available based on the analysis of the type of data contained in the selected column.&lt;br /&gt;
&lt;br /&gt;
==Metadata options==&lt;br /&gt;
The metadata section allows users to set additional information related to the entity that will be created, based on the content of a csv file and existing dsl model files.&lt;br /&gt;
&lt;br /&gt;
===Id===&lt;br /&gt;
With the option ''ID'' you are able to define the column representing the unique identifier data of an entity. An entity has always one identification key, also known as primary key, which is here a ''Universal Unique Identifier'' (UUID), a unique alphanumerical string. Only columns having this type of data can be defined by the user as ''ID''-columns.&lt;br /&gt;
&lt;br /&gt;
With a left mouse click on the column named ''id'' of the csv file ''BrandType.csv'', the user opens the settings dialog of this column.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:SettingsID.png|frame|none|''Figure 3: Settings dialog column &amp;quot;id&amp;quot; of Brandtype'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the ''ID'' checkbox, (2) and then pressing the OK button, the user set the column ''id'' as the ''ID''-column of the entity created later on, like shown on the figure below. Each entity has always one UUID attribute, therefore each csv file must have one ''ID''-column. The generated code later on will look like this snippet on figure 4.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Brandtypeid.png|frame|none|''Figure 4: Entity dsl model - &amp;quot;id&amp;quot; attribute of Brandtype'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reference===&lt;br /&gt;
With the reference option you are able to set column data as reference data (or foreign key) pointing to the ''Universal Unique Identifier'' (primary key) of another '''already existing entity'''. These data are also alphanumerical values, as mentioned in the section above concerning the id-option. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:RefArea.png|frame|none|''Figure 5: Reference area.'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A reference column results into the creation of a 1-n relation between the new entity, which will be created on the basis of the considered csv file and the referenced entity, which already exists in the entity model file of your project. The condition of having this target entity to be referenced on already existing in the model translates into a specific '''order of execution''' of the application creation:  successively pressing the button ''Create App'' in the right order to be able to choose the target entity.&lt;br /&gt;
&lt;br /&gt;
For instance, we would like to create a reference between the entity ''Brandtype'' and the new entity to be created ''Brand'', whose csv file contains the ''brandTypeId'' as column. As you can see on the left side of figure 6, showing the content of the entity dsl model file, the entity ''Brandtype'' has already been created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:RefEntBrand.png|thumb|600px|none|''Figure 6: Entity model file and Brand.csv file.'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the reference checkbox, (2) selecting ''Brandtype'' in the list of all existing entities, (3) and then by pressing the OK button, the user set the column ''brandTypeId'' as a reference key pointing to the UUID of the entity ''Brandtype''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:RefBrandtypeId.png|thumb|600px|none|''Figure 7: Settings dialog column &amp;quot;brandTypeId&amp;quot; of Brand'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The result of this relation at the end of the app creation would then look like this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Refbrandtypenormal.png|thumb|600px|none|''Figure 8: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The optional tag &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; allows, when selected, the deletion of all elements of the n-side of the relation, when the one-side element is deleted. In our example, the removal of one brand type would then result to the deletion of all the brands categorized by that type. The generated relation would then look like this in contrast to last example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Refbrandtypecascade.png|thumb|600px|none|''Figure 9: Reference result on &amp;quot;brandTypeId&amp;quot; with cascade'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Besides the fact that here 1-n relations are created between entities, a reference attribute will also be generated in each entity. This is needed in order to show the information data of each relation graphically (here as table) in the application interface. This is characterized by the use of a &amp;lt;code&amp;gt;properties{...}&amp;lt;/code&amp;gt; block.&lt;br /&gt;
&lt;br /&gt;
===Domain key===&lt;br /&gt;
The domain key option allows the user to set a user friendly identification search field for the application instead of UUIDs, since those are too cryptic for users to clearly distinguish data from each other. &lt;br /&gt;
&lt;br /&gt;
Only column data from type string allow the user to define a column as the domain key column.&lt;br /&gt;
&lt;br /&gt;
In the case of the entity ''Brandtype'', an adequate candidate for the domain key is the column ''brandTypeNm'' containing the names of brand types, which are easy for users to read and identify data from in the application later on.&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the domain key checkbox, (2) and then pressing the OK button, the user define the column ''brandTypeNm'' as the domain key column of the entity Brandtype.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Brandtypenm.png|frame|none|''Figure 10:  Settings dialog column &amp;quot;brandTypeNm&amp;quot; of Brandtype'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This results into the creation of the domain key attribute of the entity ''Brandtype'' as shown on the figure below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:BrandtypenmEntity.png|frame|none|''Figure 11: Domain key in entity dsl model'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Media data===&lt;br /&gt;
The media data option allows the user to define a column as a multimedia column. It allows user to specify from which columns information can be gathered from, in order to create the appropiate structures to store and upload any type of files in your application. This type of column contains the filenames of the multimedia files without extension. In addition to both the mime type and the extension, the user has also to define the directory path, where those files are located.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata.png|thumb|600px|none|''Figure 12: Media data section'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The currently supported mime types are the following: plain, jpg, mpeg, octetstream and pdf. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata4.png|thumb|600px|none|''Figure 13: Mimetypes'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The user can not just select one of the predefined extension formats (bmp, csv, jpg, mp3, pdf, txt, xml), but also edit an extension format on his own (java or sql...).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata5.png|thumb|600px|none|''Figure 14: Extensions'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An optional column name can be given by the user to set the name of the multimedia column, which will be additionally created to store these files based on the OS.bee [[BlobMapping]] data type. If not defined, the media column name will consist of the actual column name followed with the suffix '''media'''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only columns containing text data can be defined as media data column by the user. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata1.png|thumb|600px|none|''Figure 15: Media data on column &amp;quot;bsin&amp;quot;'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The column ''bsin'' of the entity Brand contains media file name. Besides being provided with the Brand.csv file, we also have the corresponding jpg-files illustrated here in figure 16.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata2.png|thumb|600px|none|''Figure 16: Media file location'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After opening the settings dialog of the column ''bsin'', (1) the user needs first to select the media data checkbox, which allows the modification of the information needed. (2) The user sets the path directory with the help of directory chooser, which appears after pressing the Path button and then selects the directory, in which the files are located. (3) The mime type and extension of the files have to be chosen within the corresponding combo boxes. (4) After pressing the OK button, the user sets the column ''bsin'' as a multimedia column. This will then result into the creation of both attributes ''bsin'' and ''bsinmedia'' of the entity Brand later on, as shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata3.png|thumb|600px|none|''Figure 17: Blobmapping attribute in entity Brand'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==General Notice==&lt;br /&gt;
As soon as the user press the button &amp;quot;Create App&amp;quot;, an error message will eventually be displayed to inform the user to complete or adapt the metadata configuration of the considered csv file.&lt;br /&gt;
* '''Please note that a proper configuration of column definitions has to be done by the user as soon as id, reference or domain keys candidates have been detected.''' Candidates are columns of a csv file, which meet the criteria for either an id, a reference (both from alphanumerical string with UUID format as described above) or a domain key column. Setting the metadata of those columns is then '''mandatory'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''A universal unique identifier (UUID) will be automatically generated by the OS.bee Software Factory for an entity only in the case, in which no id-column candidates are available in a csv file.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Please note that all configurations made by the user in one csv file are immediately lost, as soon as the user close the file from the CSV2App module editor or by restarting the eclipse IDE.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further information over the usage of metadata such as '''id''', '''reference''' and '''domain key''' can be found in the [[Entity DSL]] documentation page.&lt;br /&gt;
&lt;br /&gt;
==Sorting options==&lt;br /&gt;
The sorting section allows you to sort the csv data within the editor. The selected column data can be sorted either in an ascending or a descending order.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting.png|frame|none|''Figure 18: Sorting options'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following examples show you how to use the sort functions by applying it on the column ''brandNm'' of the provided [[#files|Brand.csv]] file. After you opened it in the CSV2App module editor within your eclipse workspace (for example via drag-n-drop), (1) make a left-mouse click on the column ''brandNm'', (2) choose either the ascending (figure 19) or the descending (figure 20) option in the sorting section, (3) and then press the OK button to trigger to the sorting of the column data. (4) You can observe the resulting sorted column data on the right side of both figures below.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
► '''Example 1''':&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting1.png|thumb|600px|none|''Figure 19: Ascending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
► '''Example 2''':&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting2.png|thumb|600px|none|''Figure 20: Descending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copyright Notice ==&lt;br /&gt;
{{Copyright Notice}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== License information ==&lt;br /&gt;
&lt;br /&gt;
{{License information}}&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:RefBrandtypeId1.png&amp;diff=2999</id>
		<title>File:RefBrandtypeId1.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:RefBrandtypeId1.png&amp;diff=2999"/>
				<updated>2018-01-23T09:38:25Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: Worayeno uploaded a new version of File:RefBrandtypeId1.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Brandtypeid.png&amp;diff=2998</id>
		<title>File:Brandtypeid.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Brandtypeid.png&amp;diff=2998"/>
				<updated>2018-01-23T09:23:38Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: Worayeno uploaded a new version of File:Brandtypeid.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:RefEntBrand.png&amp;diff=2997</id>
		<title>File:RefEntBrand.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:RefEntBrand.png&amp;diff=2997"/>
				<updated>2018-01-23T09:20:12Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2996</id>
		<title>AppUpIn5Extensions</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2996"/>
				<updated>2018-01-23T09:19:48Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Purpose==&lt;br /&gt;
&lt;br /&gt;
The purpose of this document is to describe the first set of functional extensions of the CSV2App module presented in the [[App up in 5 minutes]] page, which will be available with the next release version.&lt;br /&gt;
&lt;br /&gt;
=== OSBP applications===&lt;br /&gt;
&lt;br /&gt;
The OSBP application '''My1App''' should already have been generated before starting this app.  &lt;br /&gt;
You can find the instructions [http://download.osbee.org/documentation/index.php/My_first_app here].&lt;br /&gt;
&lt;br /&gt;
=== CSV-file ===&lt;br /&gt;
&lt;br /&gt;
You may use the two following files as reference files [http://download.osbee.org/downloads/samples/documentation/BrandType.csv BrandType.csv] and [http://download.osbee.org/downloads/samples/documentation/Brand.csv Brand.csv]&amp;lt;span id=&amp;quot;files&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''AppUpIn5 - Extensions 1.0'' ==&lt;br /&gt;
&lt;br /&gt;
You get access to those new functionalities by opening a csv file with the CSV2App module editor of the OS.bee Software Factory, and by making a left mouse click on the column you wish to edit the metadata from.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Brandtype.png|none|frame|''Figure 1: Brandtype.csv im CSV2 Editor'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The settings dialog of the corresponding column will then appear. The several options provided in this dialog are organized in two parts: the meta data section and the sorting section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Settingdialog.png|frame|none|''Figure 2: Settings dialog of column &amp;quot;id&amp;quot;'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The sorting options are always available to the user, whereas the meta data options are only available based on the analysis of the type of data contained in the selected column.&lt;br /&gt;
&lt;br /&gt;
==Metadata options==&lt;br /&gt;
The metadata section allows users to set additional information related to the entity that will be created, based on the content of a csv file and existing dsl model files.&lt;br /&gt;
&lt;br /&gt;
===Id===&lt;br /&gt;
With the option ''ID'' you are able to define the column representing the unique identifier data of an entity. An entity has always one identification key, also known as primary key, which is here a ''Universal Unique Identifier'' (UUID), a unique alphanumerical string. Only columns having this type of data can be defined by the user as ''ID''-columns.&lt;br /&gt;
&lt;br /&gt;
With a left mouse click on the column named ''id'' of the csv file ''BrandType.csv'', the user opens the settings dialog of this column.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:SettingsID.png|frame|none|''Figure 3: Settings dialog column &amp;quot;id&amp;quot; of Brandtype'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the ''ID'' checkbox, (2) and then pressing the OK button, the user set the column ''id'' as the ''ID''-column of the entity created later on, like shown on the figure below. Each entity has always one UUID attribute, therefore each csv file must have one ''ID''-column. The generated code later on will look like this snippet on figure 4.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Brandtypeid.png|frame|none|''Figure 4: Entity dsl model - &amp;quot;id&amp;quot; attribute of Brandtype'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reference===&lt;br /&gt;
With the reference option you are able to set column data as reference data (or foreign key) pointing to the ''Universal Unique Identifier'' (primary key) of another '''already existing entity'''. These data are also alphanumerical values, as mentioned in the section above concerning the id-option. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:RefArea.png|frame|none|''Figure 5: Reference area.'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A reference column results into the creation of a 1-n relation between the new entity, which will be created on the basis of the considered csv file and the referenced entity, which already exists in the entity model file of your project. The condition of having this target entity to be referenced on already existing in the model translates into a specific '''order of execution''' of the application creation:  successively pressing the button ''Create App'' in the right order to be able to choose the target entity.&lt;br /&gt;
&lt;br /&gt;
For instance, we would like to create a reference between the entity ''Brandtype'' and the new entity to be created ''Brand'', whose csv file contains the ''brandTypeId'' as column. As you can see on the left side of figure 6, showing the content of the entity dsl model file, the entity ''Brandtype'' has already been created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:RefEntBrand.png|thumb|600px|none|''Figure 6: Entity model file and Brand.csv file.'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the reference checkbox, (2) selecting ''Brandtype'' in the list of all existing entities, (3) and then by pressing the OK button, the user set the column ''brandTypeId'' as a reference key pointing to the UUID of the entity ''Brandtype''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:RefBrandtypeId.png|thumb|600px|none|''Figure 7: Settings dialog column &amp;quot;brandTypeId&amp;quot; of Brand'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The result of this relation at the end of the app creation would then look like this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:RefBrandtypeId1.png|thumb|600px|none|''Figure 8: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The optional tag &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; allows, when selected, the deletion of all elements of the n-side of the relation, when the one-side element is deleted. In our example, the removal of one brand type would then result to the deletion of all the brands categorized by that type. The generated relation would then look like this in contrast to last example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:RefBrandtypeId2.png|thumb|600px|none|''Figure 9: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Besides the fact that here 1-n relations are created between entities, a reference attribute will also be generated in each entity. This is needed in order to show the information data of each relation graphically (here as table) in the application interface. This is characterized by the use of a &amp;lt;code&amp;gt;properties{...}&amp;lt;/code&amp;gt; block.&lt;br /&gt;
&lt;br /&gt;
===Domain key===&lt;br /&gt;
The domain key option allows the user to set a user friendly identification search field for the application instead of UUIDs, since those are too cryptic for users to clearly distinguish data from each other. &lt;br /&gt;
&lt;br /&gt;
Only column data from type string allow the user to define a column as the domain key column.&lt;br /&gt;
&lt;br /&gt;
In the case of the entity ''Brandtype'', an adequate candidate for the domain key is the column ''brandTypeNm'' containing the names of brand types, which are easy for users to read and identify data from in the application later on.&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the domain key checkbox, (2) and then pressing the OK button, the user define the column ''brandTypeNm'' as the domain key column of the entity Brandtype.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Brandtypenm.png|frame|none|''Figure 10:  Settings dialog column &amp;quot;brandTypeNm&amp;quot; of Brandtype'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This results into the creation of the domain key attribute of the entity ''Brandtype'' as shown on the figure below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:BrandtypenmEntity.png|frame|none|''Figure 11: Domain key in entity dsl model'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Media data===&lt;br /&gt;
The media data option allows the user to define a column as a multimedia column. It allows user to specify from which columns information can be gathered from, in order to create the appropiate structures to store and upload any type of files in your application. This type of column contains the filenames of the multimedia files without extension. In addition to both the mime type and the extension, the user has also to define the directory path, where those files are located.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata.png|thumb|600px|none|''Figure 12: Media data section'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The currently supported mime types are the following: plain, jpg, mpeg, octetstream and pdf. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata4.png|thumb|600px|none|''Figure 13: Mimetypes'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The user can not just select one of the predefined extension formats (bmp, csv, jpg, mp3, pdf, txt, xml), but also edit an extension format on his own (java or sql...).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata5.png|thumb|600px|none|''Figure 14: Extensions'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An optional column name can be given by the user to set the name of the multimedia column, which will be additionally created to store these files based on the OS.bee [[BlobMapping]] data type. If not defined, the media column name will consist of the actual column name followed with the suffix '''media'''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only columns containing text data can be defined as media data column by the user. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata1.png|thumb|600px|none|''Figure 15: Media data on column &amp;quot;bsin&amp;quot;'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The column ''bsin'' of the entity Brand contains media file name. Besides being provided with the Brand.csv file, we also have the corresponding jpg-files illustrated here in figure 16.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata2.png|thumb|600px|none|''Figure 16: Media file location'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After opening the settings dialog of the column ''bsin'', (1) the user needs first to select the media data checkbox, which allows the modification of the information needed. (2) The user sets the path directory with the help of directory chooser, which appears after pressing the Path button and then selects the directory, in which the files are located. (3) The mime type and extension of the files have to be chosen within the corresponding combo boxes. (4) After pressing the OK button, the user sets the column ''bsin'' as a multimedia column. This will then result into the creation of both attributes ''bsin'' and ''bsinmedia'' of the entity Brand later on, as shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata3.png|thumb|600px|none|''Figure 17: Blobmapping attribute in entity Brand'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==General Notice==&lt;br /&gt;
As soon as the user press the button &amp;quot;Create App&amp;quot;, an error message will eventually be displayed to inform the user to complete or adapt the metadata configuration of the considered csv file.&lt;br /&gt;
* '''Please note that a proper configuration of column definitions has to be done by the user as soon as id, reference or domain keys candidates have been detected.''' Candidates are columns of a csv file, which meet the criteria for either an id, a reference (both from alphanumerical string with UUID format as described above) or a domain key column. Setting the metadata of those columns is then '''mandatory'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''A universal unique identifier (UUID) will be automatically generated by the OS.bee Software Factory for an entity only in the case, in which no id-column candidates are available in a csv file.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Please note that all configurations made by the user in one csv file are immediately lost, as soon as the user close the file from the CSV2App module editor or by restarting the eclipse IDE.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further information over the usage of metadata such as '''id''', '''reference''' and '''domain key''' can be found in the [[Entity DSL]] documentation page.&lt;br /&gt;
&lt;br /&gt;
==Sorting options==&lt;br /&gt;
The sorting section allows you to sort the csv data within the editor. The selected column data can be sorted either in an ascending or a descending order.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting.png|frame|none|''Figure 18: Sorting options'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following examples show you how to use the sort functions by applying it on the column ''brandNm'' of the provided [[#files|Brand.csv]] file. After you opened it in the CSV2App module editor within your eclipse workspace (for example via drag-n-drop), (1) make a left-mouse click on the column ''brandNm'', (2) choose either the ascending (figure 19) or the descending (figure 20) option in the sorting section, (3) and then press the OK button to trigger to the sorting of the column data. (4) You can observe the resulting sorted column data on the right side of both figures below.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
► '''Example 1''':&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting1.png|thumb|600px|none|''Figure 19: Ascending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
► '''Example 2''':&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting2.png|thumb|600px|none|''Figure 20: Descending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copyright Notice ==&lt;br /&gt;
{{Copyright Notice}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== License information ==&lt;br /&gt;
&lt;br /&gt;
{{License information}}&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:RefEntityBrand.png&amp;diff=2995</id>
		<title>File:RefEntityBrand.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:RefEntityBrand.png&amp;diff=2995"/>
				<updated>2018-01-23T09:17:28Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: Worayeno uploaded a new version of File:RefEntityBrand.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2994</id>
		<title>AppUpIn5Extensions</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2994"/>
				<updated>2018-01-23T09:13:32Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: /* Metadata options */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Purpose==&lt;br /&gt;
&lt;br /&gt;
The purpose of this document is to describe the first set of functional extensions of the CSV2App module presented in the [[App up in 5 minutes]] page, which will be available with the next release version.&lt;br /&gt;
&lt;br /&gt;
=== OSBP applications===&lt;br /&gt;
&lt;br /&gt;
The OSBP application '''My1App''' should already have been generated before starting this app.  &lt;br /&gt;
You can find the instructions [http://download.osbee.org/documentation/index.php/My_first_app here].&lt;br /&gt;
&lt;br /&gt;
=== CSV-file ===&lt;br /&gt;
&lt;br /&gt;
You may use the two following files as reference files [http://download.osbee.org/downloads/samples/documentation/BrandType.csv BrandType.csv] and [http://download.osbee.org/downloads/samples/documentation/Brand.csv Brand.csv]&amp;lt;span id=&amp;quot;files&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''AppUpIn5 - Extensions 1.0'' ==&lt;br /&gt;
&lt;br /&gt;
You get access to those new functionalities by opening a csv file with the CSV2App module editor of the OS.bee Software Factory, and by making a left mouse click on the column you wish to edit the metadata from.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Brandtype.png|none|frame|''Figure 1: Brandtype.csv im CSV2 Editor'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The settings dialog of the corresponding column will then appear. The several options provided in this dialog are organized in two parts: the meta data section and the sorting section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Settingdialog.png|frame|none|''Figure 2: Settings dialog of column &amp;quot;id&amp;quot;'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The sorting options are always available to the user, whereas the meta data options are only available based on the analysis of the type of data contained in the selected column.&lt;br /&gt;
&lt;br /&gt;
==Metadata options==&lt;br /&gt;
The metadata section allows users to set additional information related to the entity that will be created, based on the content of a csv file and existing dsl model files.&lt;br /&gt;
&lt;br /&gt;
===Id===&lt;br /&gt;
With the option ''ID'' you are able to define the column representing the unique identifier data of an entity. An entity has always one identification key, also known as primary key, which is here a ''Universal Unique Identifier'' (UUID), a unique alphanumerical string. Only columns having this type of data can be defined by the user as ''ID''-columns.&lt;br /&gt;
&lt;br /&gt;
With a left mouse click on the column named ''id'' of the csv file ''BrandType.csv'', the user opens the settings dialog of this column.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:SettingsID.png|frame|none|''Figure 3: Settings dialog column &amp;quot;id&amp;quot; of Brandtype'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the ''ID'' checkbox, (2) and then pressing the OK button, the user set the column ''id'' as the ''ID''-column of the entity created later on, like shown on the figure below. Each entity has always one UUID attribute, therefore each csv file must have one ''ID''-column. The generated code later on will look like this snippet on figure 4.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Brandtypeid.png|frame|none|''Figure 4: Entity dsl model - &amp;quot;id&amp;quot; attribute of Brandtype'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reference===&lt;br /&gt;
With the reference option you are able to set column data as reference data (or foreign key) pointing to the ''Universal Unique Identifier'' (primary key) of another '''already existing entity'''. These data are also alphanumerical values, as mentioned in the section above concerning the id-option. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:RefArea.png|frame|none|''Figure 5: Reference area.'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A reference column results into the creation of a 1-n relation between the new entity, which will be created on the basis of the considered csv file and the referenced entity, which already exists in the entity model file of your project. The condition of having this target entity to be referenced on already existing in the model translates into a specific '''order of execution''' of the application creation:  successively pressing the button ''Create App'' in the right order to be able to choose the target entity.&lt;br /&gt;
&lt;br /&gt;
For instance, we would like to create a reference between the entity ''Brandtype'' and the new entity to be created ''Brand'', whose csv file contains the ''brandTypeId'' as column. As you can see on the left side of figure 6, showing the content of the entity dsl model file, the entity ''Brandtype'' has already been created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:RefEntityBrand.png|thumb|600px|none|''Figure 6: Entity model file and Brand.csv file.'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the reference checkbox, (2) selecting ''Brandtype'' in the list of all existing entities, (3) and then by pressing the OK button, the user set the column ''brandTypeId'' as a reference key pointing to the UUID of the entity ''Brandtype''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:RefBrandtypeId.png|thumb|600px|none|''Figure 7: Settings dialog column &amp;quot;brandTypeId&amp;quot; of Brand'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The result of this relation at the end of the app creation would then look like this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:RefBrandtypeId1.png|thumb|600px|none|''Figure 8: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The optional tag &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; allows, when selected, the deletion of all elements of the n-side of the relation, when the one-side element is deleted. In our example, the removal of one brand type would then result to the deletion of all the brands categorized by that type. The generated relation would then look like this in contrast to last example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:RefBrandtypeId2.png|thumb|600px|none|''Figure 9: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Besides the fact that here 1-n relations are created between entities, a reference attribute will also be generated in each entity. This is needed in order to show the information data of each relation graphically (here as table) in the application interface. This is characterized by the use of a &amp;lt;code&amp;gt;properties{...}&amp;lt;/code&amp;gt; block.&lt;br /&gt;
&lt;br /&gt;
===Domain key===&lt;br /&gt;
The domain key option allows the user to set a user friendly identification search field for the application instead of UUIDs, since those are too cryptic for users to clearly distinguish data from each other. &lt;br /&gt;
&lt;br /&gt;
Only column data from type string allow the user to define a column as the domain key column.&lt;br /&gt;
&lt;br /&gt;
In the case of the entity ''Brandtype'', an adequate candidate for the domain key is the column ''brandTypeNm'' containing the names of brand types, which are easy for users to read and identify data from in the application later on.&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the domain key checkbox, (2) and then pressing the OK button, the user define the column ''brandTypeNm'' as the domain key column of the entity Brandtype.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Brandtypenm.png|frame|none|''Figure 10:  Settings dialog column &amp;quot;brandTypeNm&amp;quot; of Brandtype'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This results into the creation of the domain key attribute of the entity ''Brandtype'' as shown on the figure below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:BrandtypenmEntity.png|frame|none|''Figure 11: Domain key in entity dsl model'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Media data===&lt;br /&gt;
The media data option allows the user to define a column as a multimedia column. It allows user to specify from which columns information can be gathered from, in order to create the appropiate structures to store and upload any type of files in your application. This type of column contains the filenames of the multimedia files without extension. In addition to both the mime type and the extension, the user has also to define the directory path, where those files are located.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata.png|thumb|600px|none|''Figure 12: Media data section'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The currently supported mime types are the following: plain, jpg, mpeg, octetstream and pdf. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata4.png|thumb|600px|none|''Figure 13: Mimetypes'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The user can not just select one of the predefined extension formats (bmp, csv, jpg, mp3, pdf, txt, xml), but also edit an extension format on his own (java or sql...).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata5.png|thumb|600px|none|''Figure 14: Extensions'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An optional column name can be given by the user to set the name of the multimedia column, which will be additionally created to store these files based on the OS.bee [[BlobMapping]] data type. If not defined, the media column name will consist of the actual column name followed with the suffix '''media'''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only columns containing text data can be defined as media data column by the user. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata1.png|thumb|600px|none|''Figure 15: Media data on column &amp;quot;bsin&amp;quot;'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The column ''bsin'' of the entity Brand contains media file name. Besides being provided with the Brand.csv file, we also have the corresponding jpg-files illustrated here in figure 16.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata2.png|thumb|600px|none|''Figure 16: Media file location'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After opening the settings dialog of the column ''bsin'', (1) the user needs first to select the media data checkbox, which allows the modification of the information needed. (2) The user sets the path directory with the help of directory chooser, which appears after pressing the Path button and then selects the directory, in which the files are located. (3) The mime type and extension of the files have to be chosen within the corresponding combo boxes. (4) After pressing the OK button, the user sets the column ''bsin'' as a multimedia column. This will then result into the creation of both attributes ''bsin'' and ''bsinmedia'' of the entity Brand later on, as shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Mediadata3.png|thumb|600px|none|''Figure 17: Blobmapping attribute in entity Brand'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==General Notice==&lt;br /&gt;
As soon as the user press the button &amp;quot;Create App&amp;quot;, an error message will eventually be displayed to inform the user to complete or adapt the metadata configuration of the considered csv file.&lt;br /&gt;
* '''Please note that a proper configuration of column definitions has to be done by the user as soon as id, reference or domain keys candidates have been detected.''' Candidates are columns of a csv file, which meet the criteria for either an id, a reference (both from alphanumerical string with UUID format as described above) or a domain key column. Setting the metadata of those columns is then '''mandatory'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''A universal unique identifier (UUID) will be automatically generated by the OS.bee Software Factory for an entity only in the case, in which no id-column candidates are available in a csv file.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Please note that all configurations made by the user in one csv file are immediately lost, as soon as the user close the file from the CSV2App module editor or by restarting the eclipse IDE.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further information over the usage of metadata such as '''id''', '''reference''' and '''domain key''' can be found in the [[Entity DSL]] documentation page.&lt;br /&gt;
&lt;br /&gt;
==Sorting options==&lt;br /&gt;
The sorting section allows you to sort the csv data within the editor. The selected column data can be sorted either in an ascending or a descending order.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting.png|frame|none|''Figure 18: Sorting options'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following examples show you how to use the sort functions by applying it on the column ''brandNm'' of the provided [[#files|Brand.csv]] file. After you opened it in the CSV2App module editor within your eclipse workspace (for example via drag-n-drop), (1) make a left-mouse click on the column ''brandNm'', (2) choose either the ascending (figure 19) or the descending (figure 20) option in the sorting section, (3) and then press the OK button to trigger to the sorting of the column data. (4) You can observe the resulting sorted column data on the right side of both figures below.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
► '''Example 1''':&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting1.png|thumb|600px|none|''Figure 19: Ascending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
► '''Example 2''':&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting2.png|thumb|600px|none|''Figure 20: Descending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copyright Notice ==&lt;br /&gt;
{{Copyright Notice}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== License information ==&lt;br /&gt;
&lt;br /&gt;
{{License information}}&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2993</id>
		<title>AppUpIn5Extensions</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2993"/>
				<updated>2018-01-23T09:11:13Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: /* AppUpIn5 - Extensions 1.0 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Purpose==&lt;br /&gt;
&lt;br /&gt;
The purpose of this document is to describe the first set of functional extensions of the CSV2App module presented in the [[App up in 5 minutes]] page, which will be available with the next release version.&lt;br /&gt;
&lt;br /&gt;
=== OSBP applications===&lt;br /&gt;
&lt;br /&gt;
The OSBP application '''My1App''' should already have been generated before starting this app.  &lt;br /&gt;
You can find the instructions [http://download.osbee.org/documentation/index.php/My_first_app here].&lt;br /&gt;
&lt;br /&gt;
=== CSV-file ===&lt;br /&gt;
&lt;br /&gt;
You may use the two following files as reference files [http://download.osbee.org/downloads/samples/documentation/BrandType.csv BrandType.csv] and [http://download.osbee.org/downloads/samples/documentation/Brand.csv Brand.csv]&amp;lt;span id=&amp;quot;files&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''AppUpIn5 - Extensions 1.0'' ==&lt;br /&gt;
&lt;br /&gt;
You get access to those new functionalities by opening a csv file with the CSV2App module editor of the OS.bee Software Factory, and by making a left mouse click on the column you wish to edit the metadata from.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Brandtype.png|none|frame|''Figure 1: Brandtype.csv im CSV2 Editor'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The settings dialog of the corresponding column will then appear. The several options provided in this dialog are organized in two parts: the meta data section and the sorting section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:Settingdialog.png|frame|none|''Figure 2: Settings dialog of column &amp;quot;id&amp;quot;'']]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The sorting options are always available to the user, whereas the meta data options are only available based on the analysis of the type of data contained in the selected column.&lt;br /&gt;
&lt;br /&gt;
==Metadata options==&lt;br /&gt;
The metadata section allows users to set additional information related to the entity that will be created, based on the content of a csv file and existing dsl model files.&lt;br /&gt;
&lt;br /&gt;
===Id===&lt;br /&gt;
With the option ''ID'' you are able to define the column representing the unique identifier data of an entity. An entity has always one identification key, also known as primary key, which is here a ''Universal Unique Identifier'' (UUID), a unique alphanumerical string. Only columns having this type of data can be defined by the user as ''ID''-columns.&lt;br /&gt;
&lt;br /&gt;
With a left mouse click on the column named ''id'' of the csv file ''BrandType.csv'', the user opens the settings dialog of this column.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:SettingsID.png|frame|none|''Figure 3: Settings dialog column &amp;quot;id&amp;quot; of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the ''ID'' checkbox, (2) and then pressing the OK button, the user set the column ''id'' as the ''ID''-column of the entity created later on, like shown on the figure below. Each entity has always one UUID attribute, therefore each csv file must have one ''ID''-column. The generated code later on will look like this snippet on figure 4.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Brandtypeid.png|frame|none|''Figure 4: Entity dsl model - &amp;quot;id&amp;quot; attribute of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
===Reference===&lt;br /&gt;
With the reference option you are able to set column data as reference data (or foreign key) pointing to the ''Universal Unique Identifier'' (primary key) of another '''already existing entity'''. These data are also alphanumerical values, as mentioned in the section above concerning the id-option. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefArea.png|frame|none|''Figure 5: Reference area.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A reference column results into the creation of a 1-n relation between the new entity, which will be created on the basis of the considered csv file and the referenced entity, which already exists in the entity model file of your project. The condition of having this target entity to be referenced on already existing in the model translates into a specific '''order of execution''' of the application creation:  successively pressing the button ''Create App'' in the right order to be able to choose the target entity.&lt;br /&gt;
&lt;br /&gt;
For instance, we would like to create a reference between the entity ''Brandtype'' and the new entity to be created ''Brand'', whose csv file contains the ''brandTypeId'' as column. As you can see on the left side of figure 6, showing the content of the entity dsl model file, the entity ''Brandtype'' has already been created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefEntityBrand.png|thumb|600px|none|''Figure 6: Entity model file and Brand.csv file.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the reference checkbox, (2) selecting ''Brandtype'' in the list of all existing entities, (3) and then by pressing the OK button, the user set the column ''brandTypeId'' as a reference key pointing to the UUID of the entity ''Brandtype''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefBrandtypeId.png|thumb|600px|none|''Figure 7: Settings dialog column &amp;quot;brandTypeId&amp;quot; of Brand'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The result of this relation at the end of the app creation would then look like this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefBrandtypeId1.png|thumb|600px|none|''Figure 8: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The optional tag &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; allows, when selected, the deletion of all elements of the n-side of the relation, when the one-side element is deleted. In our example, the removal of one brand type would then result to the deletion of all the brands categorized by that type. The generated relation would then look like this in contrast to last example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefBrandtypeId2.png|thumb|600px|none|''Figure 9: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Besides the fact that here 1-n relations are created between entities, a reference attribute will also be generated in each entity. This is needed in order to show the information data of each relation graphically (here as table) in the application interface. This is characterized by the use of a &amp;lt;code&amp;gt;properties{...}&amp;lt;/code&amp;gt; block.&lt;br /&gt;
&lt;br /&gt;
===Domain key===&lt;br /&gt;
The domain key option allows the user to set a user friendly identification search field for the application instead of UUIDs, since those are too cryptic for users to clearly distinguish data from each other. &lt;br /&gt;
&lt;br /&gt;
Only column data from type string allow the user to define a column as the domain key column.&lt;br /&gt;
&lt;br /&gt;
In the case of the entity ''Brandtype'', an adequate candidate for the domain key is the column ''brandTypeNm'' containing the names of brand types, which are easy for users to read and identify data from in the application later on.&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the domain key checkbox, (2) and then pressing the OK button, the user define the column ''brandTypeNm'' as the domain key column of the entity Brandtype.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Brandtypenm.png|frame|none|''Figure 10:  Settings dialog column &amp;quot;brandTypeNm&amp;quot; of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This results into the creation of the domain key attribute of the entity ''Brandtype'' as shown on the figure below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:BrandtypenmEntity.png|frame|none|''Figure 11: Domain key in entity dsl model'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Media data===&lt;br /&gt;
The media data option allows the user to define a column as a multimedia column. It allows user to specify from which columns information can be gathered from, in order to create the appropiate structures to store and upload any type of files in your application. This type of column contains the filenames of the multimedia files without extension. In addition to both the mime type and the extension, the user has also to define the directory path, where those files are located.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata.png|thumb|600px|none|''Figure 12: Media data section'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The currently supported mime types are the following: plain, jpg, mpeg, octetstream and pdf. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata4.png|thumb|600px|none|''Figure 13: Mimetypes'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The user can not just select one of the predefined extension formats (bmp, csv, jpg, mp3, pdf, txt, xml), but also edit an extension format on his own (java or sql...).&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata5.png|thumb|600px|none|''Figure 14: Extensions'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An optional column name can be given by the user to set the name of the multimedia column, which will be additionally created to store these files based on the OS.bee [[BlobMapping]] data type. If not defined, the media column name will consist of the actual column name followed with the suffix '''media'''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only columns containing text data can be defined as media data column by the user. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata1.png|thumb|600px|none|''Figure 15: Media data on column &amp;quot;bsin&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The column ''bsin'' of the entity Brand contains media file name. Besides being provided with the Brand.csv file, we also have the corresponding jpg-files illustrated here in figure 16.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata2.png|thumb|600px|none|''Figure 16: Media file location'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After opening the settings dialog of the column ''bsin'', (1) the user needs first to select the media data checkbox, which allows the modification of the information needed. (2) The user sets the path directory with the help of directory chooser, which appears after pressing the Path button and then selects the directory, in which the files are located. (3) The mime type and extension of the files have to be chosen within the corresponding combo boxes. (4) After pressing the OK button, the user sets the column ''bsin'' as a multimedia column. This will then result into the creation of both attributes ''bsin'' and ''bsinmedia'' of the entity Brand later on, as shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata3.png|thumb|600px|none|''Figure 17: Blobmapping attribute in entity Brand'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==General Notice==&lt;br /&gt;
As soon as the user press the button &amp;quot;Create App&amp;quot;, an error message will eventually be displayed to inform the user to complete or adapt the metadata configuration of the considered csv file.&lt;br /&gt;
* '''Please note that a proper configuration of column definitions has to be done by the user as soon as id, reference or domain keys candidates have been detected.''' Candidates are columns of a csv file, which meet the criteria for either an id, a reference (both from alphanumerical string with UUID format as described above) or a domain key column. Setting the metadata of those columns is then '''mandatory'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''A universal unique identifier (UUID) will be automatically generated by the OS.bee Software Factory for an entity only in the case, in which no id-column candidates are available in a csv file.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Please note that all configurations made by the user in one csv file are immediately lost, as soon as the user close the file from the CSV2App module editor or by restarting the eclipse IDE.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further information over the usage of metadata such as '''id''', '''reference''' and '''domain key''' can be found in the [[Entity DSL]] documentation page.&lt;br /&gt;
&lt;br /&gt;
==Sorting options==&lt;br /&gt;
The sorting section allows you to sort the csv data within the editor. The selected column data can be sorted either in an ascending or a descending order.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting.png|frame|none|''Figure 18: Sorting options'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following examples show you how to use the sort functions by applying it on the column ''brandNm'' of the provided [[#files|Brand.csv]] file. After you opened it in the CSV2App module editor within your eclipse workspace (for example via drag-n-drop), (1) make a left-mouse click on the column ''brandNm'', (2) choose either the ascending (figure 19) or the descending (figure 20) option in the sorting section, (3) and then press the OK button to trigger to the sorting of the column data. (4) You can observe the resulting sorted column data on the right side of both figures below.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
► '''Example 1''':&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting1.png|thumb|600px|none|''Figure 19: Ascending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
► '''Example 2''':&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting2.png|thumb|600px|none|''Figure 20: Descending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copyright Notice ==&lt;br /&gt;
{{Copyright Notice}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== License information ==&lt;br /&gt;
&lt;br /&gt;
{{License information}}&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2992</id>
		<title>AppUpIn5Extensions</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2992"/>
				<updated>2018-01-23T09:10:29Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: /* AppUpIn5 - Extensions 1.0 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Purpose==&lt;br /&gt;
&lt;br /&gt;
The purpose of this document is to describe the first set of functional extensions of the CSV2App module presented in the [[App up in 5 minutes]] page, which will be available with the next release version.&lt;br /&gt;
&lt;br /&gt;
=== OSBP applications===&lt;br /&gt;
&lt;br /&gt;
The OSBP application '''My1App''' should already have been generated before starting this app.  &lt;br /&gt;
You can find the instructions [http://download.osbee.org/documentation/index.php/My_first_app here].&lt;br /&gt;
&lt;br /&gt;
=== CSV-file ===&lt;br /&gt;
&lt;br /&gt;
You may use the two following files as reference files [http://download.osbee.org/downloads/samples/documentation/BrandType.csv BrandType.csv] and [http://download.osbee.org/downloads/samples/documentation/Brand.csv Brand.csv]&amp;lt;span id=&amp;quot;files&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''AppUpIn5 - Extensions 1.0'' ==&lt;br /&gt;
&lt;br /&gt;
You get access to those new functionalities by opening a csv file with the CSV2App module editor of the OS.bee Software Factory, and by making a left mouse click on the column you wish to edit the metadata from.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Brandtype.png|none|frame|''Figure 1: Brandtype.csv im CSV2 Editor'']]&lt;br /&gt;
&lt;br /&gt;
The settings dialog of the corresponding column will then appear. The several options provided in this dialog are organized in two parts: the meta data section and the sorting section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Settingdialog.png|frame|none|''Figure 2: Settings dialog of column &amp;quot;id&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
The sorting options are always available to the user, whereas the meta data options are only available based on the analysis of the type of data contained in the selected column.&lt;br /&gt;
&lt;br /&gt;
==Metadata options==&lt;br /&gt;
The metadata section allows users to set additional information related to the entity that will be created, based on the content of a csv file and existing dsl model files.&lt;br /&gt;
&lt;br /&gt;
===Id===&lt;br /&gt;
With the option ''ID'' you are able to define the column representing the unique identifier data of an entity. An entity has always one identification key, also known as primary key, which is here a ''Universal Unique Identifier'' (UUID), a unique alphanumerical string. Only columns having this type of data can be defined by the user as ''ID''-columns.&lt;br /&gt;
&lt;br /&gt;
With a left mouse click on the column named ''id'' of the csv file ''BrandType.csv'', the user opens the settings dialog of this column.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:SettingsID.png|frame|none|''Figure 3: Settings dialog column &amp;quot;id&amp;quot; of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the ''ID'' checkbox, (2) and then pressing the OK button, the user set the column ''id'' as the ''ID''-column of the entity created later on, like shown on the figure below. Each entity has always one UUID attribute, therefore each csv file must have one ''ID''-column. The generated code later on will look like this snippet on figure 4.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Brandtypeid.png|frame|none|''Figure 4: Entity dsl model - &amp;quot;id&amp;quot; attribute of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
===Reference===&lt;br /&gt;
With the reference option you are able to set column data as reference data (or foreign key) pointing to the ''Universal Unique Identifier'' (primary key) of another '''already existing entity'''. These data are also alphanumerical values, as mentioned in the section above concerning the id-option. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefArea.png|frame|none|''Figure 5: Reference area.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A reference column results into the creation of a 1-n relation between the new entity, which will be created on the basis of the considered csv file and the referenced entity, which already exists in the entity model file of your project. The condition of having this target entity to be referenced on already existing in the model translates into a specific '''order of execution''' of the application creation:  successively pressing the button ''Create App'' in the right order to be able to choose the target entity.&lt;br /&gt;
&lt;br /&gt;
For instance, we would like to create a reference between the entity ''Brandtype'' and the new entity to be created ''Brand'', whose csv file contains the ''brandTypeId'' as column. As you can see on the left side of figure 6, showing the content of the entity dsl model file, the entity ''Brandtype'' has already been created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefEntityBrand.png|thumb|600px|none|''Figure 6: Entity model file and Brand.csv file.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the reference checkbox, (2) selecting ''Brandtype'' in the list of all existing entities, (3) and then by pressing the OK button, the user set the column ''brandTypeId'' as a reference key pointing to the UUID of the entity ''Brandtype''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefBrandtypeId.png|thumb|600px|none|''Figure 7: Settings dialog column &amp;quot;brandTypeId&amp;quot; of Brand'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The result of this relation at the end of the app creation would then look like this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefBrandtypeId1.png|thumb|600px|none|''Figure 8: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The optional tag &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; allows, when selected, the deletion of all elements of the n-side of the relation, when the one-side element is deleted. In our example, the removal of one brand type would then result to the deletion of all the brands categorized by that type. The generated relation would then look like this in contrast to last example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefBrandtypeId2.png|thumb|600px|none|''Figure 9: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Besides the fact that here 1-n relations are created between entities, a reference attribute will also be generated in each entity. This is needed in order to show the information data of each relation graphically (here as table) in the application interface. This is characterized by the use of a &amp;lt;code&amp;gt;properties{...}&amp;lt;/code&amp;gt; block.&lt;br /&gt;
&lt;br /&gt;
===Domain key===&lt;br /&gt;
The domain key option allows the user to set a user friendly identification search field for the application instead of UUIDs, since those are too cryptic for users to clearly distinguish data from each other. &lt;br /&gt;
&lt;br /&gt;
Only column data from type string allow the user to define a column as the domain key column.&lt;br /&gt;
&lt;br /&gt;
In the case of the entity ''Brandtype'', an adequate candidate for the domain key is the column ''brandTypeNm'' containing the names of brand types, which are easy for users to read and identify data from in the application later on.&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the domain key checkbox, (2) and then pressing the OK button, the user define the column ''brandTypeNm'' as the domain key column of the entity Brandtype.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Brandtypenm.png|frame|none|''Figure 10:  Settings dialog column &amp;quot;brandTypeNm&amp;quot; of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This results into the creation of the domain key attribute of the entity ''Brandtype'' as shown on the figure below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:BrandtypenmEntity.png|frame|none|''Figure 11: Domain key in entity dsl model'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Media data===&lt;br /&gt;
The media data option allows the user to define a column as a multimedia column. It allows user to specify from which columns information can be gathered from, in order to create the appropiate structures to store and upload any type of files in your application. This type of column contains the filenames of the multimedia files without extension. In addition to both the mime type and the extension, the user has also to define the directory path, where those files are located.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata.png|thumb|600px|none|''Figure 12: Media data section'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The currently supported mime types are the following: plain, jpg, mpeg, octetstream and pdf. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata4.png|thumb|600px|none|''Figure 13: Mimetypes'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The user can not just select one of the predefined extension formats (bmp, csv, jpg, mp3, pdf, txt, xml), but also edit an extension format on his own (java or sql...).&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata5.png|thumb|600px|none|''Figure 14: Extensions'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An optional column name can be given by the user to set the name of the multimedia column, which will be additionally created to store these files based on the OS.bee [[BlobMapping]] data type. If not defined, the media column name will consist of the actual column name followed with the suffix '''media'''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only columns containing text data can be defined as media data column by the user. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata1.png|thumb|600px|none|''Figure 15: Media data on column &amp;quot;bsin&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The column ''bsin'' of the entity Brand contains media file name. Besides being provided with the Brand.csv file, we also have the corresponding jpg-files illustrated here in figure 16.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata2.png|thumb|600px|none|''Figure 16: Media file location'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After opening the settings dialog of the column ''bsin'', (1) the user needs first to select the media data checkbox, which allows the modification of the information needed. (2) The user sets the path directory with the help of directory chooser, which appears after pressing the Path button and then selects the directory, in which the files are located. (3) The mime type and extension of the files have to be chosen within the corresponding combo boxes. (4) After pressing the OK button, the user sets the column ''bsin'' as a multimedia column. This will then result into the creation of both attributes ''bsin'' and ''bsinmedia'' of the entity Brand later on, as shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata3.png|thumb|600px|none|''Figure 17: Blobmapping attribute in entity Brand'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==General Notice==&lt;br /&gt;
As soon as the user press the button &amp;quot;Create App&amp;quot;, an error message will eventually be displayed to inform the user to complete or adapt the metadata configuration of the considered csv file.&lt;br /&gt;
* '''Please note that a proper configuration of column definitions has to be done by the user as soon as id, reference or domain keys candidates have been detected.''' Candidates are columns of a csv file, which meet the criteria for either an id, a reference (both from alphanumerical string with UUID format as described above) or a domain key column. Setting the metadata of those columns is then '''mandatory'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''A universal unique identifier (UUID) will be automatically generated by the OS.bee Software Factory for an entity only in the case, in which no id-column candidates are available in a csv file.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Please note that all configurations made by the user in one csv file are immediately lost, as soon as the user close the file from the CSV2App module editor or by restarting the eclipse IDE.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further information over the usage of metadata such as '''id''', '''reference''' and '''domain key''' can be found in the [[Entity DSL]] documentation page.&lt;br /&gt;
&lt;br /&gt;
==Sorting options==&lt;br /&gt;
The sorting section allows you to sort the csv data within the editor. The selected column data can be sorted either in an ascending or a descending order.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting.png|frame|none|''Figure 18: Sorting options'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following examples show you how to use the sort functions by applying it on the column ''brandNm'' of the provided [[#files|Brand.csv]] file. After you opened it in the CSV2App module editor within your eclipse workspace (for example via drag-n-drop), (1) make a left-mouse click on the column ''brandNm'', (2) choose either the ascending (figure 19) or the descending (figure 20) option in the sorting section, (3) and then press the OK button to trigger to the sorting of the column data. (4) You can observe the resulting sorted column data on the right side of both figures below.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
► '''Example 1''':&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting1.png|thumb|600px|none|''Figure 19: Ascending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
► '''Example 2''':&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting2.png|thumb|600px|none|''Figure 20: Descending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copyright Notice ==&lt;br /&gt;
{{Copyright Notice}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== License information ==&lt;br /&gt;
&lt;br /&gt;
{{License information}}&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Brandtypeid.png&amp;diff=2991</id>
		<title>File:Brandtypeid.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Brandtypeid.png&amp;diff=2991"/>
				<updated>2018-01-23T08:51:41Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2990</id>
		<title>AppUpIn5Extensions</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2990"/>
				<updated>2018-01-23T08:51:23Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: /* Id */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Purpose==&lt;br /&gt;
&lt;br /&gt;
The purpose of this document is to describe the first set of functional extensions of the CSV2App module presented in the [[App up in 5 minutes]] page, which will be available with the next release version.&lt;br /&gt;
&lt;br /&gt;
=== OSBP applications===&lt;br /&gt;
&lt;br /&gt;
The OSBP application '''My1App''' should already have been generated before starting this app.  &lt;br /&gt;
You can find the instructions [http://download.osbee.org/documentation/index.php/My_first_app here].&lt;br /&gt;
&lt;br /&gt;
=== CSV-file ===&lt;br /&gt;
&lt;br /&gt;
You may use the two following files as reference files [http://download.osbee.org/downloads/samples/documentation/BrandType.csv BrandType.csv] and [http://download.osbee.org/downloads/samples/documentation/Brand.csv Brand.csv]&amp;lt;span id=&amp;quot;files&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''AppUpIn5 - Extensions 1.0'' ==&lt;br /&gt;
&lt;br /&gt;
You get access to those new functionalities by opening a csv file with the CSV2App module editor of the OS.bee Software Factory, and by making a left mouse click on the column you wish to edit the metadata from.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Brandtype.png|none|frame|''Figure 1: Brandtype.csv im CSV2 Editor'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The setting dialog of the corresponding column will appear and several options will be available for you to choose, based on the analysis of the type of data contained in this column and the configurations you would have made so far.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Settingdialog.png|frame|none|''Figure 2: Settings dialog of column &amp;quot;id&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
==Metadata options==&lt;br /&gt;
The metadata section allows users to set additional information related to the entity that will be created, based on the content of a csv file and existing dsl model files.&lt;br /&gt;
&lt;br /&gt;
===Id===&lt;br /&gt;
With the option ''ID'' you are able to define the column representing the unique identifier data of an entity. An entity has always one identification key, also known as primary key, which is here a ''Universal Unique Identifier'' (UUID), a unique alphanumerical string. Only columns having this type of data can be defined by the user as ''ID''-columns.&lt;br /&gt;
&lt;br /&gt;
With a left mouse click on the column named ''id'' of the csv file ''BrandType.csv'', the user opens the settings dialog of this column.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:SettingsID.png|frame|none|''Figure 3: Settings dialog column &amp;quot;id&amp;quot; of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the ''ID'' checkbox, (2) and then pressing the OK button, the user set the column ''id'' as the ''ID''-column of the entity created later on, like shown on the figure below. Each entity has always one UUID attribute, therefore each csv file must have one ''ID''-column. The generated code later on will look like this snippet on figure 4.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Brandtypeid.png|frame|none|''Figure 4: Entity dsl model - &amp;quot;id&amp;quot; attribute of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
===Reference===&lt;br /&gt;
With the reference option you are able to set column data as reference data (or foreign key) pointing to the ''Universal Unique Identifier'' (primary key) of another '''already existing entity'''. These data are also alphanumerical values, as mentioned in the section above concerning the id-option. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefArea.png|frame|none|''Figure 5: Reference area.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A reference column results into the creation of a 1-n relation between the new entity, which will be created on the basis of the considered csv file and the referenced entity, which already exists in the entity model file of your project. The condition of having this target entity to be referenced on already existing in the model translates into a specific '''order of execution''' of the application creation:  successively pressing the button ''Create App'' in the right order to be able to choose the target entity.&lt;br /&gt;
&lt;br /&gt;
For instance, we would like to create a reference between the entity ''Brandtype'' and the new entity to be created ''Brand'', whose csv file contains the ''brandTypeId'' as column. As you can see on the left side of figure 6, showing the content of the entity dsl model file, the entity ''Brandtype'' has already been created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefEntityBrand.png|thumb|600px|none|''Figure 6: Entity model file and Brand.csv file.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the reference checkbox, (2) selecting ''Brandtype'' in the list of all existing entities, (3) and then by pressing the OK button, the user set the column ''brandTypeId'' as a reference key pointing to the UUID of the entity ''Brandtype''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefBrandtypeId.png|thumb|600px|none|''Figure 7: Settings dialog column &amp;quot;brandTypeId&amp;quot; of Brand'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The result of this relation at the end of the app creation would then look like this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefBrandtypeId1.png|thumb|600px|none|''Figure 8: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The optional tag &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; allows, when selected, the deletion of all elements of the n-side of the relation, when the one-side element is deleted. In our example, the removal of one brand type would then result to the deletion of all the brands categorized by that type. The generated relation would then look like this in contrast to last example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefBrandtypeId2.png|thumb|600px|none|''Figure 9: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Besides the fact that here 1-n relations are created between entities, a reference attribute will also be generated in each entity. This is needed in order to show the information data of each relation graphically (here as table) in the application interface. This is characterized by the use of a &amp;lt;code&amp;gt;properties{...}&amp;lt;/code&amp;gt; block.&lt;br /&gt;
&lt;br /&gt;
===Domain key===&lt;br /&gt;
The domain key option allows the user to set a user friendly identification search field for the application instead of UUIDs, since those are too cryptic for users to clearly distinguish data from each other. &lt;br /&gt;
&lt;br /&gt;
Only column data from type string allow the user to define a column as the domain key column.&lt;br /&gt;
&lt;br /&gt;
In the case of the entity ''Brandtype'', an adequate candidate for the domain key is the column ''brandTypeNm'' containing the names of brand types, which are easy for users to read and identify data from in the application later on.&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the domain key checkbox, (2) and then pressing the OK button, the user define the column ''brandTypeNm'' as the domain key column of the entity Brandtype.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Brandtypenm.png|frame|none|''Figure 10:  Settings dialog column &amp;quot;brandTypeNm&amp;quot; of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This results into the creation of the domain key attribute of the entity ''Brandtype'' as shown on the figure below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:BrandtypenmEntity.png|frame|none|''Figure 11: Domain key in entity dsl model'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Media data===&lt;br /&gt;
The media data option allows the user to define a column as a multimedia column. It allows user to specify from which columns information can be gathered from, in order to create the appropiate structures to store and upload any type of files in your application. This type of column contains the filenames of the multimedia files without extension. In addition to both the mime type and the extension, the user has also to define the directory path, where those files are located.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata.png|thumb|600px|none|''Figure 12: Media data section'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The currently supported mime types are the following: plain, jpg, mpeg, octetstream and pdf. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata4.png|thumb|600px|none|''Figure 13: Mimetypes'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The user can not just select one of the predefined extension formats (bmp, csv, jpg, mp3, pdf, txt, xml), but also edit an extension format on his own (java or sql...).&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata5.png|thumb|600px|none|''Figure 14: Extensions'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An optional column name can be given by the user to set the name of the multimedia column, which will be additionally created to store these files based on the OS.bee [[BlobMapping]] data type. If not defined, the media column name will consist of the actual column name followed with the suffix '''media'''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only columns containing text data can be defined as media data column by the user. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata1.png|thumb|600px|none|''Figure 15: Media data on column &amp;quot;bsin&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The column ''bsin'' of the entity Brand contains media file name. Besides being provided with the Brand.csv file, we also have the corresponding jpg-files illustrated here in figure 16.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata2.png|thumb|600px|none|''Figure 16: Media file location'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After opening the settings dialog of the column ''bsin'', (1) the user needs first to select the media data checkbox, which allows the modification of the information needed. (2) The user sets the path directory with the help of directory chooser, which appears after pressing the Path button and then selects the directory, in which the files are located. (3) The mime type and extension of the files have to be chosen within the corresponding combo boxes. (4) After pressing the OK button, the user sets the column ''bsin'' as a multimedia column. This will then result into the creation of both attributes ''bsin'' and ''bsinmedia'' of the entity Brand later on, as shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata3.png|thumb|600px|none|''Figure 17: Blobmapping attribute in entity Brand'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==General Notice==&lt;br /&gt;
As soon as the user press the button &amp;quot;Create App&amp;quot;, an error message will eventually be displayed to inform the user to complete or adapt the metadata configuration of the considered csv file.&lt;br /&gt;
* '''Please note that a proper configuration of column definitions has to be done by the user as soon as id, reference or domain keys candidates have been detected.''' Candidates are columns of a csv file, which meet the criteria for either an id, a reference (both from alphanumerical string with UUID format as described above) or a domain key column. Setting the metadata of those columns is then '''mandatory'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''A universal unique identifier (UUID) will be automatically generated by the OS.bee Software Factory for an entity only in the case, in which no id-column candidates are available in a csv file.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Please note that all configurations made by the user in one csv file are immediately lost, as soon as the user close the file from the CSV2App module editor or by restarting the eclipse IDE.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further information over the usage of metadata such as '''id''', '''reference''' and '''domain key''' can be found in the [[Entity DSL]] documentation page.&lt;br /&gt;
&lt;br /&gt;
==Sorting options==&lt;br /&gt;
The sorting section allows you to sort the csv data within the editor. The selected column data can be sorted either in an ascending or a descending order.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting.png|frame|none|''Figure 18: Sorting options'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following examples show you how to use the sort functions by applying it on the column ''brandNm'' of the provided [[#files|Brand.csv]] file. After you opened it in the CSV2App module editor within your eclipse workspace (for example via drag-n-drop), (1) make a left-mouse click on the column ''brandNm'', (2) choose either the ascending (figure 19) or the descending (figure 20) option in the sorting section, (3) and then press the OK button to trigger to the sorting of the column data. (4) You can observe the resulting sorted column data on the right side of both figures below.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
► '''Example 1''':&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting1.png|thumb|600px|none|''Figure 19: Ascending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
► '''Example 2''':&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting2.png|thumb|600px|none|''Figure 20: Descending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copyright Notice ==&lt;br /&gt;
{{Copyright Notice}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== License information ==&lt;br /&gt;
&lt;br /&gt;
{{License information}}&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Settingdialog.png&amp;diff=2989</id>
		<title>File:Settingdialog.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Settingdialog.png&amp;diff=2989"/>
				<updated>2018-01-23T08:49:40Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2988</id>
		<title>AppUpIn5Extensions</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2988"/>
				<updated>2018-01-23T08:49:20Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: /* AppUpIn5 - Extensions 1.0 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Purpose==&lt;br /&gt;
&lt;br /&gt;
The purpose of this document is to describe the first set of functional extensions of the CSV2App module presented in the [[App up in 5 minutes]] page, which will be available with the next release version.&lt;br /&gt;
&lt;br /&gt;
=== OSBP applications===&lt;br /&gt;
&lt;br /&gt;
The OSBP application '''My1App''' should already have been generated before starting this app.  &lt;br /&gt;
You can find the instructions [http://download.osbee.org/documentation/index.php/My_first_app here].&lt;br /&gt;
&lt;br /&gt;
=== CSV-file ===&lt;br /&gt;
&lt;br /&gt;
You may use the two following files as reference files [http://download.osbee.org/downloads/samples/documentation/BrandType.csv BrandType.csv] and [http://download.osbee.org/downloads/samples/documentation/Brand.csv Brand.csv]&amp;lt;span id=&amp;quot;files&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''AppUpIn5 - Extensions 1.0'' ==&lt;br /&gt;
&lt;br /&gt;
You get access to those new functionalities by opening a csv file with the CSV2App module editor of the OS.bee Software Factory, and by making a left mouse click on the column you wish to edit the metadata from.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Brandtype.png|none|frame|''Figure 1: Brandtype.csv im CSV2 Editor'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The setting dialog of the corresponding column will appear and several options will be available for you to choose, based on the analysis of the type of data contained in this column and the configurations you would have made so far.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Settingdialog.png|frame|none|''Figure 2: Settings dialog of column &amp;quot;id&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
==Metadata options==&lt;br /&gt;
The metadata section allows users to set additional information related to the entity that will be created, based on the content of a csv file and existing dsl model files.&lt;br /&gt;
&lt;br /&gt;
===Id===&lt;br /&gt;
With the option ''ID'' you are able to define the column representing the unique identifier data of an entity. An entity has always one identification key, also known as primary key, which is here a ''Universal Unique Identifier'' (UUID), a unique alphanumerical string. Only columns having this type of data can be defined by the user as ''ID''-columns.&lt;br /&gt;
&lt;br /&gt;
With a left mouse click on the column named ''id'' of the csv file ''BrandType.csv'', the user opens the settings dialog of this column.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:SettingsID.png|frame|none|''Figure 3: Settings dialog column &amp;quot;id&amp;quot; of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the ''ID'' checkbox, (2) and then pressing the OK button, the user set the column ''id'' as the ''ID''-column of the entity created later on, like shown on the figure below. Each entity has always one UUID attribute, therefore each csv file must have one ''ID''-column. The generated code later on will look like this snippet on figure 4.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:ID.png|frame|none|''Figure 4: Entity dsl model - &amp;quot;id&amp;quot; attribute of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Reference===&lt;br /&gt;
With the reference option you are able to set column data as reference data (or foreign key) pointing to the ''Universal Unique Identifier'' (primary key) of another '''already existing entity'''. These data are also alphanumerical values, as mentioned in the section above concerning the id-option. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefArea.png|frame|none|''Figure 5: Reference area.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A reference column results into the creation of a 1-n relation between the new entity, which will be created on the basis of the considered csv file and the referenced entity, which already exists in the entity model file of your project. The condition of having this target entity to be referenced on already existing in the model translates into a specific '''order of execution''' of the application creation:  successively pressing the button ''Create App'' in the right order to be able to choose the target entity.&lt;br /&gt;
&lt;br /&gt;
For instance, we would like to create a reference between the entity ''Brandtype'' and the new entity to be created ''Brand'', whose csv file contains the ''brandTypeId'' as column. As you can see on the left side of figure 6, showing the content of the entity dsl model file, the entity ''Brandtype'' has already been created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefEntityBrand.png|thumb|600px|none|''Figure 6: Entity model file and Brand.csv file.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the reference checkbox, (2) selecting ''Brandtype'' in the list of all existing entities, (3) and then by pressing the OK button, the user set the column ''brandTypeId'' as a reference key pointing to the UUID of the entity ''Brandtype''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefBrandtypeId.png|thumb|600px|none|''Figure 7: Settings dialog column &amp;quot;brandTypeId&amp;quot; of Brand'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The result of this relation at the end of the app creation would then look like this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefBrandtypeId1.png|thumb|600px|none|''Figure 8: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The optional tag &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; allows, when selected, the deletion of all elements of the n-side of the relation, when the one-side element is deleted. In our example, the removal of one brand type would then result to the deletion of all the brands categorized by that type. The generated relation would then look like this in contrast to last example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefBrandtypeId2.png|thumb|600px|none|''Figure 9: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Besides the fact that here 1-n relations are created between entities, a reference attribute will also be generated in each entity. This is needed in order to show the information data of each relation graphically (here as table) in the application interface. This is characterized by the use of a &amp;lt;code&amp;gt;properties{...}&amp;lt;/code&amp;gt; block.&lt;br /&gt;
&lt;br /&gt;
===Domain key===&lt;br /&gt;
The domain key option allows the user to set a user friendly identification search field for the application instead of UUIDs, since those are too cryptic for users to clearly distinguish data from each other. &lt;br /&gt;
&lt;br /&gt;
Only column data from type string allow the user to define a column as the domain key column.&lt;br /&gt;
&lt;br /&gt;
In the case of the entity ''Brandtype'', an adequate candidate for the domain key is the column ''brandTypeNm'' containing the names of brand types, which are easy for users to read and identify data from in the application later on.&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the domain key checkbox, (2) and then pressing the OK button, the user define the column ''brandTypeNm'' as the domain key column of the entity Brandtype.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Brandtypenm.png|frame|none|''Figure 10:  Settings dialog column &amp;quot;brandTypeNm&amp;quot; of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This results into the creation of the domain key attribute of the entity ''Brandtype'' as shown on the figure below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:BrandtypenmEntity.png|frame|none|''Figure 11: Domain key in entity dsl model'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Media data===&lt;br /&gt;
The media data option allows the user to define a column as a multimedia column. It allows user to specify from which columns information can be gathered from, in order to create the appropiate structures to store and upload any type of files in your application. This type of column contains the filenames of the multimedia files without extension. In addition to both the mime type and the extension, the user has also to define the directory path, where those files are located.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata.png|thumb|600px|none|''Figure 12: Media data section'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The currently supported mime types are the following: plain, jpg, mpeg, octetstream and pdf. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata4.png|thumb|600px|none|''Figure 13: Mimetypes'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The user can not just select one of the predefined extension formats (bmp, csv, jpg, mp3, pdf, txt, xml), but also edit an extension format on his own (java or sql...).&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata5.png|thumb|600px|none|''Figure 14: Extensions'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An optional column name can be given by the user to set the name of the multimedia column, which will be additionally created to store these files based on the OS.bee [[BlobMapping]] data type. If not defined, the media column name will consist of the actual column name followed with the suffix '''media'''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only columns containing text data can be defined as media data column by the user. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata1.png|thumb|600px|none|''Figure 15: Media data on column &amp;quot;bsin&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The column ''bsin'' of the entity Brand contains media file name. Besides being provided with the Brand.csv file, we also have the corresponding jpg-files illustrated here in figure 16.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata2.png|thumb|600px|none|''Figure 16: Media file location'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After opening the settings dialog of the column ''bsin'', (1) the user needs first to select the media data checkbox, which allows the modification of the information needed. (2) The user sets the path directory with the help of directory chooser, which appears after pressing the Path button and then selects the directory, in which the files are located. (3) The mime type and extension of the files have to be chosen within the corresponding combo boxes. (4) After pressing the OK button, the user sets the column ''bsin'' as a multimedia column. This will then result into the creation of both attributes ''bsin'' and ''bsinmedia'' of the entity Brand later on, as shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata3.png|thumb|600px|none|''Figure 17: Blobmapping attribute in entity Brand'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==General Notice==&lt;br /&gt;
As soon as the user press the button &amp;quot;Create App&amp;quot;, an error message will eventually be displayed to inform the user to complete or adapt the metadata configuration of the considered csv file.&lt;br /&gt;
* '''Please note that a proper configuration of column definitions has to be done by the user as soon as id, reference or domain keys candidates have been detected.''' Candidates are columns of a csv file, which meet the criteria for either an id, a reference (both from alphanumerical string with UUID format as described above) or a domain key column. Setting the metadata of those columns is then '''mandatory'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''A universal unique identifier (UUID) will be automatically generated by the OS.bee Software Factory for an entity only in the case, in which no id-column candidates are available in a csv file.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Please note that all configurations made by the user in one csv file are immediately lost, as soon as the user close the file from the CSV2App module editor or by restarting the eclipse IDE.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further information over the usage of metadata such as '''id''', '''reference''' and '''domain key''' can be found in the [[Entity DSL]] documentation page.&lt;br /&gt;
&lt;br /&gt;
==Sorting options==&lt;br /&gt;
The sorting section allows you to sort the csv data within the editor. The selected column data can be sorted either in an ascending or a descending order.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting.png|frame|none|''Figure 18: Sorting options'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following examples show you how to use the sort functions by applying it on the column ''brandNm'' of the provided [[#files|Brand.csv]] file. After you opened it in the CSV2App module editor within your eclipse workspace (for example via drag-n-drop), (1) make a left-mouse click on the column ''brandNm'', (2) choose either the ascending (figure 19) or the descending (figure 20) option in the sorting section, (3) and then press the OK button to trigger to the sorting of the column data. (4) You can observe the resulting sorted column data on the right side of both figures below.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
► '''Example 1''':&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting1.png|thumb|600px|none|''Figure 19: Ascending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
► '''Example 2''':&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting2.png|thumb|600px|none|''Figure 20: Descending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copyright Notice ==&lt;br /&gt;
{{Copyright Notice}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== License information ==&lt;br /&gt;
&lt;br /&gt;
{{License information}}&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Brandtype1.png&amp;diff=2987</id>
		<title>File:Brandtype1.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Brandtype1.png&amp;diff=2987"/>
				<updated>2018-01-23T08:48:06Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: Worayeno uploaded a new version of File:Brandtype1.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:ID.png&amp;diff=2986</id>
		<title>File:ID.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:ID.png&amp;diff=2986"/>
				<updated>2018-01-23T08:43:10Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: Worayeno uploaded a new version of File:ID.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:ID.png&amp;diff=2985</id>
		<title>File:ID.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:ID.png&amp;diff=2985"/>
				<updated>2018-01-23T08:42:48Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: Worayeno uploaded a new version of File:ID.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Brandtype1.png&amp;diff=2984</id>
		<title>File:Brandtype1.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Brandtype1.png&amp;diff=2984"/>
				<updated>2018-01-23T08:41:10Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: Worayeno uploaded a new version of File:Brandtype1.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:ID.png&amp;diff=2983</id>
		<title>File:ID.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:ID.png&amp;diff=2983"/>
				<updated>2018-01-23T08:40:40Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: Worayeno uploaded a new version of File:ID.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Brandtype1.png&amp;diff=2982</id>
		<title>File:Brandtype1.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Brandtype1.png&amp;diff=2982"/>
				<updated>2018-01-23T08:35:14Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: Worayeno uploaded a new version of File:Brandtype1.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Brandtype1.png&amp;diff=2981</id>
		<title>File:Brandtype1.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Brandtype1.png&amp;diff=2981"/>
				<updated>2018-01-23T08:34:17Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: Worayeno uploaded a new version of File:Brandtype1.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Brandtype1.png&amp;diff=2980</id>
		<title>File:Brandtype1.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Brandtype1.png&amp;diff=2980"/>
				<updated>2018-01-23T08:33:43Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: Worayeno uploaded a new version of File:Brandtype1.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Brandtype.png&amp;diff=2979</id>
		<title>File:Brandtype.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Brandtype.png&amp;diff=2979"/>
				<updated>2018-01-23T08:29:50Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: Worayeno uploaded a new version of File:Brandtype.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2978</id>
		<title>AppUpIn5Extensions</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2978"/>
				<updated>2018-01-22T16:51:33Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Purpose==&lt;br /&gt;
&lt;br /&gt;
The purpose of this document is to describe the first set of functional extensions of the CSV2App module presented in the [[App up in 5 minutes]] page, which will be available with the next release version.&lt;br /&gt;
&lt;br /&gt;
=== OSBP applications===&lt;br /&gt;
&lt;br /&gt;
The OSBP application '''My1App''' should already have been generated before starting this app.  &lt;br /&gt;
You can find the instructions [http://download.osbee.org/documentation/index.php/My_first_app here].&lt;br /&gt;
&lt;br /&gt;
=== CSV-file ===&lt;br /&gt;
&lt;br /&gt;
You may use the two following files as reference files [http://download.osbee.org/downloads/samples/documentation/BrandType.csv BrandType.csv] and [http://download.osbee.org/downloads/samples/documentation/Brand.csv Brand.csv]&amp;lt;span id=&amp;quot;files&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''AppUpIn5 - Extensions 1.0'' ==&lt;br /&gt;
&lt;br /&gt;
You get access to those new functionalities by opening a csv file with the CSV2App module editor of the OS.bee Software Factory, and by making a left mouse click on the column you wish to edit the metadata from.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Brandtype.png|none|frame|''Figure 1: Brandtype.csv im CSV2 Editor'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The setting dialog of the corresponding column will appear and several options will be available for you to choose, based on the analysis of the type of data contained in this column and the configurations you would have made so far.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Brandtype1.png|frame|none|''Figure 2: Settings dialog of column &amp;quot;id&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
==Metadata options==&lt;br /&gt;
The metadata section allows users to set additional information related to the entity that will be created, based on the content of a csv file and existing dsl model files.&lt;br /&gt;
&lt;br /&gt;
===Id===&lt;br /&gt;
With the option ''ID'' you are able to define the column representing the unique identifier data of an entity. An entity has always one identification key, also known as primary key, which is here a ''Universal Unique Identifier'' (UUID), a unique alphanumerical string. Only columns having this type of data can be defined by the user as ''ID''-columns.&lt;br /&gt;
&lt;br /&gt;
With a left mouse click on the column named ''id'' of the csv file ''BrandType.csv'', the user opens the settings dialog of this column.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:SettingsID.png|frame|none|''Figure 3: Settings dialog column &amp;quot;id&amp;quot; of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the ''ID'' checkbox, (2) and then pressing the OK button, the user set the column ''id'' as the ''ID''-column of the entity created later on, like shown on the figure below. Each entity has always one UUID attribute, therefore each csv file must have one ''ID''-column. The generated code later on will look like this snippet on figure 4.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:ID.png|frame|none|''Figure 4: Entity dsl model - &amp;quot;id&amp;quot; attribute of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Reference===&lt;br /&gt;
With the reference option you are able to set column data as reference data (or foreign key) pointing to the ''Universal Unique Identifier'' (primary key) of another '''already existing entity'''. These data are also alphanumerical values, as mentioned in the section above concerning the id-option. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefArea.png|frame|none|''Figure 5: Reference area.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A reference column results into the creation of a 1-n relation between the new entity, which will be created on the basis of the considered csv file and the referenced entity, which already exists in the entity model file of your project. The condition of having this target entity to be referenced on already existing in the model translates into a specific '''order of execution''' of the application creation:  successively pressing the button ''Create App'' in the right order to be able to choose the target entity.&lt;br /&gt;
&lt;br /&gt;
For instance, we would like to create a reference between the entity ''Brandtype'' and the new entity to be created ''Brand'', whose csv file contains the ''brandTypeId'' as column. As you can see on the left side of figure 6, showing the content of the entity dsl model file, the entity ''Brandtype'' has already been created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefEntityBrand.png|thumb|600px|none|''Figure 6: Entity model file and Brand.csv file.'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the reference checkbox, (2) selecting ''Brandtype'' in the list of all existing entities, (3) and then by pressing the OK button, the user set the column ''brandTypeId'' as a reference key pointing to the UUID of the entity ''Brandtype''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefBrandtypeId.png|thumb|600px|none|''Figure 7: Settings dialog column &amp;quot;brandTypeId&amp;quot; of Brand'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The result of this relation at the end of the app creation would then look like this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefBrandtypeId1.png|thumb|600px|none|''Figure 8: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The optional tag &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; allows, when selected, the deletion of all elements of the n-side of the relation, when the one-side element is deleted. In our example, the removal of one brand type would then result to the deletion of all the brands categorized by that type. The generated relation would then look like this in contrast to last example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:RefBrandtypeId2.png|thumb|600px|none|''Figure 9: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Besides the fact that here 1-n relations are created between entities, a reference attribute will also be generated in each entity. This is needed in order to show the information data of each relation graphically (here as table) in the application interface. This is characterized by the use of a &amp;lt;code&amp;gt;properties{...}&amp;lt;/code&amp;gt; block.&lt;br /&gt;
&lt;br /&gt;
===Domain key===&lt;br /&gt;
The domain key option allows the user to set a user friendly identification search field for the application instead of UUIDs, since those are too cryptic for users to clearly distinguish data from each other. &lt;br /&gt;
&lt;br /&gt;
Only column data from type string allow the user to define a column as the domain key column.&lt;br /&gt;
&lt;br /&gt;
In the case of the entity ''Brandtype'', an adequate candidate for the domain key is the column ''brandTypeNm'' containing the names of brand types, which are easy for users to read and identify data from in the application later on.&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the domain key checkbox, (2) and then pressing the OK button, the user define the column ''brandTypeNm'' as the domain key column of the entity Brandtype.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Brandtypenm.png|frame|none|''Figure 10:  Settings dialog column &amp;quot;brandTypeNm&amp;quot; of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This results into the creation of the domain key attribute of the entity ''Brandtype'' as shown on the figure below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:BrandtypenmEntity.png|frame|none|''Figure 11: Domain key in entity dsl model'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Media data===&lt;br /&gt;
The media data option allows the user to define a column as a multimedia column. It allows user to specify from which columns information can be gathered from, in order to create the appropiate structures to store and upload any type of files in your application. This type of column contains the filenames of the multimedia files without extension. In addition to both the mime type and the extension, the user has also to define the directory path, where those files are located.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata.png|thumb|600px|none|''Figure 12: Media data section'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The currently supported mime types are the following: plain, jpg, mpeg, octetstream and pdf. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata4.png|thumb|600px|none|''Figure 13: Mimetypes'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The user can not just select one of the predefined extension formats (bmp, csv, jpg, mp3, pdf, txt, xml), but also edit an extension format on his own (java or sql...).&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata5.png|thumb|600px|none|''Figure 14: Extensions'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An optional column name can be given by the user to set the name of the multimedia column, which will be additionally created to store these files based on the OS.bee [[BlobMapping]] data type. If not defined, the media column name will consist of the actual column name followed with the suffix '''media'''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only columns containing text data can be defined as media data column by the user. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata1.png|thumb|600px|none|''Figure 15: Media data on column &amp;quot;bsin&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The column ''bsin'' of the entity Brand contains media file name. Besides being provided with the Brand.csv file, we also have the corresponding jpg-files illustrated here in figure 16.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata2.png|thumb|600px|none|''Figure 16: Media file location'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After opening the settings dialog of the column ''bsin'', (1) the user needs first to select the media data checkbox, which allows the modification of the information needed. (2) The user sets the path directory with the help of directory chooser, which appears after pressing the Path button and then selects the directory, in which the files are located. (3) The mime type and extension of the files have to be chosen within the corresponding combo boxes. (4) After pressing the OK button, the user sets the column ''bsin'' as a multimedia column. This will then result into the creation of both attributes ''bsin'' and ''bsinmedia'' of the entity Brand later on, as shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Mediadata3.png|thumb|600px|none|''Figure 17: Blobmapping attribute in entity Brand'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==General Notice==&lt;br /&gt;
As soon as the user press the button &amp;quot;Create App&amp;quot;, an error message will eventually be displayed to inform the user to complete or adapt the metadata configuration of the considered csv file.&lt;br /&gt;
* '''Please note that a proper configuration of column definitions has to be done by the user as soon as id, reference or domain keys candidates have been detected.''' Candidates are columns of a csv file, which meet the criteria for either an id, a reference (both from alphanumerical string with UUID format as described above) or a domain key column. Setting the metadata of those columns is then '''mandatory'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''A universal unique identifier (UUID) will be automatically generated by the OS.bee Software Factory for an entity only in the case, in which no id-column candidates are available in a csv file.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Please note that all configurations made by the user in one csv file are immediately lost, as soon as the user close the file from the CSV2App module editor or by restarting the eclipse IDE.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further information over the usage of metadata such as '''id''', '''reference''' and '''domain key''' can be found in the [[Entity DSL]] documentation page.&lt;br /&gt;
&lt;br /&gt;
==Sorting options==&lt;br /&gt;
The sorting section allows you to sort the csv data within the editor. The selected column data can be sorted either in an ascending or a descending order.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting.png|frame|none|''Figure 18: Sorting options'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following examples show you how to use the sort functions by applying it on the column ''brandNm'' of the provided [[#files|Brand.csv]] file. After you opened it in the CSV2App module editor within your eclipse workspace (for example via drag-n-drop), (1) make a left-mouse click on the column ''brandNm'', (2) choose either the ascending (figure 19) or the descending (figure 20) option in the sorting section, (3) and then press the OK button to trigger to the sorting of the column data. (4) You can observe the resulting sorted column data on the right side of both figures below.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
► '''Example 1''':&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting1.png|thumb|600px|none|''Figure 19: Ascending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
► '''Example 2''':&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Sorting2.png|thumb|600px|none|''Figure 20: Descending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copyright Notice ==&lt;br /&gt;
{{Copyright Notice}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== License information ==&lt;br /&gt;
&lt;br /&gt;
{{License information}}&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2977</id>
		<title>AppUpIn5Extensions</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2977"/>
				<updated>2018-01-22T16:22:25Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: /* AppUpIn5 - Extensions 1.0 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Purpose==&lt;br /&gt;
&lt;br /&gt;
The purpose of this document is to describe the first set of functional extensions of the CSV2App module presented in the [[App up in 5 minutes]] page, which will be available with the next release version.&lt;br /&gt;
&lt;br /&gt;
=== OSBP applications===&lt;br /&gt;
&lt;br /&gt;
The OSBP application '''My1App''' should already have been generated before starting this app.  &lt;br /&gt;
You can find the instructions [http://download.osbee.org/documentation/index.php/My_first_app here].&lt;br /&gt;
&lt;br /&gt;
=== CSV-file ===&lt;br /&gt;
&lt;br /&gt;
You may use the two following files as reference files [http://download.osbee.org/downloads/samples/documentation/BrandType.csv BrandType.csv] and [http://download.osbee.org/downloads/samples/documentation/Brand.csv Brand.csv]&amp;lt;span id=&amp;quot;files&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''AppUpIn5 - Extensions 1.0'' ==&lt;br /&gt;
&lt;br /&gt;
You get access to those new functionalities by opening a csv file with the CSV2App module editor of the OS.bee Software Factory, and by making a left mouse click on the column you wish to edit the metadata from.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Brandtype.png|left|frame|''Figure 1: Brandtype.csv im CSV2 Editor'']]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The setting dialog of the corresponding column will appear and several options will be available for you to choose, based on the analysis of the type of data contained in this column and the configurations you would have made so far.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;[[File:Brandtype1.png|frame|left|''Figure 2: Settings dialog of column &amp;quot;id&amp;quot;'']]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Metadata options==&lt;br /&gt;
The metadata section allows users to set additional information related to the entity that will be created, based on the content of a csv file and existing dsl model files.&lt;br /&gt;
&lt;br /&gt;
===Id===&lt;br /&gt;
With the option ''ID'' you are able to define the column representing the unique identifier data of an entity. An entity has always one identification key, also known as primary key, which is here a ''Universal Unique Identifier'' (UUID), a unique alphanumerical string. Only columns having this type of data can be defined by the user as ''ID''-columns.&lt;br /&gt;
&lt;br /&gt;
With a left mouse click on the column named ''id'' of the csv file ''BrandType.csv'', the user opens the settings dialog of this column.&lt;br /&gt;
&lt;br /&gt;
[[File:SettingsID.png|frame|center|''Figure 3: Settings dialog column &amp;quot;id&amp;quot; of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the ''ID'' checkbox, (2) and then pressing the OK button, the user set the column ''id'' as the ''ID''-column of the entity created later on, like shown on the figure below. Each entity has always one UUID attribute, therefore each csv file must have one ''ID''-column. The generated code later on will look like this snippet on figure 4.&lt;br /&gt;
&lt;br /&gt;
[[File:ID.png|frame|center|''Figure 4: Entity dsl model - &amp;quot;id&amp;quot; attribute of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
===Reference===&lt;br /&gt;
With the reference option you are able to set column data as reference data (or foreign key) pointing to the ''Universal Unique Identifier'' (primary key) of another '''already existing entity'''. These data are also alphanumerical values, as mentioned in the section above concerning the id-option. &lt;br /&gt;
&lt;br /&gt;
[[File:RefArea.png|frame|center|''Figure 5: Reference area.'']]&lt;br /&gt;
&lt;br /&gt;
A reference column results into the creation of a 1-n relation between the new entity, which will be created on the basis of the considered csv file and the referenced entity, which already exists in the entity model file of your project. The condition of having this target entity to be referenced on already existing in the model translates into a specific '''order of execution''' of the application creation:  successively pressing the button ''Create App'' in the right order to be able to choose the target entity.&lt;br /&gt;
&lt;br /&gt;
For instance, we would like to create a reference between the entity ''Brandtype'' and the new entity to be created ''Brand'', whose csv file contains the ''brandTypeId'' as column. As you can see on the left side of figure 6, showing the content of the entity dsl model file, the entity ''Brandtype'' has already been created.&lt;br /&gt;
&lt;br /&gt;
[[File:RefEntityBrand.png|thumb|600px|center|''Figure 6: Entity model file and Brand.csv file.'']]&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the reference checkbox, (2) selecting ''Brandtype'' in the list of all existing entities, (3) and then by pressing the OK button, the user set the column ''brandTypeId'' as a reference key pointing to the UUID of the entity ''Brandtype''.&lt;br /&gt;
&lt;br /&gt;
[[File:RefBrandtypeId.png|thumb|600px|center|''Figure 7: Settings dialog column &amp;quot;brandTypeId&amp;quot; of Brand'']]&lt;br /&gt;
&lt;br /&gt;
The result of this relation at the end of the app creation would then look like this.&lt;br /&gt;
&lt;br /&gt;
[[File:RefBrandtypeId1.png|thumb|600px|center|''Figure 8: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The optional tag &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; allows, when selected, the deletion of all elements of the n-side of the relation, when the one-side element is deleted. In our example, the removal of one brand type would then result to the deletion of all the brands categorized by that type. The generated relation would then look like this in contrast to last example.&lt;br /&gt;
&lt;br /&gt;
[[File:RefBrandtypeId2.png|thumb|600px|center|''Figure 9: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Besides the fact that here 1-n relations are created between entities, a reference attribute will also be generated in each entity. This is needed in order to show the information data of each relation graphically (here as table) in the application interface. This is characterized by the use of a &amp;lt;code&amp;gt;properties{...}&amp;lt;/code&amp;gt; block.&lt;br /&gt;
&lt;br /&gt;
===Domain key===&lt;br /&gt;
The domain key option allows the user to set a user friendly identification search field for the application instead of UUIDs, since those are too cryptic for users to clearly distinguish data from each other. &lt;br /&gt;
&lt;br /&gt;
Only column data from type string allow the user to define a column as the domain key column.&lt;br /&gt;
&lt;br /&gt;
In the case of the entity ''Brandtype'', an adequate candidate for the domain key is the column ''brandTypeNm'' containing the names of brand types, which are easy for users to read and identify data from in the application later on.&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the domain key checkbox, (2) and then pressing the OK button, the user define the column ''brandTypeNm'' as the domain key column of the entity Brandtype.&lt;br /&gt;
&lt;br /&gt;
[[File:Brandtypenm.png|frame|center|''Figure 10:  Settings dialog column &amp;quot;brandTypeNm&amp;quot; of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This results into the creation of the domain key attribute of the entity ''Brandtype'' as shown on the figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:BrandtypenmEntity.png|frame|center|''Figure 11: Domain key in entity dsl model'']]&lt;br /&gt;
&lt;br /&gt;
===Media data===&lt;br /&gt;
The media data option allows the user to define a column as a multimedia column. It allows user to specify from which columns information can be gathered from, in order to create the appropiate structures to store and upload any type of files in your application. This type of column contains the filenames of the multimedia files without extension. In addition to both the mime type and the extension, the user has also to define the directory path, where those files are located.&lt;br /&gt;
&lt;br /&gt;
[[File:Mediadata.png|thumb|600px|center|''Figure 12: Media data section'']]&lt;br /&gt;
&lt;br /&gt;
The currently supported mime types are the following: plain, jpg, mpeg, octetstream and pdf. &lt;br /&gt;
[[File:Mediadata4.png|thumb|600px|center|''Figure 13: Mimetypes'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The user can not just select one of the predefined extension formats (bmp, csv, jpg, mp3, pdf, txt, xml), but also edit an extension format on his own (java or sql...).&lt;br /&gt;
[[File:Mediadata5.png|thumb|600px|center|''Figure 14: Extensions'']]&lt;br /&gt;
&lt;br /&gt;
An optional column name can be given by the user to set the name of the multimedia column, which will be additionally created to store these files based on the OS.bee [[BlobMapping]] data type. If not defined, the media column name will consist of the actual column name followed with the suffix '''media'''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only columns containing text data can be defined as media data column by the user. &lt;br /&gt;
&lt;br /&gt;
[[File:Mediadata1.png|thumb|600px|center|''Figure 15: Media data on column &amp;quot;bsin&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
The column ''bsin'' of the entity Brand contains media file name. Besides being provided with the Brand.csv file, we also have the corresponding jpg-files illustrated here in figure 16.&lt;br /&gt;
&lt;br /&gt;
[[File:Mediadata2.png|thumb|600px|center|''Figure 16: Media file location'']]&lt;br /&gt;
&lt;br /&gt;
After opening the settings dialog of the column ''bsin'', (1) the user needs first to select the media data checkbox, which allows the modification of the information needed. (2) The user sets the path directory with the help of directory chooser, which appears after pressing the Path button and then selects the directory, in which the files are located. (3) The mime type and extension of the files have to be chosen within the corresponding combo boxes. (4) After pressing the OK button, the user sets the column ''bsin'' as a multimedia column. This will then result into the creation of both attributes ''bsin'' and ''bsinmedia'' of the entity Brand later on, as shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Mediadata3.png|thumb|600px|center|''Figure 17: Blobmapping attribute in entity Brand'']]&lt;br /&gt;
&lt;br /&gt;
==General Notice==&lt;br /&gt;
As soon as the user press the button &amp;quot;Create App&amp;quot;, an error message will eventually be displayed to inform the user to complete or adapt the metadata configuration of the considered csv file.&lt;br /&gt;
* '''Please note that a proper configuration of column definitions has to be done by the user as soon as id, reference or domain keys candidates have been detected.''' Candidates are columns of a csv file, which meet the criteria for either an id, a reference (both from alphanumerical string with UUID format as described above) or a domain key column. Setting the metadata of those columns is then '''mandatory'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''A universal unique identifier (UUID) will be automatically generated by the OS.bee Software Factory for an entity only in the case, in which no id-column candidates are available in a csv file.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Please note that all configurations made by the user in one csv file are immediately lost, as soon as the user close the file from the CSV2App module editor or by restarting the eclipse IDE.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further information over the usage of metadata such as '''id''', '''reference''' and '''domain key''' can be found in the [[Entity DSL]] documentation page.&lt;br /&gt;
&lt;br /&gt;
==Sorting options==&lt;br /&gt;
The sorting section allows you to sort the csv data within the editor. The selected column data can be sorted either in an ascending or a descending order.&lt;br /&gt;
[[File:Sorting.png|frame|center|''Figure 18: Sorting options'']]&lt;br /&gt;
&lt;br /&gt;
The following examples show you how to use the sort functions by applying it on the column ''brandNm'' of the provided [[#files|Brand.csv]] file. After you opened it in the CSV2App module editor within your eclipse workspace (for example via drag-n-drop), (1) make a left-mouse click on the column ''brandNm'', (2) choose either the ascending (figure 19) or the descending (figure 20) option in the sorting section, (3) and then press the OK button to trigger to the sorting of the column data. (4) You can observe the resulting sorted column data on the right side of both figures below.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
► '''Example 1''':&lt;br /&gt;
[[File:Sorting1.png|thumb|600px|center|''Figure 19: Ascending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
► '''Example 2''': &lt;br /&gt;
[[File:Sorting2.png|thumb|600px|center|''Figure 20: Descending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copyright Notice ==&lt;br /&gt;
{{Copyright Notice}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== License information ==&lt;br /&gt;
&lt;br /&gt;
{{License information}}&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2976</id>
		<title>AppUpIn5Extensions</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2976"/>
				<updated>2018-01-22T16:20:38Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: /* AppUpIn5 - Extensions 1.0 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Purpose==&lt;br /&gt;
&lt;br /&gt;
The purpose of this document is to describe the first set of functional extensions of the CSV2App module presented in the [[App up in 5 minutes]] page, which will be available with the next release version.&lt;br /&gt;
&lt;br /&gt;
=== OSBP applications===&lt;br /&gt;
&lt;br /&gt;
The OSBP application '''My1App''' should already have been generated before starting this app.  &lt;br /&gt;
You can find the instructions [http://download.osbee.org/documentation/index.php/My_first_app here].&lt;br /&gt;
&lt;br /&gt;
=== CSV-file ===&lt;br /&gt;
&lt;br /&gt;
You may use the two following files as reference files [http://download.osbee.org/downloads/samples/documentation/BrandType.csv BrandType.csv] and [http://download.osbee.org/downloads/samples/documentation/Brand.csv Brand.csv]&amp;lt;span id=&amp;quot;files&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''AppUpIn5 - Extensions 1.0'' ==&lt;br /&gt;
&lt;br /&gt;
You get access to those new functionalities by opening a csv file with the CSV2App module editor of the OS.bee Software Factory, and by making a left mouse click on the column you wish to edit the metadata from.[[File:Brandtype.png|left|frame|''Figure 1: Brandtype.csv im CSV2 Editor'']]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The setting dialog of the corresponding column will appear and several options will be available for you to choose, based on the analysis of the type of data contained in this column and the configurations you would have made so far.[[File:Brandtype1.png|frame|left|''Figure 2: Settings dialog of column &amp;quot;id&amp;quot;'']]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Metadata options==&lt;br /&gt;
The metadata section allows users to set additional information related to the entity that will be created, based on the content of a csv file and existing dsl model files.&lt;br /&gt;
&lt;br /&gt;
===Id===&lt;br /&gt;
With the option ''ID'' you are able to define the column representing the unique identifier data of an entity. An entity has always one identification key, also known as primary key, which is here a ''Universal Unique Identifier'' (UUID), a unique alphanumerical string. Only columns having this type of data can be defined by the user as ''ID''-columns.&lt;br /&gt;
&lt;br /&gt;
With a left mouse click on the column named ''id'' of the csv file ''BrandType.csv'', the user opens the settings dialog of this column.&lt;br /&gt;
&lt;br /&gt;
[[File:SettingsID.png|frame|center|''Figure 3: Settings dialog column &amp;quot;id&amp;quot; of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the ''ID'' checkbox, (2) and then pressing the OK button, the user set the column ''id'' as the ''ID''-column of the entity created later on, like shown on the figure below. Each entity has always one UUID attribute, therefore each csv file must have one ''ID''-column. The generated code later on will look like this snippet on figure 4.&lt;br /&gt;
&lt;br /&gt;
[[File:ID.png|frame|center|''Figure 4: Entity dsl model - &amp;quot;id&amp;quot; attribute of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
===Reference===&lt;br /&gt;
With the reference option you are able to set column data as reference data (or foreign key) pointing to the ''Universal Unique Identifier'' (primary key) of another '''already existing entity'''. These data are also alphanumerical values, as mentioned in the section above concerning the id-option. &lt;br /&gt;
&lt;br /&gt;
[[File:RefArea.png|frame|center|''Figure 5: Reference area.'']]&lt;br /&gt;
&lt;br /&gt;
A reference column results into the creation of a 1-n relation between the new entity, which will be created on the basis of the considered csv file and the referenced entity, which already exists in the entity model file of your project. The condition of having this target entity to be referenced on already existing in the model translates into a specific '''order of execution''' of the application creation:  successively pressing the button ''Create App'' in the right order to be able to choose the target entity.&lt;br /&gt;
&lt;br /&gt;
For instance, we would like to create a reference between the entity ''Brandtype'' and the new entity to be created ''Brand'', whose csv file contains the ''brandTypeId'' as column. As you can see on the left side of figure 6, showing the content of the entity dsl model file, the entity ''Brandtype'' has already been created.&lt;br /&gt;
&lt;br /&gt;
[[File:RefEntityBrand.png|thumb|600px|center|''Figure 6: Entity model file and Brand.csv file.'']]&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the reference checkbox, (2) selecting ''Brandtype'' in the list of all existing entities, (3) and then by pressing the OK button, the user set the column ''brandTypeId'' as a reference key pointing to the UUID of the entity ''Brandtype''.&lt;br /&gt;
&lt;br /&gt;
[[File:RefBrandtypeId.png|thumb|600px|center|''Figure 7: Settings dialog column &amp;quot;brandTypeId&amp;quot; of Brand'']]&lt;br /&gt;
&lt;br /&gt;
The result of this relation at the end of the app creation would then look like this.&lt;br /&gt;
&lt;br /&gt;
[[File:RefBrandtypeId1.png|thumb|600px|center|''Figure 8: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The optional tag &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; allows, when selected, the deletion of all elements of the n-side of the relation, when the one-side element is deleted. In our example, the removal of one brand type would then result to the deletion of all the brands categorized by that type. The generated relation would then look like this in contrast to last example.&lt;br /&gt;
&lt;br /&gt;
[[File:RefBrandtypeId2.png|thumb|600px|center|''Figure 9: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Besides the fact that here 1-n relations are created between entities, a reference attribute will also be generated in each entity. This is needed in order to show the information data of each relation graphically (here as table) in the application interface. This is characterized by the use of a &amp;lt;code&amp;gt;properties{...}&amp;lt;/code&amp;gt; block.&lt;br /&gt;
&lt;br /&gt;
===Domain key===&lt;br /&gt;
The domain key option allows the user to set a user friendly identification search field for the application instead of UUIDs, since those are too cryptic for users to clearly distinguish data from each other. &lt;br /&gt;
&lt;br /&gt;
Only column data from type string allow the user to define a column as the domain key column.&lt;br /&gt;
&lt;br /&gt;
In the case of the entity ''Brandtype'', an adequate candidate for the domain key is the column ''brandTypeNm'' containing the names of brand types, which are easy for users to read and identify data from in the application later on.&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the domain key checkbox, (2) and then pressing the OK button, the user define the column ''brandTypeNm'' as the domain key column of the entity Brandtype.&lt;br /&gt;
&lt;br /&gt;
[[File:Brandtypenm.png|frame|center|''Figure 10:  Settings dialog column &amp;quot;brandTypeNm&amp;quot; of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This results into the creation of the domain key attribute of the entity ''Brandtype'' as shown on the figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:BrandtypenmEntity.png|frame|center|''Figure 11: Domain key in entity dsl model'']]&lt;br /&gt;
&lt;br /&gt;
===Media data===&lt;br /&gt;
The media data option allows the user to define a column as a multimedia column. It allows user to specify from which columns information can be gathered from, in order to create the appropiate structures to store and upload any type of files in your application. This type of column contains the filenames of the multimedia files without extension. In addition to both the mime type and the extension, the user has also to define the directory path, where those files are located.&lt;br /&gt;
&lt;br /&gt;
[[File:Mediadata.png|thumb|600px|center|''Figure 12: Media data section'']]&lt;br /&gt;
&lt;br /&gt;
The currently supported mime types are the following: plain, jpg, mpeg, octetstream and pdf. &lt;br /&gt;
[[File:Mediadata4.png|thumb|600px|center|''Figure 13: Mimetypes'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The user can not just select one of the predefined extension formats (bmp, csv, jpg, mp3, pdf, txt, xml), but also edit an extension format on his own (java or sql...).&lt;br /&gt;
[[File:Mediadata5.png|thumb|600px|center|''Figure 14: Extensions'']]&lt;br /&gt;
&lt;br /&gt;
An optional column name can be given by the user to set the name of the multimedia column, which will be additionally created to store these files based on the OS.bee [[BlobMapping]] data type. If not defined, the media column name will consist of the actual column name followed with the suffix '''media'''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only columns containing text data can be defined as media data column by the user. &lt;br /&gt;
&lt;br /&gt;
[[File:Mediadata1.png|thumb|600px|center|''Figure 15: Media data on column &amp;quot;bsin&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
The column ''bsin'' of the entity Brand contains media file name. Besides being provided with the Brand.csv file, we also have the corresponding jpg-files illustrated here in figure 16.&lt;br /&gt;
&lt;br /&gt;
[[File:Mediadata2.png|thumb|600px|center|''Figure 16: Media file location'']]&lt;br /&gt;
&lt;br /&gt;
After opening the settings dialog of the column ''bsin'', (1) the user needs first to select the media data checkbox, which allows the modification of the information needed. (2) The user sets the path directory with the help of directory chooser, which appears after pressing the Path button and then selects the directory, in which the files are located. (3) The mime type and extension of the files have to be chosen within the corresponding combo boxes. (4) After pressing the OK button, the user sets the column ''bsin'' as a multimedia column. This will then result into the creation of both attributes ''bsin'' and ''bsinmedia'' of the entity Brand later on, as shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Mediadata3.png|thumb|600px|center|''Figure 17: Blobmapping attribute in entity Brand'']]&lt;br /&gt;
&lt;br /&gt;
==General Notice==&lt;br /&gt;
As soon as the user press the button &amp;quot;Create App&amp;quot;, an error message will eventually be displayed to inform the user to complete or adapt the metadata configuration of the considered csv file.&lt;br /&gt;
* '''Please note that a proper configuration of column definitions has to be done by the user as soon as id, reference or domain keys candidates have been detected.''' Candidates are columns of a csv file, which meet the criteria for either an id, a reference (both from alphanumerical string with UUID format as described above) or a domain key column. Setting the metadata of those columns is then '''mandatory'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''A universal unique identifier (UUID) will be automatically generated by the OS.bee Software Factory for an entity only in the case, in which no id-column candidates are available in a csv file.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Please note that all configurations made by the user in one csv file are immediately lost, as soon as the user close the file from the CSV2App module editor or by restarting the eclipse IDE.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further information over the usage of metadata such as '''id''', '''reference''' and '''domain key''' can be found in the [[Entity DSL]] documentation page.&lt;br /&gt;
&lt;br /&gt;
==Sorting options==&lt;br /&gt;
The sorting section allows you to sort the csv data within the editor. The selected column data can be sorted either in an ascending or a descending order.&lt;br /&gt;
[[File:Sorting.png|frame|center|''Figure 18: Sorting options'']]&lt;br /&gt;
&lt;br /&gt;
The following examples show you how to use the sort functions by applying it on the column ''brandNm'' of the provided [[#files|Brand.csv]] file. After you opened it in the CSV2App module editor within your eclipse workspace (for example via drag-n-drop), (1) make a left-mouse click on the column ''brandNm'', (2) choose either the ascending (figure 19) or the descending (figure 20) option in the sorting section, (3) and then press the OK button to trigger to the sorting of the column data. (4) You can observe the resulting sorted column data on the right side of both figures below.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
► '''Example 1''':&lt;br /&gt;
[[File:Sorting1.png|thumb|600px|center|''Figure 19: Ascending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
► '''Example 2''': &lt;br /&gt;
[[File:Sorting2.png|thumb|600px|center|''Figure 20: Descending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copyright Notice ==&lt;br /&gt;
{{Copyright Notice}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== License information ==&lt;br /&gt;
&lt;br /&gt;
{{License information}}&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2975</id>
		<title>AppUpIn5Extensions</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2975"/>
				<updated>2018-01-22T16:19:07Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: /* AppUpIn5 - Extensions 1.0 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Purpose==&lt;br /&gt;
&lt;br /&gt;
The purpose of this document is to describe the first set of functional extensions of the CSV2App module presented in the [[App up in 5 minutes]] page, which will be available with the next release version.&lt;br /&gt;
&lt;br /&gt;
=== OSBP applications===&lt;br /&gt;
&lt;br /&gt;
The OSBP application '''My1App''' should already have been generated before starting this app.  &lt;br /&gt;
You can find the instructions [http://download.osbee.org/documentation/index.php/My_first_app here].&lt;br /&gt;
&lt;br /&gt;
=== CSV-file ===&lt;br /&gt;
&lt;br /&gt;
You may use the two following files as reference files [http://download.osbee.org/downloads/samples/documentation/BrandType.csv BrandType.csv] and [http://download.osbee.org/downloads/samples/documentation/Brand.csv Brand.csv]&amp;lt;span id=&amp;quot;files&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''AppUpIn5 - Extensions 1.0'' ==&lt;br /&gt;
&lt;br /&gt;
You get access to those new functionalities by opening a csv file with the CSV2App module editor of the OS.bee Software Factory, and by making a left mouse click on the column you wish to edit the metadata from.&lt;br /&gt;
[[File:Brandtype.png|left|frame|''Figure 1: Brandtype.csv im CSV2 Editor'']]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The setting dialog of the corresponding column will appear and several options will be available for you to choose, based on the analysis of the type of data contained in this column and the configurations you would have made so far.&lt;br /&gt;
&lt;br /&gt;
[[File:Brandtype1.png|thumb|left|''Figure 2: Settings dialog of column &amp;quot;id&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
==Metadata options==&lt;br /&gt;
The metadata section allows users to set additional information related to the entity that will be created, based on the content of a csv file and existing dsl model files.&lt;br /&gt;
&lt;br /&gt;
===Id===&lt;br /&gt;
With the option ''ID'' you are able to define the column representing the unique identifier data of an entity. An entity has always one identification key, also known as primary key, which is here a ''Universal Unique Identifier'' (UUID), a unique alphanumerical string. Only columns having this type of data can be defined by the user as ''ID''-columns.&lt;br /&gt;
&lt;br /&gt;
With a left mouse click on the column named ''id'' of the csv file ''BrandType.csv'', the user opens the settings dialog of this column.&lt;br /&gt;
&lt;br /&gt;
[[File:SettingsID.png|frame|center|''Figure 3: Settings dialog column &amp;quot;id&amp;quot; of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the ''ID'' checkbox, (2) and then pressing the OK button, the user set the column ''id'' as the ''ID''-column of the entity created later on, like shown on the figure below. Each entity has always one UUID attribute, therefore each csv file must have one ''ID''-column. The generated code later on will look like this snippet on figure 4.&lt;br /&gt;
&lt;br /&gt;
[[File:ID.png|frame|center|''Figure 4: Entity dsl model - &amp;quot;id&amp;quot; attribute of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
===Reference===&lt;br /&gt;
With the reference option you are able to set column data as reference data (or foreign key) pointing to the ''Universal Unique Identifier'' (primary key) of another '''already existing entity'''. These data are also alphanumerical values, as mentioned in the section above concerning the id-option. &lt;br /&gt;
&lt;br /&gt;
[[File:RefArea.png|frame|center|''Figure 5: Reference area.'']]&lt;br /&gt;
&lt;br /&gt;
A reference column results into the creation of a 1-n relation between the new entity, which will be created on the basis of the considered csv file and the referenced entity, which already exists in the entity model file of your project. The condition of having this target entity to be referenced on already existing in the model translates into a specific '''order of execution''' of the application creation:  successively pressing the button ''Create App'' in the right order to be able to choose the target entity.&lt;br /&gt;
&lt;br /&gt;
For instance, we would like to create a reference between the entity ''Brandtype'' and the new entity to be created ''Brand'', whose csv file contains the ''brandTypeId'' as column. As you can see on the left side of figure 6, showing the content of the entity dsl model file, the entity ''Brandtype'' has already been created.&lt;br /&gt;
&lt;br /&gt;
[[File:RefEntityBrand.png|thumb|600px|center|''Figure 6: Entity model file and Brand.csv file.'']]&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the reference checkbox, (2) selecting ''Brandtype'' in the list of all existing entities, (3) and then by pressing the OK button, the user set the column ''brandTypeId'' as a reference key pointing to the UUID of the entity ''Brandtype''.&lt;br /&gt;
&lt;br /&gt;
[[File:RefBrandtypeId.png|thumb|600px|center|''Figure 7: Settings dialog column &amp;quot;brandTypeId&amp;quot; of Brand'']]&lt;br /&gt;
&lt;br /&gt;
The result of this relation at the end of the app creation would then look like this.&lt;br /&gt;
&lt;br /&gt;
[[File:RefBrandtypeId1.png|thumb|600px|center|''Figure 8: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The optional tag &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; allows, when selected, the deletion of all elements of the n-side of the relation, when the one-side element is deleted. In our example, the removal of one brand type would then result to the deletion of all the brands categorized by that type. The generated relation would then look like this in contrast to last example.&lt;br /&gt;
&lt;br /&gt;
[[File:RefBrandtypeId2.png|thumb|600px|center|''Figure 9: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Besides the fact that here 1-n relations are created between entities, a reference attribute will also be generated in each entity. This is needed in order to show the information data of each relation graphically (here as table) in the application interface. This is characterized by the use of a &amp;lt;code&amp;gt;properties{...}&amp;lt;/code&amp;gt; block.&lt;br /&gt;
&lt;br /&gt;
===Domain key===&lt;br /&gt;
The domain key option allows the user to set a user friendly identification search field for the application instead of UUIDs, since those are too cryptic for users to clearly distinguish data from each other. &lt;br /&gt;
&lt;br /&gt;
Only column data from type string allow the user to define a column as the domain key column.&lt;br /&gt;
&lt;br /&gt;
In the case of the entity ''Brandtype'', an adequate candidate for the domain key is the column ''brandTypeNm'' containing the names of brand types, which are easy for users to read and identify data from in the application later on.&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the domain key checkbox, (2) and then pressing the OK button, the user define the column ''brandTypeNm'' as the domain key column of the entity Brandtype.&lt;br /&gt;
&lt;br /&gt;
[[File:Brandtypenm.png|frame|center|''Figure 10:  Settings dialog column &amp;quot;brandTypeNm&amp;quot; of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This results into the creation of the domain key attribute of the entity ''Brandtype'' as shown on the figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:BrandtypenmEntity.png|frame|center|''Figure 11: Domain key in entity dsl model'']]&lt;br /&gt;
&lt;br /&gt;
===Media data===&lt;br /&gt;
The media data option allows the user to define a column as a multimedia column. It allows user to specify from which columns information can be gathered from, in order to create the appropiate structures to store and upload any type of files in your application. This type of column contains the filenames of the multimedia files without extension. In addition to both the mime type and the extension, the user has also to define the directory path, where those files are located.&lt;br /&gt;
&lt;br /&gt;
[[File:Mediadata.png|thumb|600px|center|''Figure 12: Media data section'']]&lt;br /&gt;
&lt;br /&gt;
The currently supported mime types are the following: plain, jpg, mpeg, octetstream and pdf. &lt;br /&gt;
[[File:Mediadata4.png|thumb|600px|center|''Figure 13: Mimetypes'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The user can not just select one of the predefined extension formats (bmp, csv, jpg, mp3, pdf, txt, xml), but also edit an extension format on his own (java or sql...).&lt;br /&gt;
[[File:Mediadata5.png|thumb|600px|center|''Figure 14: Extensions'']]&lt;br /&gt;
&lt;br /&gt;
An optional column name can be given by the user to set the name of the multimedia column, which will be additionally created to store these files based on the OS.bee [[BlobMapping]] data type. If not defined, the media column name will consist of the actual column name followed with the suffix '''media'''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only columns containing text data can be defined as media data column by the user. &lt;br /&gt;
&lt;br /&gt;
[[File:Mediadata1.png|thumb|600px|center|''Figure 15: Media data on column &amp;quot;bsin&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
The column ''bsin'' of the entity Brand contains media file name. Besides being provided with the Brand.csv file, we also have the corresponding jpg-files illustrated here in figure 16.&lt;br /&gt;
&lt;br /&gt;
[[File:Mediadata2.png|thumb|600px|center|''Figure 16: Media file location'']]&lt;br /&gt;
&lt;br /&gt;
After opening the settings dialog of the column ''bsin'', (1) the user needs first to select the media data checkbox, which allows the modification of the information needed. (2) The user sets the path directory with the help of directory chooser, which appears after pressing the Path button and then selects the directory, in which the files are located. (3) The mime type and extension of the files have to be chosen within the corresponding combo boxes. (4) After pressing the OK button, the user sets the column ''bsin'' as a multimedia column. This will then result into the creation of both attributes ''bsin'' and ''bsinmedia'' of the entity Brand later on, as shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Mediadata3.png|thumb|600px|center|''Figure 17: Blobmapping attribute in entity Brand'']]&lt;br /&gt;
&lt;br /&gt;
==General Notice==&lt;br /&gt;
As soon as the user press the button &amp;quot;Create App&amp;quot;, an error message will eventually be displayed to inform the user to complete or adapt the metadata configuration of the considered csv file.&lt;br /&gt;
* '''Please note that a proper configuration of column definitions has to be done by the user as soon as id, reference or domain keys candidates have been detected.''' Candidates are columns of a csv file, which meet the criteria for either an id, a reference (both from alphanumerical string with UUID format as described above) or a domain key column. Setting the metadata of those columns is then '''mandatory'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''A universal unique identifier (UUID) will be automatically generated by the OS.bee Software Factory for an entity only in the case, in which no id-column candidates are available in a csv file.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Please note that all configurations made by the user in one csv file are immediately lost, as soon as the user close the file from the CSV2App module editor or by restarting the eclipse IDE.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further information over the usage of metadata such as '''id''', '''reference''' and '''domain key''' can be found in the [[Entity DSL]] documentation page.&lt;br /&gt;
&lt;br /&gt;
==Sorting options==&lt;br /&gt;
The sorting section allows you to sort the csv data within the editor. The selected column data can be sorted either in an ascending or a descending order.&lt;br /&gt;
[[File:Sorting.png|frame|center|''Figure 18: Sorting options'']]&lt;br /&gt;
&lt;br /&gt;
The following examples show you how to use the sort functions by applying it on the column ''brandNm'' of the provided [[#files|Brand.csv]] file. After you opened it in the CSV2App module editor within your eclipse workspace (for example via drag-n-drop), (1) make a left-mouse click on the column ''brandNm'', (2) choose either the ascending (figure 19) or the descending (figure 20) option in the sorting section, (3) and then press the OK button to trigger to the sorting of the column data. (4) You can observe the resulting sorted column data on the right side of both figures below.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
► '''Example 1''':&lt;br /&gt;
[[File:Sorting1.png|thumb|600px|center|''Figure 19: Ascending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
► '''Example 2''': &lt;br /&gt;
[[File:Sorting2.png|thumb|600px|center|''Figure 20: Descending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copyright Notice ==&lt;br /&gt;
{{Copyright Notice}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== License information ==&lt;br /&gt;
&lt;br /&gt;
{{License information}}&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2974</id>
		<title>AppUpIn5Extensions</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=AppUpIn5Extensions&amp;diff=2974"/>
				<updated>2018-01-22T16:18:32Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: /* AppUpIn5 - Extensions 1.0 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Purpose==&lt;br /&gt;
&lt;br /&gt;
The purpose of this document is to describe the first set of functional extensions of the CSV2App module presented in the [[App up in 5 minutes]] page, which will be available with the next release version.&lt;br /&gt;
&lt;br /&gt;
=== OSBP applications===&lt;br /&gt;
&lt;br /&gt;
The OSBP application '''My1App''' should already have been generated before starting this app.  &lt;br /&gt;
You can find the instructions [http://download.osbee.org/documentation/index.php/My_first_app here].&lt;br /&gt;
&lt;br /&gt;
=== CSV-file ===&lt;br /&gt;
&lt;br /&gt;
You may use the two following files as reference files [http://download.osbee.org/downloads/samples/documentation/BrandType.csv BrandType.csv] and [http://download.osbee.org/downloads/samples/documentation/Brand.csv Brand.csv]&amp;lt;span id=&amp;quot;files&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ''AppUpIn5 - Extensions 1.0'' ==&lt;br /&gt;
&lt;br /&gt;
You get access to those new functionalities by opening a csv file with the CSV2App module editor of the OS.bee Software Factory, and by making a left mouse click on the column you wish to edit the metadata from.&lt;br /&gt;
[[File:Brandtype.png|left|frame|''Figure 1: Brandtype.csv im CSV2 Editor'']]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The setting dialog of the corresponding column will appear and several options will be available for you to choose, based on the analysis of the type of data contained in this column and the configurations you would have made so far.&lt;br /&gt;
&lt;br /&gt;
[[File:Brandtype1.png|frame|left|''Figure 2: Settings dialog of column &amp;quot;id&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
==Metadata options==&lt;br /&gt;
The metadata section allows users to set additional information related to the entity that will be created, based on the content of a csv file and existing dsl model files.&lt;br /&gt;
&lt;br /&gt;
===Id===&lt;br /&gt;
With the option ''ID'' you are able to define the column representing the unique identifier data of an entity. An entity has always one identification key, also known as primary key, which is here a ''Universal Unique Identifier'' (UUID), a unique alphanumerical string. Only columns having this type of data can be defined by the user as ''ID''-columns.&lt;br /&gt;
&lt;br /&gt;
With a left mouse click on the column named ''id'' of the csv file ''BrandType.csv'', the user opens the settings dialog of this column.&lt;br /&gt;
&lt;br /&gt;
[[File:SettingsID.png|frame|center|''Figure 3: Settings dialog column &amp;quot;id&amp;quot; of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the ''ID'' checkbox, (2) and then pressing the OK button, the user set the column ''id'' as the ''ID''-column of the entity created later on, like shown on the figure below. Each entity has always one UUID attribute, therefore each csv file must have one ''ID''-column. The generated code later on will look like this snippet on figure 4.&lt;br /&gt;
&lt;br /&gt;
[[File:ID.png|frame|center|''Figure 4: Entity dsl model - &amp;quot;id&amp;quot; attribute of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
===Reference===&lt;br /&gt;
With the reference option you are able to set column data as reference data (or foreign key) pointing to the ''Universal Unique Identifier'' (primary key) of another '''already existing entity'''. These data are also alphanumerical values, as mentioned in the section above concerning the id-option. &lt;br /&gt;
&lt;br /&gt;
[[File:RefArea.png|frame|center|''Figure 5: Reference area.'']]&lt;br /&gt;
&lt;br /&gt;
A reference column results into the creation of a 1-n relation between the new entity, which will be created on the basis of the considered csv file and the referenced entity, which already exists in the entity model file of your project. The condition of having this target entity to be referenced on already existing in the model translates into a specific '''order of execution''' of the application creation:  successively pressing the button ''Create App'' in the right order to be able to choose the target entity.&lt;br /&gt;
&lt;br /&gt;
For instance, we would like to create a reference between the entity ''Brandtype'' and the new entity to be created ''Brand'', whose csv file contains the ''brandTypeId'' as column. As you can see on the left side of figure 6, showing the content of the entity dsl model file, the entity ''Brandtype'' has already been created.&lt;br /&gt;
&lt;br /&gt;
[[File:RefEntityBrand.png|thumb|600px|center|''Figure 6: Entity model file and Brand.csv file.'']]&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the reference checkbox, (2) selecting ''Brandtype'' in the list of all existing entities, (3) and then by pressing the OK button, the user set the column ''brandTypeId'' as a reference key pointing to the UUID of the entity ''Brandtype''.&lt;br /&gt;
&lt;br /&gt;
[[File:RefBrandtypeId.png|thumb|600px|center|''Figure 7: Settings dialog column &amp;quot;brandTypeId&amp;quot; of Brand'']]&lt;br /&gt;
&lt;br /&gt;
The result of this relation at the end of the app creation would then look like this.&lt;br /&gt;
&lt;br /&gt;
[[File:RefBrandtypeId1.png|thumb|600px|center|''Figure 8: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The optional tag &amp;lt;code&amp;gt;cascade&amp;lt;/code&amp;gt; allows, when selected, the deletion of all elements of the n-side of the relation, when the one-side element is deleted. In our example, the removal of one brand type would then result to the deletion of all the brands categorized by that type. The generated relation would then look like this in contrast to last example.&lt;br /&gt;
&lt;br /&gt;
[[File:RefBrandtypeId2.png|thumb|600px|center|''Figure 9: Reference result on &amp;quot;brandTypeId&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Besides the fact that here 1-n relations are created between entities, a reference attribute will also be generated in each entity. This is needed in order to show the information data of each relation graphically (here as table) in the application interface. This is characterized by the use of a &amp;lt;code&amp;gt;properties{...}&amp;lt;/code&amp;gt; block.&lt;br /&gt;
&lt;br /&gt;
===Domain key===&lt;br /&gt;
The domain key option allows the user to set a user friendly identification search field for the application instead of UUIDs, since those are too cryptic for users to clearly distinguish data from each other. &lt;br /&gt;
&lt;br /&gt;
Only column data from type string allow the user to define a column as the domain key column.&lt;br /&gt;
&lt;br /&gt;
In the case of the entity ''Brandtype'', an adequate candidate for the domain key is the column ''brandTypeNm'' containing the names of brand types, which are easy for users to read and identify data from in the application later on.&lt;br /&gt;
&lt;br /&gt;
(1) By selecting the domain key checkbox, (2) and then pressing the OK button, the user define the column ''brandTypeNm'' as the domain key column of the entity Brandtype.&lt;br /&gt;
&lt;br /&gt;
[[File:Brandtypenm.png|frame|center|''Figure 10:  Settings dialog column &amp;quot;brandTypeNm&amp;quot; of Brandtype'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This results into the creation of the domain key attribute of the entity ''Brandtype'' as shown on the figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:BrandtypenmEntity.png|frame|center|''Figure 11: Domain key in entity dsl model'']]&lt;br /&gt;
&lt;br /&gt;
===Media data===&lt;br /&gt;
The media data option allows the user to define a column as a multimedia column. It allows user to specify from which columns information can be gathered from, in order to create the appropiate structures to store and upload any type of files in your application. This type of column contains the filenames of the multimedia files without extension. In addition to both the mime type and the extension, the user has also to define the directory path, where those files are located.&lt;br /&gt;
&lt;br /&gt;
[[File:Mediadata.png|thumb|600px|center|''Figure 12: Media data section'']]&lt;br /&gt;
&lt;br /&gt;
The currently supported mime types are the following: plain, jpg, mpeg, octetstream and pdf. &lt;br /&gt;
[[File:Mediadata4.png|thumb|600px|center|''Figure 13: Mimetypes'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The user can not just select one of the predefined extension formats (bmp, csv, jpg, mp3, pdf, txt, xml), but also edit an extension format on his own (java or sql...).&lt;br /&gt;
[[File:Mediadata5.png|thumb|600px|center|''Figure 14: Extensions'']]&lt;br /&gt;
&lt;br /&gt;
An optional column name can be given by the user to set the name of the multimedia column, which will be additionally created to store these files based on the OS.bee [[BlobMapping]] data type. If not defined, the media column name will consist of the actual column name followed with the suffix '''media'''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only columns containing text data can be defined as media data column by the user. &lt;br /&gt;
&lt;br /&gt;
[[File:Mediadata1.png|thumb|600px|center|''Figure 15: Media data on column &amp;quot;bsin&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
The column ''bsin'' of the entity Brand contains media file name. Besides being provided with the Brand.csv file, we also have the corresponding jpg-files illustrated here in figure 16.&lt;br /&gt;
&lt;br /&gt;
[[File:Mediadata2.png|thumb|600px|center|''Figure 16: Media file location'']]&lt;br /&gt;
&lt;br /&gt;
After opening the settings dialog of the column ''bsin'', (1) the user needs first to select the media data checkbox, which allows the modification of the information needed. (2) The user sets the path directory with the help of directory chooser, which appears after pressing the Path button and then selects the directory, in which the files are located. (3) The mime type and extension of the files have to be chosen within the corresponding combo boxes. (4) After pressing the OK button, the user sets the column ''bsin'' as a multimedia column. This will then result into the creation of both attributes ''bsin'' and ''bsinmedia'' of the entity Brand later on, as shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Mediadata3.png|thumb|600px|center|''Figure 17: Blobmapping attribute in entity Brand'']]&lt;br /&gt;
&lt;br /&gt;
==General Notice==&lt;br /&gt;
As soon as the user press the button &amp;quot;Create App&amp;quot;, an error message will eventually be displayed to inform the user to complete or adapt the metadata configuration of the considered csv file.&lt;br /&gt;
* '''Please note that a proper configuration of column definitions has to be done by the user as soon as id, reference or domain keys candidates have been detected.''' Candidates are columns of a csv file, which meet the criteria for either an id, a reference (both from alphanumerical string with UUID format as described above) or a domain key column. Setting the metadata of those columns is then '''mandatory'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''A universal unique identifier (UUID) will be automatically generated by the OS.bee Software Factory for an entity only in the case, in which no id-column candidates are available in a csv file.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Please note that all configurations made by the user in one csv file are immediately lost, as soon as the user close the file from the CSV2App module editor or by restarting the eclipse IDE.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further information over the usage of metadata such as '''id''', '''reference''' and '''domain key''' can be found in the [[Entity DSL]] documentation page.&lt;br /&gt;
&lt;br /&gt;
==Sorting options==&lt;br /&gt;
The sorting section allows you to sort the csv data within the editor. The selected column data can be sorted either in an ascending or a descending order.&lt;br /&gt;
[[File:Sorting.png|frame|center|''Figure 18: Sorting options'']]&lt;br /&gt;
&lt;br /&gt;
The following examples show you how to use the sort functions by applying it on the column ''brandNm'' of the provided [[#files|Brand.csv]] file. After you opened it in the CSV2App module editor within your eclipse workspace (for example via drag-n-drop), (1) make a left-mouse click on the column ''brandNm'', (2) choose either the ascending (figure 19) or the descending (figure 20) option in the sorting section, (3) and then press the OK button to trigger to the sorting of the column data. (4) You can observe the resulting sorted column data on the right side of both figures below.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
► '''Example 1''':&lt;br /&gt;
[[File:Sorting1.png|thumb|600px|center|''Figure 19: Ascending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
► '''Example 2''': &lt;br /&gt;
[[File:Sorting2.png|thumb|600px|center|''Figure 20: Descending sort of the column &amp;quot;brandNm&amp;quot;'']]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copyright Notice ==&lt;br /&gt;
{{Copyright Notice}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== License information ==&lt;br /&gt;
&lt;br /&gt;
{{License information}}&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Sorting2.png&amp;diff=2970</id>
		<title>File:Sorting2.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Sorting2.png&amp;diff=2970"/>
				<updated>2018-01-17T15:56:02Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Sorting1.png&amp;diff=2969</id>
		<title>File:Sorting1.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Sorting1.png&amp;diff=2969"/>
				<updated>2018-01-17T15:55:47Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Sorting.png&amp;diff=2968</id>
		<title>File:Sorting.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Sorting.png&amp;diff=2968"/>
				<updated>2018-01-17T15:55:22Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Mediadata3.png&amp;diff=2967</id>
		<title>File:Mediadata3.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Mediadata3.png&amp;diff=2967"/>
				<updated>2018-01-17T15:55:01Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Mediadata2.png&amp;diff=2966</id>
		<title>File:Mediadata2.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Mediadata2.png&amp;diff=2966"/>
				<updated>2018-01-17T15:54:38Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Mediadata1.png&amp;diff=2965</id>
		<title>File:Mediadata1.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Mediadata1.png&amp;diff=2965"/>
				<updated>2018-01-17T15:54:08Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Mediadata5.png&amp;diff=2964</id>
		<title>File:Mediadata5.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Mediadata5.png&amp;diff=2964"/>
				<updated>2018-01-17T15:53:03Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Mediadata4.png&amp;diff=2963</id>
		<title>File:Mediadata4.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Mediadata4.png&amp;diff=2963"/>
				<updated>2018-01-17T15:52:40Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Mediadata.png&amp;diff=2962</id>
		<title>File:Mediadata.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Mediadata.png&amp;diff=2962"/>
				<updated>2018-01-17T15:52:16Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:BrandtypenmEntity.png&amp;diff=2961</id>
		<title>File:BrandtypenmEntity.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:BrandtypenmEntity.png&amp;diff=2961"/>
				<updated>2018-01-17T15:51:51Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:Brandtypenm.png&amp;diff=2960</id>
		<title>File:Brandtypenm.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:Brandtypenm.png&amp;diff=2960"/>
				<updated>2018-01-17T15:51:15Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:RefBrandtypeId2.png&amp;diff=2959</id>
		<title>File:RefBrandtypeId2.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:RefBrandtypeId2.png&amp;diff=2959"/>
				<updated>2018-01-17T15:50:43Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	<entry>
		<id>https://download.osbee.org/documentation/index.php?title=File:RefBrandtypeId1.png&amp;diff=2958</id>
		<title>File:RefBrandtypeId1.png</title>
		<link rel="alternate" type="text/html" href="https://download.osbee.org/documentation/index.php?title=File:RefBrandtypeId1.png&amp;diff=2958"/>
				<updated>2018-01-17T15:50:18Z</updated>
		
		<summary type="html">&lt;p&gt;Worayeno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worayeno</name></author>	</entry>

	</feed>