mardi 4 août 2015

How to put propper DBFLow annotation

I want to insert doctor object to database, how should i put annotations for properties in code below i tried to put it. But i don't know what about List of specializations and phoneNumber list.

@Table(databaseName = WMDatabase.NAME) public class Doctor extends BaseModel{

@Column
@PrimaryKey
@Unique(unique = true)
private String doctorId;

@Column
private FullName fullName;

@Column
private String organizationId;

@Column What shuld i put here?????
private List<Specialization> specializations;

@Column What shuld i put here?????    
private Contacts contacts;
}

I use classes below for as doctor attributes

public class Contacts extends BaseModel {

private List<PhoneNumber> phoneNumbers;
private String email;
private String fax;
}

public class Specialization extends BaseModel {

@Column
@PrimaryKey
@Unique(unique = true)
private String doctorId;

@Unique(unique = true)
private String specializationName;

public String getSpecializationName() {
    return specializationName;
}

public void setSpecializationName(String specializationName) {
    this.specializationName = specializationName;
}

Aucun commentaire:

Enregistrer un commentaire