Java Object API

Hi, which Is the correct Java API /snippet to delete and object entry (if It exists) and all related Object entries?

1 Answer

1

When you define the object relationships, you can actually edit the relationship and change the delete mode. Sounds like you want to set yours to be a cascading delete.

Then, in REST, you’re just going to use the DELETE method that you can find under /o/api and your specific Object API.

By deleting the primary object with cascading delete set, that will delete the object entry and all related entries.

Thanks @dnebing , but I need the JAVA API.... ObjectEntryLocalService?

ObjectEntryLocalService is not an option for this since it becomes tightly coupled with code and upgrades require code changes. object entry manager is an option to use API is still preferred

ObjectEntryManager is the best option: https://github.com/liferay/liferay-portal/blob/master/modules/apps/object/object-rest-api/src/main/java/com/liferay/object/rest/manager/v1_0/ObjectEntryManager.java

Thanks, do you know what Is dtoConverterContext or scopeKey? There are examples? @Dani_De_Francisco