Search code examples
javatelosys

Telosys - Intended Usage of @Package Annotation


The documentation for @Package simply states that a user can specify the package the entity belongs to. I do not see any usage of this annotation in the examples provided for Java classes. I have taken to using the following syntax for package declarations:

package ${target.javaPackageFromFolder(${SRC})}.$entity.package;

However, that doesn't place the object in the right directory as my templates.cfg doesn't know about this $entity.package attribute.

When I specify:

${SRC}/${ROOT_PKG}/model/${entity.package} for the project folder in the templates.cfg, my output directory resolves to:

[INFO] OK : src/main/java/com/mycompany/model/${entity.package}/EntityName.java

What is the intended use of this annotation? Can someone point me in the right direction?


Solution

  • The "@Package" annotation is provided for certain special cases, for example for languages or modeling tools in which the name of the "package" does not necessarily depend on the directory in which the source files are located.

    This annotation is useless if you are in a context of Java code generation (nothing to do with "Java packages")