Generated code walkthrough

Now let's take a look at what has been generated. Let's open the application code in our favorite IDE/editor and look at what has been generated for the Product entity.

You might have noticed that there is a .jhipster folder at the root of the project, and if you look inside it, you will see a bunch of JSON files. Let's look at Product.json; it holds metadata about the generated entity and is used by JHipster to regenerate and edit an entity when needed:

{
"name": "Product",
"fields": [
{
"fieldName": "name",
"fieldType": "String",
"fieldValidateRules": [
"required"
]
},
{
...
},
{
"fieldName": "price",
"fieldType": "BigDecimal",
"fieldValidateRules": [
"required",
"min"
],
"fieldValidateRulesMin": 0
},
{
"fieldName": "size",
"fieldType": "Size",
"fieldValues": "S,M,L,XL,XXL",
"fieldValidateRules": [
"required"
]
},
{
"fieldName": "image",
"fieldType": "byte[]",
"fieldTypeBlobContent": "image"
}
],
"relationships": [
{
"relationshipType": "many-to-one",
"otherEntityName": "productCategory",
"otherEntityRelationshipName": "product",
"relationshipName": "productCategory",
"otherEntityField": "id"
}
],
"changelogDate": "20191207131119",
"javadoc": "Product sold by the Online store",
"entityTableName": "product",
"dto": "no",
"pagination": "pagination",
"service": "serviceClass",
"jpaMetamodelFiltering": false,
"fluentMethods": true,
"readOnly": false,
"clientRootFolder": "",
"applications": "*"
}

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.244.216