generator-jhipster: JavaBean methods are not correct when the first letter is lower case and the second letter is uppercase

The data is not saved and there is no error message on the UI, seems like bean validation failure Here is the testEntity, strangely if i use tcap instead of tCap in attribute name it works!

{
    "relationships": [],
    "fields": [
        {
            "fieldId": 1,
            "fieldName": "tCap",
            "fieldType": "String",
            "fieldNameCapitalized": "TCap",
            "fieldNameUnderscored": "t_cap",
            "fieldValidate": true,
            "fieldValidateRules": [
                "required"
            ]
        }
    ],
    "fieldsContainOwnerManyToMany": false,
    "fieldsContainOneToMany": false,
    "fieldsContainLocalDate": false,
    "fieldsContainCustomTime": false,
    "fieldsContainBigDecimal": false,
    "fieldsContainDateTime": false,
    "fieldsContainDate": false,
    "changelogDate": "20150313034831",
    "pagination": "no",
    "validation": true
}

All files seems to generated properly

Here is the request payload in the PUT request from chrome console( Isnt the create request suppose to be POST? )

{tCap: "test", id: null}

Here is the error from console

error: "Bad Request"
exception: "org.springframework.web.bind.MethodArgumentNotValidException"
message: "Validation failed for argument at index 0 in method: public org.springframework.http.ResponseEntity<java.lang.Void> com.tcs.testapp.web.rest.TestEntityResource.update(com.tcs.testapp.domain.TestEntity) throws java.net.URISyntaxException, with 1 error(s): [Field error in object 'testEntity' on field 'tCap': rejected value [null]; codes [NotNull.testEntity.tCap,NotNull.tCap,NotNull.java.lang.String,NotNull]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [testEntity.tCap,tCap]; arguments []; default message [tCap]]; default message [may not be null]] "
path: "/api/testEntitys"
status: 400
timestamp: 1426220537642

I’ll try to debug and see whats happening when i find time from work

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 16 (16 by maintainers)

Most upvoted comments

OK you are correct, sorry! No idea what’s wrong, I’m checking this up