I have @ManyToOne relation in object and in the “one” side i don’t have a @OneToMany relation how can i can add the @IndexColumn in this situation?
And can i add @indexColumn in @ONeToOne relation?
I have @ManyToOne relation in object and in the one side i don’t have
Share
Your question doesn’t make much sense. IndexColumn is used to assign indices to the elements of a List, in a OneToMany or ManyToMany association. You just have a ManyToOne association, so there’s no list at all, so there is no need for an index column.
I could imagine you would want to execute a query returning all the children of a parent, and want them placed in a list at a specific index. In this case, you need to add a persistent index field to your child entity, execute the query, sort the children by index, and then create the indexed list by yourself:
For OneToOne associations, IndexColumn really doesn’t make any sense.