telosystools

Open full view…

$entity.hasTag(String tagName) always returns false

Manuel Neto
Tue, 18 Jul 2023 14:12:35 GMT

The `$entity.hasTag(String tagName)` method always returns false and the `$entity.tagValue(String tagName)` method always returns empty.

Manuel Neto
Wed, 19 Jul 2023 16:43:57 GMT

Sorry, that was my mistake. Despite the [documentation](https://doc.telosys.org/dsl-model/tags) not showing this, I found my mistake when defining tags on the entity. I had done it like this: --- @AggregateRoot @DbTable(T_CATALOG) Catalog { season : short { @Id @NotNull @Min(2000) @Max(2050) }; brand : short { @Id @NotNull @Min(1) @Max(999)} ; title : string { @NotNull @NotEmpty @Size(50) } ; // Tags #label(test) } --- But the correct thing is: --- @AggregateRoot @DbTable(T_CATALOG) // Tags #label(test) Catalog { season : short { @Id @NotNull @Min(2000) @Max(2050) }; brand : short { @Id @NotNull @Min(1) @Max(999)} ; title : string { @NotNull @NotEmpty @Size(50) } ; } --- Thanks.