下面的代码显示我已经创建了一个类名的实体UserGeneral。该实体独有的每一列都有相应的 getter 和 setter。但是,外键没有 getter 和 setter。我需要为user_details_idand提供 getter 和 setteruser_location_id吗?
@Entity(
tableName = "User_General",
indices = {
@Index("user_details_id"),
@Index("user_location_id")
},
foreignKeys = {
@ForeignKey(
entity = UserDetails.class,
parentColumns = "user_details_id",
childColumns = "user_details_id"
),
@ForeignKey(
entity = UserLocation.class,
parentColumns = "user_location_id",
childColumns = "user_location_id"
)
}
)
public class UserGeneral {
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = "user_general_id")
private int user_general_id;
@ColumnInfo(name = "first_name")
private String first_name;
@ColumnInfo(name = "last_name")
private String last_name;
@ColumnInfo(name = "flagged_delete")
private boolean flagged_delete;
@ColumnInfo(name = "user_details_id")
private int user_details_id;
@ColumnInfo(name = "user_location_id")
private int user_location_id;
public int getUser_general_id() {
return user_general_id;
}
public void setUser_general_id(int user_general_id) {
this.user_general_id = user_general_id;
}
public String getFirst_name() {
return first_name;
}
public void setFirst_name(String first_name) {
this.first_name = first_name;
}
public String getLast_name() {
return last_name;
}
public void setLast_name(String last_name) {
this.last_name = last_name;
}
public boolean isFlagged_delete() {
return flagged_delete;
}
public void setFlagged_delete(boolean flagged_delete) {
this.flagged_delete = flagged_delete;
}
}
智慧大石
相关分类