Found two getters or fields with conflicting case sensitivity for property

前端 未结 6 1512
陌清茗
陌清茗 2020-12-20 17:08

Can anyone check if there are errors in it because I always get an error

com.google.firebase.database.DatabaseException: Found two getters or fields

6条回答
  •  一向
    一向 (楼主)
    2020-12-20 17:41

    Try to fix the capitalization on your fields and methods. firstName, getFirstName... etc

    Your error is on the CV field, where the method should be setCV to match the case of the field, though, you should name it cv following Java naming contentions. And the method is then get or setCv

    public String getCv() {
        return cv;
    }
    
    public void setCv(String cv) {
        this.cv = cv;
     }
    

    I would also suggest not storing passwords as part of your objects. Especially if they are plain text. You send passwords to the database to check for validity or to update; it's seldom a good idea to read them out and persist them elsewhere

提交回复
热议问题