jackmiras
02/23/2017, 2:22 AM@Json
in the code. So after a while fighting with the code I was able to make things work and as mentioned before I would let you guys know if things work and how it works so check the code down bellow:
@Entity
@Indexes(Index(value = "id", fields = arrayOf(Field("id"))))
data class Platform @JsonCreator constructor(@JsonProperty(value = "model") var model:String,
@JsonProperty(value = "latitude") var latitude: Long,
@JsonProperty(value = "longitude") var longitude: Long) {
@Id
var id = 0L
@Property
lateinit var createdAt: Date
@Property
lateinit var updatedAt: Date
@Reference(concreteClass = CountryProperty::class, idOnly = true, lazy = true)
var countryPropertyId = 0L
@Reference(concreteClass = Data::class, idOnly = true, lazy = true)
lateinit var dataIds: Array<Long>
@Reference(concreteClass = DataChinese::class, idOnly = true, lazy = true)
lateinit var dataChineseIds: Array<Long>
fun isValid(): Boolean {
return countryPropertyId > 0 && model.isNotBlank()
}
}
Thank you @groostav and @jjnguy for give some ideas to figure this out!!