mariofelesdossantosjr
02/14/2018, 3:43 PMbkenn
02/14/2018, 3:47 PMbkenn
02/14/2018, 4:42 PMbkenn
02/14/2018, 4:42 PM@get:Transient
val customersProperty: ObservableList<Customer> = FXCollections.observableArrayList()
@OneToMany(fetch = FetchType.EAGER, cascade = [CascadeType.ALL])
fun getCustomers(): List<Customer> = customersProperty.toList()
fun setCustomers(customers: List<Customer>) {
customersProperty.setAll(customers)
}
bkenn
02/14/2018, 4:42 PMbkenn
02/14/2018, 4:48 PMmariofelesdossantosjr
02/14/2018, 7:42 PMmariofelesdossantosjr
02/14/2018, 7:42 PMbkenn
02/14/2018, 7:50 PMbkenn
02/14/2018, 8:43 PMthis.customers.setAll(customers)
, inside the setCustomers
, in a try-catch, I receive a java.lang.UnsupportedOperationException: Operation is not supported for read-only collection
bkenn
02/14/2018, 8:48 PMbkenn
02/14/2018, 9:39 PMbkenn
02/14/2018, 9:41 PMbkenn
02/14/2018, 10:12 PMCascadeType.ALL
from `Vendor`'s customers
. Then we have to save the customer entity before we add the customer
to the pre-saved vendor
and then we can save the vendor
.bkenn
02/14/2018, 10:13 PMmariofelesdossantosjr
02/15/2018, 12:07 PM