Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Association Property Ordering

Avatar

Level 1

Hi,

I'm having trouble with unordered association properties...

Basically I get data conflicts because the order on the server does not match the client (because I may sort them on the client)

I'm using the HibernateAnnotationsAssembler... and after tracing through the code I can see the conflict is a result of the order test in the HibernateAssembler's propertiesConflict( ... ) method.

Is there any way I tell it that the association is not ordered?

In my Java class I have:

private Set<Item> mySet = new LinkedHashSet<Item>();

@OneToMany(fetch = FetchType.EAGER)

public Set<Item> getMySet() { ... }

// public setter follows...

And in my destination config:

<one-to-many property="mySet"  destination="..." />

I hope I didn't overlook something obvious... Since the propertiesConflict method checks if the property is ordered I'd imagine there's a straightforward way to set it without resorting to something ugly.  Please help!

Thanks!

0 Replies