https://kotlinlang.org logo
#announcements
Title
# announcements
d

dG

09/24/2019, 11:32 AM
when `.copy()`ing a data class that inherits from an open class, the properties/constructor values from the open class are not copied. I understand why, but what is the proper way to do this then?
s

spand

09/24/2019, 11:34 AM
Make the base class an interface
d

dG

09/24/2019, 11:40 AM
Seems I cannot use (JPA) annotations on fields in an interface, though
s

spand

09/24/2019, 11:47 AM
Too bad
You can always implement your own
copy()
method if that is all you wanted from the data class concept
Maybe if you leave the base class properties abstract ? https://stackoverflow.com/a/54418002/422924
d

diesieben07

09/24/2019, 12:06 PM