You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by "KARR, DAVID (ATTCINW)" <dk...@att.com> on 2009/12/17 18:24:10 UTC

If I use both annotations and XML, will OpenJPA @OrderColumn annotation be ignored?

In my domain class, I have the following:

    @OneToMany(fetch = FetchType.EAGER)
    @OrderColumn(name = "SEQUENCE_NUM")
    private Set<Category>   childCategories;

In my orm.xml, I have:

            <one-to-many name="childCategories"
target-entity="Category">
                <join-table name="DCS_CAT_CHLDCAT">
                    <join-column name="CATEGORY_ID"
referenced-column-name="CATEGORY_ID"/>
                    <inverse-join-column name="CHILD_CAT_ID"
referenced-column-name="CATEGORY_ID"/>
                </join-table>
            </one-to-many>

The @OrderColumn annotation is JPA2 or OpenJPA-specific.  There is no
extension mechanism for the orm.xml, so there's no way for me to specify
"order-column" in the orm.xml.

As the XML is supposed to override annotations at the field level, does
this mean that my @OrderColumn annotation is going to be ignored?  Does
this mean that I have to put all the configuration for this field into
the annotations?