I have a Country entity that has a one-to-many relationship with the Cities entity,
When I create the Country records with their respective cities, I have no problems, but when I want to visualize the cities, it does not show them to me, due to the internal error that is created when it persists. This occurs since you change the List attributes to LIstProperty for the list of Cities attribute. Earlier with List and ArrayList I did not present this error and the relationship between entities worked correctly.
How can i fix this?
Unexpeted internal exception
Please post the precise error message and the full stack trace of the error.
It would be helpful to read the posting instructions to improve the effectiveness of your posts.
The application does not show any error, the persistence of the countries of the entity and that of the cities, are carried out correctly. The problem is when I want to visualize the cities, it does not show them, because in the listaCiudades field it does not show me the related objects, but it shows the error "Unexpected internal exception", as seen in the captured Objectdb Explorer panel. This happens when I use this attribute:
Private ListProperty <GS_TablaCiudades> listaCiudades= new SimpleListProperty <GS_TablaCiudades> (FXCollections.observableArrayList (new ArrayList <GS_TablaCiudades> ()));
but when I use this other attribute, the relationship works correctly and in the listaCiudades attribute it shows me the related objects.
Private List<GS_TablaCiudades> listaCiudades = new ArrayList <> ();
I sent you the capture of the correct relationship with the attribute List <>
Can you post a sample database for review?
I sent you the Database with the error and the Database with the correct data.
and I also send you the views where the data is displayed by applying the attribute List <>
Both databases in #5 above seem to be empty.
Sorry for the dismissal, these are checked
Apparently there is a problem with the listaCiudades field in GS_TablaPaises
@OneToMany(targetEntity = GS_TablaCiudades.class, mappedBy = "paises", cascade = CascadeType.ALL) private ListProperty<GS_TablaCiudades> listaCiudades = new SimpleListProperty<GS_TablaCiudades>(FXCollections.observableArrayList());
ListProperty is not a supported type. Use List instead (see this paragraph in the manual).