entity(entity.java.jet) - Entity class

Introduce

Generating the Java entity class.

Related knowledge:

Task

Model

Tag


Task And Model

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:

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".

Tip: ou can get some property use ${} here.


Generate package, import, and class

Mouse above, you can see the information.

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

Generate field and construction

name and type in the model

Result

Generate get/set method

  public field.type get + field.name[head uppercase](){
     return field.name;
  }
  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.