vscode-java-code-generator icon indicating copy to clipboard operation
vscode-java-code-generator copied to clipboard

Generate Getters duplicate with boolean property

Open thang1160 opened this issue 3 years ago • 2 comments

as you can see, my variable name is is_pinned. It would be better if isIs_pinned only have 1 is (ie: isPinned)

image

thang1160 avatar May 11 '21 17:05 thang1160

isPinned was a terrible idea, Hibernate can't recognize it:

Caused by: org.hibernate.PropertyNotFoundException: Could not locate setter method for property [fpt.saplab.sciencemanagementandinternationalaffairsresearcher.model.Article#pinned]

getIs_pinned and Is_pinned works well, also with isIs_pinned 😂

thang1160 avatar May 11 '21 19:05 thang1160

Why are you using snake case in Java?

igortavtib avatar Dec 10 '21 12:12 igortavtib

name the variable to just pinned and let the generator append is to it. also we follow Java Naming Conventions, Java follows camel-case syntax for naming the class, interface, method, and variable.

sohibegit avatar Apr 23 '23 23:04 sohibegit