2
java 백엔드 서버에서 uuid를 사용합니다. 그래서 엔티티가 제대로 싱크되었는지 확인하기 위해 안드로이드의 uuid를 사용해야합니다. 나는 Is it possible to apply primary key on the text fields in android database과 text as primarykey in android을 알고 있습니다. 이 무언가를 만들고 싶습니다Android에서 PrimaryKey로 String을 사용할 수 있습니까?
@Entity(tableName = CrewColumns.TABLE_NAME)
@TypeConverters(BigDecimalConverter::class)
@JsonIgnoreProperties(ignoreUnknown = true)
class Crew() {
constructor (uuid: String) : this() {
this.uuid = uuid;
}
/**
* The unique ID of the item.
*/
@PrimaryKey
@ColumnInfo(name = CrewColumns.UUID)
var uuid: String = ""
@ColumnInfo(name = CrewColumns.NAME)
var name: String = ""
}
방 (DAO 등)에 문제가 있습니까? 고맙습니다.
. 시도했을 때 어떤 특별한 문제가 발생 했습니까? – CommonsWare
@CommonsWare 현재 없음. – ThomasEdwin