GitHub    Download    Forum
Overview
Tutorial
Database setup
Preparing the project
Establish the connection
Shut down the connection
DTDL types
Creating the schema
DADL classes
Entry point object
Write and read attributes
Write and read lists
Extending the schema
Modified entry point object
Write and read objects
Write and read object lists
C++ API
C# API
DTDL
DADL
Setup

Data Access Definition

Add a new file to your project if you did not already do so in an earlier step. "Add > New item…" and select the "DTDL file" from the DataFS folder. Leave the name as it is.
In this file, we need to import the compiled version of our DTDL file. You will find the BDTD file inside the "_data" subfolder of your project folder.
#import <DataDefinition.bdtd>
Next, we are going to create our new object, which we call "WSupplies".
Remarks: Note that a DADL object's name should never be the same as any DADL file's name in your project, as it may cause collisions and file overwriting.
Our object has just one class. We define which functions DADL should generate for us. We can choose from get, set, remove and open, but here we just use the first three.
object WSupplies
{
	Tutorial::Supplies
	{
		Description	[get, set, remove];
		LastUpdated	[get, set];
		Shops		[get, set, remove];
	}
};
We should end up with this code here:
AccessDefinition.dadl
#import <DataDefinition.bdtd>

object WSupplies
{
	Tutorial::Supplies
	{
		Description	[get, set, remove];
		LastUpdated	[get, set];
		Shops		[get, set, remove];
	}
};
With this, we have built our "Supplies" object, which we can now use.
© 2022 Mobiland AG