entity(entity.java.jet) - Entity class
Introduce
Generating the Java entity class.
Related knowledge:
Task
Model
Tag
Task And Model

- Model Group: shop
- Model: book
The model group of the current task is shop,
which contain a Java entity model book,
and the relation value of book is one;
More about the model structure of this demo, please click: Demo model structure
There are 2 ways to select the model:
- Select Model Group(Such as shop): <entity> tag need select the relation. This way is used in template, which require multiple models, such as many-to-one, many-to-many.

- Select Model(Such as book)(This demo): <entity> tag no need to select the relation. This way is used in template, which require only one model. Of course, you can also select relation together.

We have created the following properties for this model:
Class: A head uppercase property,
which can be used as the class name or a part that need head uppercase.
It's value is "Book".
class: A lowercase property,
which can be used as a part that need lowercase.
It's value is "book".
menu: The name of the menu bar, and it's value is "Book".

- Ext: The extension is java.
Tip: ou can get some property use ${} here.

Generate package, import, and class

- Use java:package tag to automatically get the current package path.
- Entity tag set the new variable object to get the selected model.
- Use java:class tag to get the class name. The class name is the file name of the task: the value of ${Class} is Book.
- Use the for iterate field collection to get the each of fullType, where the duplicate property is set to false, and if the content of the loop each the same, the output is no longer repeated. The java.lang.Integer is the same here, and there is no need to repeat the output.

Mouse above, you can see the information.

Result, you can see that java.lang.Integer has not been duplicated

Generate field and construction

- Use for tag iterate over to generate fields, the structure is: private field.type field.name.
- Use java:class tag to generate class name and empty construction.
- Use java:class tag to generate class name, for tag to generate parameters, the structure is: field.type field.name.
name and type in the model

Result

Generate get/set method

- Use the for tag iterate over field to output the get and set methods.
- The format of the get method is:
public field.type get + field.name[head uppercase](){
return field.name;
}
- The format of the set method is:
public void set + field.name[head uppercase](field.type field.name){
this.field.name = field.name;
}
Result

Other
Similarly, you can also rewrite the hasCode and equal methods.