-1

Because it keeps the child in minuscule firebase, even though my properties are in upper case

enter image description here

mActividadReferencia.child(Actividad.getActividadID()).setValue(Actividad, new DatabaseReference.CompletionListener() {
        @Override
        public void onComplete(DatabaseError databaseError, DatabaseReference databaseReference) {

            if(databaseError != null)
            {
                exito=true;
            }
            else
            {
                exito=false;

            }
        }
    });

POJO

public class Actividad {

    private String ActividadID;
    private String CustomerID;
    private String Kunnr;
    private String Descripcion;
    private String CodUsuario;
    private Date FechaIniPlan;
    private Date FechaFinPlan;
    private Date FechaIniReal;
    private Date FechaFinReal;
    private Double LatitudPlan;
    private Double LongitudPlan;
    private Double LatitudReal;
    private Double LongitudReal;
    private Date FechaCrea;
    private String Observacion;
    private String Estado;
    private String MotivoNoActividad;

    public Actividad() {
    }

I would thank you very much for your help, and if there any to to infring your child in capitals without a map.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807

1 Answers1

1

Yes, this is happening because Firebase is looking in your model class after fields that are not starting with a capital letter. If it finds fields like yours, it will replace that field with the corresponding first non-capital letter field. You should take a look on Java Naming Conventions to know how can you correctly name your classes / methods / fields in Java. In your case, the correct way to model your class would be:

public class Actividad {
    private String actividadID;
    private String customerID;
    private String kunnr;
    private String descripcion;
    private String codUsuario;
    private Date fechaIniPlan;
    private Date fechaFinPlan;
    private Date fechaIniReal;
    private Date fechaFinReal;
    private Double latitudPlan;
    private Double longitudPlan;
    private Double latitudReal;
    private Double longitudReal;
    private Date fechaCrea;
    private String observacion;
    private String estado;
    private String motivoNoActividad;

    public Actividad() {}

    //public setters and getters
}
Alex Mamo
  • 130,605
  • 17
  • 163
  • 193