Mount names
Entities, objects, operations, and queries have mount names:
- for entities and objects, those names are the SQL table names where the data gets stored
- for operations and queries, you use a mount name to invoke an operation or a query from the outside
By default, you define a mount name by a fully qualified name of a definition:
namespace foo {
namespace bar {
entity user {}
}
}
The mount name for the entity user
is foo.bar.user
.
Custom mount names
You can use the @mount
annotation to specify a custom mount name:
@mount('foo.bar.user')
entity user {}
You can specify the @mount
annotation for entities, objects,
operations, and queries.
Mount for namespace
@mount('foo.bar')
namespace ns {
entity user {}
}
The mount name of a user
is foo.bar.user
.
Mount for module
@mount('foo.bar')
module;
entity user {}
The mount name of a user
is foo.bar.user
.
Nested namespace mounts
A mount name can be relative to the context mount name. For example, when defined in a namespace:
@mount('a.b.c')
namespace ns {
entity user {}
}
The entity user
has the following mount names when annotated with
@mount
:
@mount('.d.user')
->a.b.c.d.user
@mount('^.user')
->a.b.user
@mount('^^.x.user')
->a.x.user
Special character .
appends names to the context mount name, and ^
removes the last part from the context mount name.
A mount name can end with .
. If that's the case, then the name of the definition gets appended to the mount name:
@mount('foo.')
entity user {} // mount name = "foo.user"
@mount('foo')
entity user {} // mount name = "foo"