November 2018
Intermediate to advanced
388 pages
9h 5m
English
Now, let's modify the Person entity to add other entities to it. Let's say that Person has a list of contacts, which is explained in the following code:
@Table@Entityclass Person : Identity() { @Id lateinit var identifier: UUID lateinit var name: PersonName lateinit var loginId: String @Enumerated(EnumType.STRING) var preferredLanguage: PreferredLanguage? = null lateinit var contact: List<ContactDetails>}
ContactDetails is another type here:
class ContactDetails { private lateinit var id: UUID lateinit var number: String private var type: ContactType? = null}
Let's say ContactDetails has a ContactType, which is an enum type. A contact type might be, for example, WORK, MOBILE, or HOME:
enum class ContactType(val contactType: ...
Read now
Unlock full access