You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Mihael Schmidt <ms...@sgbs.de> on 2017/09/26 11:53:32 UTC

@ElementCollection and delete

Hi,

I have an entity with an ElementCollection and the database entries from
the ElementCollection are not deleted when I delete the entity through the
entity manager.

We are on openjpa 2.2.2. Any idea how to delete them with a
em.remove(myentity)?

Code looks like this:

    @ElementCollection(targetClass=OfferedService.class, fetch =
FetchType.EAGER)
    @Enumerated(EnumType.STRING)
    @CollectionTable(name = "object_services", schema = "org", joinColumns
= @JoinColumn(name = "object_id"))
    @Column(name = "service")
    private List<OfferedService> services;

OfferendService is an enum.

Thanks in advance.

Mihael

-- 

Schulz Gebäudeservice GmbH & Co. KG
Dr.-Max-Ilgner-Straße 17
32339 Espelkamp
Persönlich haftende Gesellschafterin:
Gebäudereinigung Joachim Schulz
Verwaltungsgesellschaft mbH
Telefon: +49 5772 9100 0
Telefax: +49 5772 9100 11
Email: zentrale@sgbs.de
Internet: www.sgbs.de
Geschäftsführer: Joachim und Dirk Schulz, Norbert Kosica
Handelsregister Bad Oeynhausen: HRA 5902, HRB 8591
UST-Id-Nr.: DE 125752702