Firebase 데이터베이스를 만드는 중입니다.
클래스를 모델링하려고합니다. 매우 간단한 수업 :
package com.glups.model;
import com.google.firebase.database.IgnoreExtraProperties;
@IgnoreExtraProperties
public class AlumnoFB {
private String nombre;
private String apellidos;
private String telefono;
private String email;
private Boolean tieneWhatsapp;
private Boolean tieneTelegram;
private Boolean tieneHangouts;
private Long formaPago;
private Double ratioHora;
private Double precioHora;
private Double horasCompensadas;
public AlumnoFB() {
// Default constructor required for calls to DataSnapshot.getValue(User.class)
}
public AlumnoFB(String nombre,
String apellidos,
String telefono,
String email,
Boolean tieneWhatsapp,
Boolean tieneTelegram,
Boolean tieneHangouts,
Long formaPago,
Double ratioHora,
Double precioHora,
Double horasCompensadas) {
this.nombre = nombre;
this.apellidos = apellidos;
this.telefono = telefono;
this.email = email;
this.tieneWhatsapp = tieneWhatsapp;
this.tieneTelegram = tieneTelegram;
this.tieneHangouts = tieneHangouts;
this.formaPago = formaPago;
this.ratioHora = ratioHora;
this.precioHora = precioHora;
this.horasCompensadas = horasCompensadas;
}
}
Firebase의 샘플 클래스와 거의 같습니다.
getUser ()에서 얻은 애플리케이션 사용자가 Firebase에 로그인되었습니다.
SetValue를 호출 할 때 :
AlumnoFB alumno = new AlumnoFB("", "", "", "", false, false, false, ((Integer)FormaPago.INT_NO_PAGADO).longValue(), 0.0, 0.0, 0.0);
mDatabase.child("AlumnoFB").child(ControlClasesFirebase.getUser().getUid()).setValue(alumno) ;
치명적인 예외가 발생합니다.
06-10 10:17:37.179 13841-13841/com.glups.controlclases E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.glups.controlclases, PID: 13841 com.google.firebase.database.DatabaseException: No properties to serialize found on class com.glups.model.AlumnoFB
at com.google.android.gms.internal.zzaix$zza.<init>(Unknown Source)
at com.google.android.gms.internal.zzaix.zzj(Unknown Source)
at com.google.android.gms.internal.zzaix.zzaw(Unknown Source)
at com.google.android.gms.internal.zzaix.zzav(Unknown Source)
at com.google.firebase.database.DatabaseReference.zza(Unknown Source)
at com.google.firebase.database.DatabaseReference.setValue(Unknown Source)
at com.glups.controlclases.MainActivity$4.onClick(MainActivity.java:305)
at android.view.View.performClick(View.java:4780)
at android.view.View$PerformClick.run(View.java:19866)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5258)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
유형을 확인했으며 모두 허용됩니다. 뭐가 문제 야?